mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-26 19:23:25 +08:00
头像上传功能、性别选择
This commit is contained in:
22
Yi.Vue2.x.Vuetify/src/permission.js
Normal file
22
Yi.Vue2.x.Vuetify/src/permission.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import router from './router/index'
|
||||
import store from './store/index'
|
||||
// import accountApi from '@/api/accountApi'
|
||||
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
|
||||
// console.log(to)
|
||||
// console.log(from)
|
||||
// console.log(next)
|
||||
const user = store.state.user.user; //获取是有user
|
||||
if (!user) { //如果没有登入
|
||||
if (to.path == '/login/' || to.path == '/register/' || to.path == '/reset_password/' || to.path == '/qq/') {
|
||||
next();
|
||||
} else {
|
||||
next({ path: '/login/' });
|
||||
}
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user