@@ -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);
@@ -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);