diff --git a/src/router/index.js b/src/router/index.js index 6eee2b6..7d84a17 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -90,12 +90,18 @@ router.beforeEach((to, from, next) => { if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') { next() } else { + let type="pc" + // let match = navigator.userAgent.match(/(pad|iPad)/i); + let match = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i); + if (match) { + type="pad" + } http({ url: http.adornUrl('/sys/menu/nav'), method: 'get', params: { 'l': i18n.locale, //i18n.locale - menuType: "pc" + menuType: type } }).then(({data}) => { if (data && data.code === 0) { diff --git a/src/views/main-navbar.vue b/src/views/main-navbar.vue index 5f434e5..09bbe30 100644 --- a/src/views/main-navbar.vue +++ b/src/views/main-navbar.vue @@ -1,7 +1,7 @@