|
@@ -2,7 +2,6 @@ package com.xjrsoft.common.interceptor;
|
|
|
|
|
|
import cn.dev33.satoken.session.SaSession;
|
|
import cn.dev33.satoken.session.SaSession;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
-import cn.dev33.satoken.strategy.SaStrategy;
|
|
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
import com.xjrsoft.common.enums.ResponseCode;
|
|
import com.xjrsoft.common.enums.ResponseCode;
|
|
import com.xjrsoft.common.model.result.R;
|
|
import com.xjrsoft.common.model.result.R;
|
|
@@ -41,11 +40,11 @@ public class MagicApiRequestInterceptor implements RequestInterceptor {
|
|
roleIds = tokenSession.get(GlobalConstant.LOGIN_USER_ROLE_ID_KEY, new ArrayList<>());
|
|
roleIds = tokenSession.get(GlobalConstant.LOGIN_USER_ROLE_ID_KEY, new ArrayList<>());
|
|
}
|
|
}
|
|
//非管理员需要进行权限验证
|
|
//非管理员需要进行权限验证
|
|
- if (!roleIds.contains(GlobalConstant.SUPER_ADMIN_ROLE_ID)) {
|
|
|
|
- if (!SaStrategy.me.hasElement.apply(tokenSession.get(GlobalConstant.LOGIN_USER_INTERFACE_AUTH_CODE_KEY, new ArrayList<>()), requestEntity.getApiInfo().getId())) {
|
|
|
|
- return R.error(ResponseCode.MAGIC_API_UN_AUTHORIZED.getCode(), ResponseCode.MAGIC_API_UN_AUTHORIZED.getMessage());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// if (!roleIds.contains(GlobalConstant.SUPER_ADMIN_ROLE_ID)) {
|
|
|
|
+// if (!SaStrategy.me.hasElement.apply(tokenSession.get(GlobalConstant.LOGIN_USER_INTERFACE_AUTH_CODE_KEY, new ArrayList<>()), requestEntity.getApiInfo().getId())) {
|
|
|
|
+// return R.error(ResponseCode.MAGIC_API_UN_AUTHORIZED.getCode(), ResponseCode.MAGIC_API_UN_AUTHORIZED.getMessage());
|
|
|
|
+// }
|
|
|
|
+// }
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|