Comments (4)
额,404不是找不到页面的错误吗,和权限有什么关系。
另外权限注解在哪个方法上面就在哪个方法上面生效。
from spring-boot-shiro.
@Smith-Cruise 我把这条@RequiresPermissions("user:store")
去掉就不会报404,我猜是权限控制不通过,而我没有相应的处理,最后返回的就是404,但是现在不知道怎么解决这种状况
from spring-boot-shiro.
我这里试了一下,是正常的
我的代码
@RestController
@RequestMapping("/hello")
public class TestController {
@GetMapping
public String get() {
return "hello";
}
@PostMapping
@RequiresPermissions({"edit"})
public String post() {
return "post";
}
}
最后补充一句@RequiresPermissions("user:store")
这种写法不对的,你应该写成
@RequiresRoles("user")
@RequiresPermissions("store")
from spring-boot-shiro.
@Smith-Cruise Thanks!我在栈溢出找到了这个404的解决方法
from spring-boot-shiro.
Related Issues (20)
- 关于filter拦截配置问题的请教 HOT 5
- smithgirlfriend HOT 1
- 配置文件 HOT 1
- 请问没有vue的代码吗? HOT 2
- 这个工具类抛出异常出错 HOT 4
- 密码的判断 HOT 1
- 用户名密码验证不应该交由shiro吗? HOT 2
- 可否从token获取用户角色,或者使用缓存,减轻数据库压力。 HOT 1
- 一大堆错误,肿么办? HOT 1
- 登录时未使用Shiro的认证器 HOT 1
- JWTUtil增加refresh HOT 3
- 密码在数据库中明文存储 HOT 1
- 敏感资源如果没有携带TOKEN HOT 4
- 关于url拦截 HOT 2
- Login并未实现保持用户信息吗 HOT 1
- 没有token 时怎么办 HOT 3
- token刷新 HOT 1
- Dependency org.apache.shiro:shiro-web, leading to CVE problem HOT 1
- Token 令牌建議不要存放密碼
- Token 令牌建議不要存放密碼 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot-shiro.