|
|
@ -3,6 +3,7 @@ package com.ruoyi.web.controller.system;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
import com.ruoyi.system.domain.req.AppRegisterReq;
|
|
|
|
import com.ruoyi.system.domain.req.AppRegisterReq;
|
|
|
@ -75,6 +76,10 @@ public class SysLoginController
|
|
|
|
@PostMapping("/login/app")
|
|
|
|
@PostMapping("/login/app")
|
|
|
|
public AjaxResult loginForApp(@RequestBody LoginBody loginBody) {
|
|
|
|
public AjaxResult loginForApp(@RequestBody LoginBody loginBody) {
|
|
|
|
logger.info("login for app :{}", loginBody.getUsername());
|
|
|
|
logger.info("login for app :{}", loginBody.getUsername());
|
|
|
|
|
|
|
|
String regexp = "1[3|4|5|6|7|8|9][0-9]\\d{8}";
|
|
|
|
|
|
|
|
if (!Pattern.matches(regexp, loginBody.getUsername())) {
|
|
|
|
|
|
|
|
return AjaxResult.error("手机号码校验错误");
|
|
|
|
|
|
|
|
}
|
|
|
|
return loginService.loginForApp(loginBody.getUsername(), loginBody.getPassword());
|
|
|
|
return loginService.loginForApp(loginBody.getUsername(), loginBody.getPassword());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|