parent
14119eb866
commit
6105cf0dd7
@ -1,20 +1,21 @@ |
||||
import tab from './tab' |
||||
import auth from './auth' |
||||
import cache from './cache' |
||||
import modal from './modal' |
||||
import download from './download' |
||||
import tab from "./tab"; |
||||
import auth from "./auth"; |
||||
import cache from "./cache"; |
||||
import modal from "./modal"; |
||||
import download from "./download"; |
||||
|
||||
import "./platform"; |
||||
export default { |
||||
install(Vue) { |
||||
// 页签操作
|
||||
Vue.prototype.$tab = tab |
||||
Vue.prototype.$tab = tab; |
||||
// 认证对象
|
||||
Vue.prototype.$auth = auth |
||||
Vue.prototype.$auth = auth; |
||||
// 缓存对象
|
||||
Vue.prototype.$cache = cache |
||||
Vue.prototype.$cache = cache; |
||||
// 模态框对象
|
||||
Vue.prototype.$modal = modal |
||||
Vue.prototype.$modal = modal; |
||||
// 下载文件
|
||||
Vue.prototype.$download = download |
||||
} |
||||
} |
||||
Vue.prototype.$download = download; |
||||
}, |
||||
}; |
||||
|
@ -0,0 +1,29 @@ |
||||
import router from "@/router"; |
||||
|
||||
function meta(to, type, desc) { |
||||
to.meta.manufacturer = { |
||||
name: to.fullPath.split("/").at(1), |
||||
//1:厂商管理,2:经销商管理,3:门店管理
|
||||
type, |
||||
//1:厂商/经销商/商店列表,2:审核
|
||||
subType: to.fullPath.split("/").at(-1), |
||||
desc, |
||||
}; |
||||
} |
||||
|
||||
router.beforeEach((to, from, next) => { |
||||
switch (to.fullPath.split("/").at(1)) { |
||||
case "manufacturer": |
||||
meta(to, "1", "厂商"); |
||||
break; |
||||
case "dealer": |
||||
meta(to, "2", "经销商"); |
||||
break; |
||||
case "store": |
||||
meta(to, "3", "门店"); |
||||
break; |
||||
} |
||||
|
||||
// your logic
|
||||
next(); |
||||
}); |
Loading…
Reference in new issue