|
@@ -3,6 +3,7 @@ package com.xkl.authorization.resolvers; |
|
@@ -3,6 +3,7 @@ package com.xkl.authorization.resolvers; |
3
|
import com.xkl.authorization.annotation.CurrentAdmin;
|
3
|
import com.xkl.authorization.annotation.CurrentAdmin;
|
4
|
import com.xkl.config.Constants;
|
4
|
import com.xkl.config.Constants;
|
5
|
import com.xkl.controller.uploadsoft.UpSoftAccountController;
|
5
|
import com.xkl.controller.uploadsoft.UpSoftAccountController;
|
|
|
6
|
+import com.xkl.controller.uspih.AdminAccountController;
|
6
|
import com.xkl.domain.XklAdminEntity;
|
7
|
import com.xkl.domain.XklAdminEntity;
|
7
|
import com.xkl.repository.AdminRepository;
|
8
|
import com.xkl.repository.AdminRepository;
|
8
|
import org.springframework.beans.factory.annotation.Autowired;
|
9
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -39,7 +40,8 @@ public class CurrentAdminMethodArgumentResolver implements HandlerMethodArgument |
|
@@ -39,7 +40,8 @@ public class CurrentAdminMethodArgumentResolver implements HandlerMethodArgument |
39
|
@Override
|
40
|
@Override
|
40
|
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
|
41
|
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
|
41
|
//取出鉴权时存入的登录用户Id
|
42
|
//取出鉴权时存入的登录用户Id
|
42
|
- String currentAdminId = ((String) webRequest.getAttribute(Constants.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST)).replace(UpSoftAccountController.UPSOFT_TOKEN_PREFIX, "");
|
43
|
+ String currentAdminId = ((String) webRequest.getAttribute(Constants.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST)).
|
|
|
44
|
+ replace(UpSoftAccountController.UPSOFT_TOKEN_PREFIX, "").replace(AdminAccountController.USPIH_TOKEN_PREFIX, "");
|
43
|
if (currentAdminId != null) {
|
45
|
if (currentAdminId != null) {
|
44
|
//从数据库中查询并返回
|
46
|
//从数据库中查询并返回
|
45
|
XklAdminEntity admin = adminRepository.findByIdAndStatus(Long.parseLong(currentAdminId), Constants.STATUS_OK);
|
47
|
XklAdminEntity admin = adminRepository.findByIdAndStatus(Long.parseLong(currentAdminId), Constants.STATUS_OK);
|