vueComponent / ant-design-vue-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design Vue like a Pro! (vue2)
https://pro.antdv.com
MIT License
10.7k stars 3.1k forks source link

本地服务, 可以正常登录; yarn run build:preview 打包成dist部署在服务器, 登录后页面空白;最新master分支登录不进去, 拉v3版本的代码才可以进入 #1227

Closed liujun8892 closed 3 years ago

liujun8892 commented 3 years ago

Question (问题描述) 本地服务正常: image image 打成预览模式的包, 就会报addRoute不是一个方法 image image

Describe the solution you'd like (你期待的是什么?) 期待在预览模式下也能登录然后进入面板页 A clear and concise description of what you want to happen.

Additional context(附加信息) 拉的master代码, 使用的yarn install 和 yarn run build:preview 然后部署在宝塔. 不管是在宝塔linux服务器, 还是用 serve -s 运行都会报y.addRoute is not a function 公网预览地址: http://antdpro.liujun1314.online/ Add any other context or screenshots about the feature request here.

liujun8892 commented 3 years ago

拉v3版本的代码可以 image

wien-wyc commented 3 years ago

我也遇到这个问题了,修改src/permission.js文件,把38到40行修改为router.addRoutes(store.getters.addRouters),就可以了。估计是vue-router版本问题,build出来的版本无法使用vue-router新的addRoute方法,改成老的addRoutes就行了。我也是前端小白,希望开发者能找下原因。参考:https://router.vuejs.org/zh/api/#router-addroutes