Jelajahi Sumber

add LoginType STUDENT_IDENTITY_NUMBER.

deason 6 tahun lalu
induk
melakukan
54073d904e

+ 1 - 1
src/main/java/cn/com/qmth/examcloud/app/controller/version1/UserAuthRestController.java

@@ -38,7 +38,7 @@ public class UserAuthRestController {
 
     @ApiOperation(value = "登录接口", notes = "参数accountType值说明:普通账号类型=COMMON_LOGIN_NAME,学号类型=STUDENT_CODE,学生手机号类型=STUDENT_PHONE")
     @RequestMapping(value = "/user/login", method = {RequestMethod.GET, RequestMethod.POST})
-    public Result<UserInfo> login(@RequestParam String account, @RequestParam String password, @RequestParam(required = false) String accountType,
+    public Result<UserInfo> login(@RequestParam String account, @RequestParam String password, @RequestParam String accountType,
                                   @RequestParam(required = false) Long rootOrgId, @RequestParam(required = false) String domain) throws Exception {
         LoginInfo loginInfo = new LoginInfo(account, password, accountType, rootOrgId, domain);
         Result<UserInfo> result = userAuthService.login(loginInfo);

+ 8 - 3
src/main/java/cn/com/qmth/examcloud/app/model/LoginType.java

@@ -16,18 +16,23 @@ package cn.com.qmth.examcloud.app.model;
 public enum LoginType {
 
     /**
-     * 普通账号登录
+     * 常规登录名(非学生登录)
      */
     COMMON_LOGIN_NAME,
 
     /**
-     * 学号登录
+     * 学生学号登录
      */
     STUDENT_CODE,
 
     /**
      * 学生手机号登录
      */
-    STUDENT_PHONE
+    STUDENT_PHONE,
+
+    /**
+     * 学生身份证号登录
+     */
+    STUDENT_IDENTITY_NUMBER
 
 }

+ 1 - 1
src/main/java/cn/com/qmth/examcloud/app/service/impl/UserAuthServiceImpl.java

@@ -44,7 +44,7 @@ public class UserAuthServiceImpl implements UserAuthService {
     public Result<UserInfo> login(LoginInfo loginInfo) throws Exception {
         Assert.notNull(loginInfo, "LoginInfo must be not null.");
         if (StringUtils.isBlank(loginInfo.getAccountType())) {
-            loginInfo.setAccountType(LoginType.COMMON_LOGIN_NAME.name());
+            loginInfo.setAccountType(LoginType.STUDENT_PHONE.name());
         }
         //封装请求参数
         final String requestUrl = String.format("%s/api/ecs_core/auth/login", propertyService.getUserAuthUrl());