RuoYi
2021-07-31 93ee021b6e8a9e6b3bca12c2f35f6e3c68baef5a
ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java
@@ -7,6 +7,7 @@
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;
@@ -58,8 +59,17 @@
        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();
    }
}