| | |
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.auth.form.LoginBody;
|
| | | import com.ruoyi.auth.form.RegisterBody;
|
| | | import com.ruoyi.auth.service.SysLoginService;
|
| | | import com.ruoyi.common.core.domain.R;
|
| | | import com.ruoyi.common.core.utils.StringUtils;
|
| | |
| | | if (StringUtils.isNotNull(loginUser))
|
| | | {
|
| | | // 刷新令牌有效期
|
| | | return R.ok(tokenService.refreshToken(loginUser));
|
| | | tokenService.refreshToken(loginUser);
|
| | | return R.ok();
|
| | | }
|
| | | return R.ok();
|
| | | }
|
| | |
|
| | | @PostMapping("register")
|
| | | public R<?> register(@RequestBody RegisterBody registerBody)
|
| | | {
|
| | | // 用户注册
|
| | | sysLoginService.register(registerBody.getUsername(), registerBody.getPassword());
|
| | | return R.ok();
|
| | | }
|
| | | }
|