wuyouming666
2024-01-16 f49de44b69924fc3c4dfea159b13a412983b8f93
springboot-vue3/src/main/java/com/example/springboot/controller/DefaultController.java
@@ -24,14 +24,12 @@
import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
@RestController
@Slf4j
@Api(tags = "登录和注册")
public class DefaultController {
@@ -57,6 +55,7 @@
    }
    @ApiOperation(value = "登录")
    @PostMapping("/login")
    public Result login(@RequestBody UserVo userVO) {
        ValidatorUtil.validateEntity(userVO);
@@ -82,7 +81,8 @@
            } catch (DisabledAccountException e) {
                return Result.fail("帐号已被禁用");
            } catch (ExpiredCredentialsException e) {
                return Result.fail("帐号已过期");
                return Result.fail("请重新登录");
            } catch (UnknownAccountException e) {
                return Result.fail("帐号不存在");
            } catch (UnauthorizedException e) {