|
@@ -7,6 +7,7 @@ import com.citu.framework.security.core.LoginUser;
|
|
|
import com.citu.framework.security.core.util.SecurityFrameworkUtils;
|
|
|
|
|
|
import static com.citu.framework.common.exception.enums.GlobalErrorCodeConstants.FORBIDDEN;
|
|
|
+import static com.citu.framework.common.exception.enums.GlobalErrorCodeConstants.UNAUTHORIZED;
|
|
|
import static com.citu.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
|
|
|
/**
|
|
@@ -24,7 +25,7 @@ public class LoginUserContext {
|
|
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
|
|
if (null == loginUser) {
|
|
|
// 没权限
|
|
|
- throw exception(FORBIDDEN);
|
|
|
+ throw exception(UNAUTHORIZED);
|
|
|
}
|
|
|
return loginUser;
|
|
|
}
|
|
@@ -76,7 +77,7 @@ public class LoginUserContext {
|
|
|
**/
|
|
|
public static Long getEnterpriseId(LoginUser loginUser) {
|
|
|
if (!checkEnterprise(loginUser)) {
|
|
|
- throw exception(FORBIDDEN);
|
|
|
+ throw exception(UNAUTHORIZED);
|
|
|
}
|
|
|
return Long.valueOf(loginUser.getInfo().get(LoginUser.INFO_KEY_DATA_ID));
|
|
|
}
|