Browse Source

测试用户接口

ximinghao 3 tháng trước cách đây
mục cha
commit
2e5c731b28

+ 7 - 0
src/main/java/com/skyversation/xjcy/controller/LoginController.java

@@ -61,4 +61,11 @@ public class LoginController {
             return MessageManage.getInstance().getResultContent(500, e.getMessage(), "未知错误");
         }
     }
+    @RequestMapping("/test")
+    public String testLogin(@RequestParam(required = false) String uniCode){
+        if (uniCode == null|| uniCode.isEmpty()) {
+            uniCode = "123456";
+        }
+        return authService.logOrRegTestAccount(uniCode);
+    }
 }

+ 11 - 0
src/main/java/com/skyversation/xjcy/service/AuthService.java

@@ -298,6 +298,17 @@ public class AuthService {
         }
     }
 
+    /**
+     * 仅测试用<br/>
+     * 无需凭证一键登录
+     * @param unicode 唯一码
+     * @return 完整的response.body
+     */
+    public String logOrRegTestAccount(String unicode){
+        Account account =new Account("#Test"+unicode,"Test@"+unicode);
+        return logOrReg(account);
+    }
+
 
     public boolean sendPhoneCode(String phone) {
         return phoneService.sendCode(phone);