验证码发送修改
parent
f34ee35d91
commit
124e64491d
|
|
@ -183,9 +183,17 @@ public class UserController {
|
||||||
|
|
||||||
@ApiOperation(value = "手机验证码登录")
|
@ApiOperation(value = "手机验证码登录")
|
||||||
@GetMapping(value = "loginByCode/{phone}/{code}")
|
@GetMapping(value = "loginByCode/{phone}/{code}")
|
||||||
public ResultJson loginByCode(@PathVariable("phone") String phone,@PathVariable("code") String code) {
|
public ResultJson loginByCode(@PathVariable("phone") String phone,@PathVariable("code") String code) throws InvocationTargetException, IllegalAccessException {
|
||||||
|
|
||||||
return ResultJson.ok(service.loginByCode(phone,code.toUpperCase()));
|
LoginVo loginVo = service.loginByCode(phone, code.toUpperCase());
|
||||||
|
StpUtil.login(loginVo.getId()); // 使用 user id 登录
|
||||||
|
// 获取 Token 相关参数
|
||||||
|
loginVo.setTokenInfo(new AuthToken(StpUtil.getTokenInfo()));
|
||||||
|
|
||||||
|
// 更新最后登录时间
|
||||||
|
service.updateLastDate(loginVo.getId());
|
||||||
|
|
||||||
|
return ResultJson.ok(loginVo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue