Merge remote-tracking branch 'origin/master'

This commit is contained in:
2025-06-25 21:56:56 +08:00
13 changed files with 578 additions and 19 deletions

View File

@@ -5,9 +5,11 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.dto.CurrentUser;
import java.util.List;
import java.util.prefs.BackingStoreException;
/**
* @author: lyd
@@ -23,23 +25,12 @@ public class SecurityUtils {
* @return 系统用户
*/
public static CurrentUser getCurrentUser() {
try {
Object loginInfo = StpUtil.getExtra("loginInfo");
if (loginInfo==null){
CurrentUser currentUser = new CurrentUser();
currentUser.setId("2");
currentUser.setPresonName("外部系统用户");
currentUser.setUsername("admin");
return currentUser;
}
return JSONObject.parseObject(String.valueOf(loginInfo),CurrentUser.class);
} catch (Exception e) {
CurrentUser currentUser = new CurrentUser();
currentUser.setId("2");
currentUser.setPresonName("外部系统用户");
currentUser.setUsername("admin");
return currentUser;
Object loginInfo = StpUtil.getExtra("loginInfo");
if (loginInfo==null){
throw new BadRequestException("用户信息获取失败");
}
return JSONObject.parseObject(String.valueOf(loginInfo),CurrentUser.class);
}
/**