GithubHelp home page GithubHelp logo

Comments (4)

Smith-Cruise avatar Smith-Cruise commented on May 18, 2024

额,404不是找不到页面的错误吗,和权限有什么关系。
另外权限注解在哪个方法上面就在哪个方法上面生效。

from spring-boot-shiro.

ba6yface avatar ba6yface commented on May 18, 2024

@Smith-Cruise 我把这条@RequiresPermissions("user:store")去掉就不会报404,我猜是权限控制不通过,而我没有相应的处理,最后返回的就是404,但是现在不知道怎么解决这种状况

from spring-boot-shiro.

Smith-Cruise avatar Smith-Cruise commented on May 18, 2024

我这里试了一下,是正常的
我的代码

@RestController
@RequestMapping("/hello")
public class TestController {

    @GetMapping
    public String get() {
        return "hello";
    }

    @PostMapping
    @RequiresPermissions({"edit"})
    public String post() {
        return "post";
    }
}

结果
1

最后补充一句@RequiresPermissions("user:store")这种写法不对的,你应该写成

@RequiresRoles("user")
@RequiresPermissions("store")

from spring-boot-shiro.

ba6yface avatar ba6yface commented on May 18, 2024

@Smith-Cruise Thanks!我在栈溢出找到了这个404的解决方法

from spring-boot-shiro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.