Commit 3f413bba by 袁伟铭

完善api接口

parent eb5108f7
......@@ -96,6 +96,13 @@ public class ApiService {
return ApiUtils.getAppIdValidError(form);
}
// 认证签名
String key = redisUtils.getStr(token);
String sign = ApiUtils.getSign(form.getSignStr(key == null ? "" : key));
if (!sign.equals(form.getSign())) {
return ApiUtils.getCheckSignValidError(form);
}
ApiUser apiUser = BeanUtil.copyProperties(resultVo.getData(), ApiUser.class);
ApiTokenVo apiTokenVo = ApiTokenVo.builder()
.userId(apiUser.getId())
......@@ -107,13 +114,6 @@ public class ApiService {
form.setAppId(apiUser.getAppId());
form.setApiTokenVo(apiTokenVo);
// 认证签名
String key = redisUtils.getStr(token);
String serverSign = ApiUtils.getSign(form.getSignStr(key == null ? "" : key));
if (!serverSign.equals(form.getSign())) {
return ApiUtils.getCheckSignValidError(form);
}
return ApiUtils.getSuccessResp(form);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment