提交 94e453cb 编写于 作者: Q qiaozhanwei

modify general user can't create token

上级 54f0c2c8
...@@ -120,9 +120,11 @@ public class AccessTokenService extends BaseService { ...@@ -120,9 +120,11 @@ public class AccessTokenService extends BaseService {
*/ */
public Map<String, Object> generateToken(User loginUser, int userId, String expireTime) { public Map<String, Object> generateToken(User loginUser, int userId, String expireTime) {
Map<String, Object> result = new HashMap<>(5); Map<String, Object> result = new HashMap<>(5);
if(check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)){ if (!hasPerm(loginUser,userId)){
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result; return result;
} }
String token = EncryptionUtils.getMd5(userId + expireTime + String.valueOf(System.currentTimeMillis())); String token = EncryptionUtils.getMd5(userId + expireTime + String.valueOf(System.currentTimeMillis()));
result.put(Constants.DATA_LIST, token); result.put(Constants.DATA_LIST, token);
putMsg(result, Status.SUCCESS); putMsg(result, Status.SUCCESS);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册