We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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存储到cookie里,但是这样会有xss的风险,虽然vue已经在一定程度上防范了xss,但仍然有安全风险,毕竟前端环境本身是不安全的。就像我注意到之前你引用了一个带有xss安全问题的markdown库。
为什么不是后端直接设置cookie,并设置httponly,前后端约定一个code例如:4000。任意一个接口返回4000,axios全局拦截器就拦截跳转到登录页面。
我从permission.js中看到前端从本地获取了一下cookie,没有值就跳转到登录页面,好像不需要这么做。应该像上面说的按照后端的接口code值,判断是否要跳转登录。
The text was updated successfully, but these errors were encountered:
还有一个问题,如果后端是session的模式,前端存储一遍就够了,但如果是jwt的模式,就需要更新jwt,如果是当前这种前端存储cookie的做法,前后端还需约定更新的头信息。但如果是后端设置cookie,前端则不需要考虑token更新问题。
Sorry, something went wrong.
有具体点的prototype吗?
感觉题主说得有道理,我也觉得应该后端直接将token设置到cookie(http-only),防止js直接读取登录态
No branches or pull requests
Question(提问)
感谢提供这么好的模板。
我注意到前端自己把token存储到cookie里,但是这样会有xss的风险,虽然vue已经在一定程度上防范了xss,但仍然有安全风险,毕竟前端环境本身是不安全的。就像我注意到之前你引用了一个带有xss安全问题的markdown库。
为什么不是后端直接设置cookie,并设置httponly,前后端约定一个code例如:4000。任意一个接口返回4000,axios全局拦截器就拦截跳转到登录页面。
我从permission.js中看到前端从本地获取了一下cookie,没有值就跳转到登录页面,好像不需要这么做。应该像上面说的按照后端的接口code值,判断是否要跳转登录。
Other relevant information(格外信息)
The text was updated successfully, but these errors were encountered: