|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-03-18 11:11:05
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-03-18 11:11:05
|
|
|
|
|
* @LastEditTime: 2022-06-29 21:53:26
|
|
|
|
|
* @Description: file content
|
|
|
|
|
*/
|
|
|
|
|
import {RouterMount,createRouter} from 'uni-simple-router';
|
|
|
|
@ -13,6 +13,10 @@ const router = createRouter({
|
|
|
|
|
});
|
|
|
|
|
//全局路由前置守卫
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
|
|
// 兼容页面刷新body样式丢失问题
|
|
|
|
|
if (document.body) {
|
|
|
|
|
document.body.setAttribute('class', `uni-body ${to.path.replace('/', '').replace(/\//g, '-')}`)
|
|
|
|
|
}
|
|
|
|
|
next();
|
|
|
|
|
});
|
|
|
|
|
// 全局路由后置守卫
|
|
|
|
|