|
@@ -114,18 +114,12 @@ public class SecurityFrameworkUtils {
|
|
|
*/
|
|
|
public static LoginUser mockLoginUser(HttpServletRequest request, String token, Integer userType) {
|
|
|
|
|
|
-// // 必须以 mockSecret 开头
|
|
|
-// if (!token.startsWith("test")) {
|
|
|
-// return null;
|
|
|
-// }
|
|
|
- // 构建模拟用户
|
|
|
-// String userId = token.substring("test".length());
|
|
|
- String userId = "";
|
|
|
- if("test1".equals(token)){
|
|
|
- userId = "dc794fe0-66fe-4b1d-9273-f747950b27c3";
|
|
|
- } else {
|
|
|
+ // 必须以 mockSecret 开头
|
|
|
+ if (!token.startsWith("test")) {
|
|
|
return null;
|
|
|
}
|
|
|
+ // 构建模拟用户
|
|
|
+ String userId = token.substring("test".length());
|
|
|
return new LoginUser().setId(userId).setUserType(userType)
|
|
|
.setTenantId(WebFrameworkUtils.getTenantId(request));
|
|
|
}
|