Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token貌似没有作用,还是给予session的 #37

Open
523499159 opened this issue Oct 28, 2018 · 3 comments
Open

token貌似没有作用,还是给予session的 #37

523499159 opened this issue Oct 28, 2018 · 3 comments

Comments

@523499159
Copy link

No description provided.

@lcw2004
Copy link
Owner

lcw2004 commented Oct 29, 2018

绝大多数的接口都是基于Htpp Header里面的Authorization(就是Token)的,只有首次登录之后获取初始化信息的那个接口才使用了Session里面的token(这里是因为页面跳转,这时候不方便携带Token)。

@523499159
Copy link
Author

登录后请求拿到token,拿着这个token到postman里请求接口,调用不了

@lcw2004
Copy link
Owner

lcw2004 commented Nov 5, 2018

虽然可以基于Token去调用,但是shiro里面做了API过滤,需要登录才能调用,所以直接在postman里面(没有Cookie)是调用不到的,会被shiro过滤掉。

解决办法有两个:

  1. postman开启Cookie转发功能,如下图所示
    image

  2. 需要在postman里面调用的API不要在one-main工程里面运行,单独作为一个Spring Boot工程运行。
    可以在program arguments里面设置application.yml的路径--server.port=8090--spring.config.location=....工程路径...\one-extend\one-main\src\main\resources\application.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants