Thanks to visit codestin.com Credit goes to github.com
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
优化方案: 在httpConfig.js中引入router路由,因此httpConfig.js属于工具类,无法直接应用router。 可在main.js中,把route 直接挂在到window对象上。vue-cli3 底层已经不是单例模式,所以这种改动的弊端是多页面入口时,不适用。 单页面时,路由跳转将会非常顺畅,无需加载抖动
The text was updated successfully, but these errors were encountered:
为什么一直登陆不上去呢?
Sorry, something went wrong.
setTimeout(() => { window.location.reload() }, 1000) 你说的是这段代吗吧,改成router.push() 好像是更好一点
No branches or pull requests
在你的src/config/httpConfig.js中,关于超时等状态码判断时,如非200状态码,看跳转到login路由。 您的代码思路没有问题,通过页面刷新和main.js中的路由守卫来判断; 但是呢,页面会有一个重新加载的问题,也是页面抖动。
优化方案: 在httpConfig.js中引入router路由,因此httpConfig.js属于工具类,无法直接应用router。 可在main.js中,把route 直接挂在到window对象上。vue-cli3 底层已经不是单例模式,所以这种改动的弊端是多页面入口时,不适用。 单页面时,路由跳转将会非常顺畅,无需加载抖动
The text was updated successfully, but these errors were encountered: