mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-18 09:44:31 +08:00
在登录时强制性检查账号 id 是否为异常值,如果是则登录失败。
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.pj.test;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.dev33.satoken.util.SaResult;
|
||||
import com.pj.satoken.StpUserUtil;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -18,7 +18,7 @@ public class TestController {
|
||||
// 测试登录 ---- http://localhost:8081/test/login
|
||||
@RequestMapping("login")
|
||||
public SaResult login(@RequestParam(defaultValue = "10001") long id) {
|
||||
StpUserUtil.login(id);
|
||||
StpUtil.login(id);
|
||||
return SaResult.ok("登录成功");
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class TestController {
|
||||
public SaResult test() {
|
||||
System.out.println("------------进来了");
|
||||
// 返回
|
||||
return SaResult.data("");
|
||||
return SaResult.data(null);
|
||||
}
|
||||
|
||||
// 测试 浏览器访问: http://localhost:8081/test/test2
|
||||
|
Reference in New Issue
Block a user