deason 7 éve
szülő
commit
67f43d2871

+ 2 - 2
src/main/java/cn/com/qmth/examcloud/app/controller/v1/UserAuthRestController.java

@@ -28,13 +28,13 @@ public class UserAuthRestController {
 
     @ApiOperation(value = "登录接口")
     @RequestMapping(value = "user/login", method = {RequestMethod.GET, RequestMethod.POST})
-    public Result login(@RequestParam String account, @RequestParam String password, @RequestParam String rootOrgId) throws Exception {
+    public Result login(@RequestParam String account, @RequestParam String password, @RequestParam Long rootOrgId) throws Exception {
         return userAuthService.login(account, password, rootOrgId);
     }
 
     @ApiOperation(value = "修改密码接口")
     @RequestMapping(value = "user/update/password", method = {RequestMethod.GET, RequestMethod.POST})
-    public Result updatePassword(@RequestHeader String key, @RequestHeader String token, @RequestParam String userId, @RequestParam String password) throws Exception {
+    public Result updatePassword(@RequestHeader String key, @RequestHeader String token, @RequestParam Long userId, @RequestParam String password) throws Exception {
         return userAuthService.updatePassword(key, token, userId, password);
     }
 

+ 4 - 4
src/main/java/cn/com/qmth/examcloud/app/service/UserAuthService.java

@@ -33,13 +33,13 @@ public class UserAuthService {
     @Autowired
     private PropertyService propertyService;
 
-    public Result login(String account, String password, String rootOrgId) throws Exception {
+    public Result login(String account, String password, Long rootOrgId) throws Exception {
         final String requestUrl = propertyService.getUserAuthUrl() + "/api/ecs_core/auth/login";
         //封装请求参数
         Map<String, String> params = new HashMap<>();
         params.put("accountValue", account);
         params.put("password", password);
-        params.put("rootOrgId", rootOrgId);
+        params.put("rootOrgId", String.valueOf(rootOrgId));
         params.put("accountType", DEFAULT_ACCOUNT_TYPE);
         params.put("domain", "");
         String json = new JsonMapper().toJson(params);
@@ -63,11 +63,11 @@ public class UserAuthService {
         }
     }
 
-    public Result updatePassword(String key, String token, String userId, String password) throws Exception {
+    public Result updatePassword(String key, String token, Long userId, String password) throws Exception {
         final String requestUrl = propertyService.getUserAuthUrl() + "/api/ecs_core/user/password";
         //封装请求参数
         RequestBody formBody = new FormBody.Builder()
-                .add("userId", userId)
+                .add("userId", String.valueOf(userId))
                 .add("password", password)
                 .build();
         Request request = new Request.Builder()