Skip to content

Commit

Permalink
新增刷新token接口
Browse files Browse the repository at this point in the history
  • Loading branch information
ibabamu committed Aug 9, 2023
1 parent ede7382 commit 6b9dd4d
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
import net.maku.framework.security.utils.TokenUtils;
import net.maku.system.service.SysAuthService;
import net.maku.system.service.SysCaptchaService;
import net.maku.system.vo.SysAccountLoginVO;
import net.maku.system.vo.SysCaptchaVO;
import net.maku.system.vo.SysMobileLoginVO;
import net.maku.system.vo.SysTokenVO;
import net.maku.system.vo.*;
import org.springframework.web.bind.annotation.*;

/**
Expand Down Expand Up @@ -46,8 +43,8 @@ public Result<Boolean> captchaEnabled() {

@PostMapping("login")
@Operation(summary = "账号密码登录")
public Result<SysTokenVO> login(@RequestBody SysAccountLoginVO login) {
SysTokenVO token = sysAuthService.loginByAccount(login);
public Result<SysUserTokenVO> login(@RequestBody SysAccountLoginVO login) {
SysUserTokenVO token = sysAuthService.loginByAccount(login);

return Result.ok(token);
}
Expand All @@ -65,8 +62,16 @@ public Result<String> sendCode(String mobile) {

@PostMapping("mobile")
@Operation(summary = "手机号登录")
public Result<SysTokenVO> mobile(@RequestBody SysMobileLoginVO login) {
SysTokenVO token = sysAuthService.loginByMobile(login);
public Result<SysUserTokenVO> mobile(@RequestBody SysMobileLoginVO login) {
SysUserTokenVO token = sysAuthService.loginByMobile(login);

return Result.ok(token);
}

@PostMapping("token")
@Operation(summary = "获取 accessToken")
public Result<AccessTokenVO> token(String refreshToken) {
AccessTokenVO token = sysAuthService.getAccessToken(refreshToken);

return Result.ok(token);
}
Expand Down

0 comments on commit 6b9dd4d

Please sign in to comment.