...
|
...
|
@@ -38,6 +38,8 @@ public class UpSoftAccountController { |
|
|
@Autowired
|
|
|
private ITokenManager tokenManager;
|
|
|
|
|
|
private static final String UPSOFT_TOKEN_PREFIX = "UPSOFT_TOKEN";
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "报告上传软件登录")
|
|
|
public ResponseEntity<ResultModel> login(@RequestParam String account, @RequestParam String password
|
...
|
...
|
@@ -64,7 +66,7 @@ public class UpSoftAccountController { |
|
|
}
|
|
|
|
|
|
//生成一个token,保存用户登录状态
|
|
|
TokenModel model = tokenManager.createToken(admin.getId());
|
|
|
TokenModel model = tokenManager.createToken(UPSOFT_TOKEN_PREFIX + admin.getId());
|
|
|
return new ResponseEntity<>(ResultModel.ok(model), HttpStatus.OK);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -75,7 +77,7 @@ public class UpSoftAccountController { |
|
|
@ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
|
|
|
})
|
|
|
public ResponseEntity<ResultModel> logout(@CurrentAdmin Admin admin) {
|
|
|
tokenManager.deleteToken(admin.getId());
|
|
|
tokenManager.deleteToken(UPSOFT_TOKEN_PREFIX + admin.getId());
|
|
|
return new ResponseEntity<>(ResultModel.ok(), HttpStatus.OK);
|
|
|
}
|
|
|
|
...
|
...
|
|