diff --git a/src/App.vue b/src/App.vue
index cb34b25..6bbca27 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -2,7 +2,6 @@
import { getToken } from '@/utils/auth'
import { initializeLocale, translateLiteral } from '@/locales'
import useUserStore from '@/store/modules/user'
-import { initializeTerminalType } from '@/utils/terminal'
let wrapped = false
@@ -49,7 +48,6 @@ function wrapUniTextApi() {
export default {
onLaunch: function () {
initializeLocale()
- initializeTerminalType()
wrapUniTextApi()
if (getToken()) {
useUserStore().getInfo().catch(() => {})
diff --git a/src/api/login.js b/src/api/login.js
index d44bc01..26b53b7 100644
--- a/src/api/login.js
+++ b/src/api/login.js
@@ -1,5 +1,4 @@
import request from '@/utils/request'
-import { getTerminalType } from '@/utils/terminal'
const permissionInfoCache = new Map()
const permissionInfoPending = new Map()
@@ -13,35 +12,16 @@ function normalizePermissionParams(params = {}) {
function createPermissionCacheKey(params = {}) {
const normalizedParams = normalizePermissionParams(params)
- const terminalType = getTerminalType()
return JSON.stringify(
- Object.keys({ ...normalizedParams, terminalType })
+ Object.keys(normalizedParams)
.sort()
.reduce((result, key) => {
- result[key] = key === 'terminalType' ? terminalType : normalizedParams[key]
+ result[key] = normalizedParams[key]
return result
}, {})
)
}
-function filterPermissionMenus(menus, terminalType) {
- if (!Array.isArray(menus)) {
- return []
- }
-
- return menus.filter((menu) => {
- if (!menu || typeof menu !== 'object') {
- return false
- }
-
- if (menu.terminalType === null || typeof menu.terminalType === 'undefined' || menu.terminalType === '') {
- return true
- }
-
- return Number(menu.terminalType) === Number(terminalType)
- })
-}
-
export function clearPermissionInfoCache() {
permissionInfoCache.clear()
permissionInfoPending.clear()
@@ -82,7 +62,6 @@ export function register(data) {
function getPermissionInfo(params = {}) {
const normalizedParams = normalizePermissionParams(params)
- const terminalType = getTerminalType()
const cacheKey = createPermissionCacheKey(normalizedParams)
if (permissionInfoCache.has(cacheKey)) {
@@ -101,13 +80,7 @@ function getPermissionInfo(params = {}) {
const wrappedPromise = requestPromise
.then((res) => {
- const nextRes = {
- ...res,
- data: {
- ...res?.data,
- menus: filterPermissionMenus(res?.data?.menus, terminalType)
- }
- }
+ const nextRes = res
permissionInfoCache.set(cacheKey, nextRes)
return nextRes
})
diff --git a/src/components/common/TabBar.vue b/src/components/common/TabBar.vue
index d380a43..f2c0922 100644
--- a/src/components/common/TabBar.vue
+++ b/src/components/common/TabBar.vue
@@ -44,25 +44,6 @@ function normalizeRoute(path = '') {
return String(path || '').trim().replace(/^\/+/, '')
}
-function normalizeMenuName(value = '') {
- return String(value || '').trim().toLowerCase()
-}
-
-function isMineMenu(menu) {
- const names = [menu?.name, menu?.enName, menu?.text].map(normalizeMenuName)
- const paths = [menu?.path, menu?.component].map((item) => normalizeRoute(item).toLowerCase())
- return (
- names.some((name) => ['我的', '个人中心', 'mine', 'profile'].includes(name)) ||
- paths.some((path) => path === 'pages/mine' || path === 'pages/smq/mine')
- )
-}
-
-function isSmqTabbar() {
- const pages = getCurrentPages()
- const route = pages && pages.length > 0 ? pages[pages.length - 1].route : ''
- return normalizeRoute(route).startsWith('pages/smq/')
-}
-
function isUniIcon(icon) {
return String(icon || '').startsWith('uni-icons:')
}
@@ -114,17 +95,6 @@ function createTabItem(menu) {
}
}
-function createMineTabItem() {
- return {
- text: t('tab.mine'),
- icon: '',
- selectedIcon: '',
- iconType: 'uni-icons',
- iconName: 'person',
- path: isSmqTabbar() ? '/pages/smq/mine' : '/pages/mine'
- }
-}
-
function getCurrentActiveIndex() {
const pages = getCurrentPages()
if (pages && pages.length > 0) {
@@ -136,11 +106,7 @@ function getCurrentActiveIndex() {
}
const tabList = computed(() => {
- const apiTabs = getTabBarMenus(menus.value)
- .filter((menu) => !isMineMenu(menu))
- .map(createTabItem)
-
- return [...apiTabs, createMineTabItem()]
+ return getTabBarMenus(menus.value).map(createTabItem)
})
onMounted(() => {
diff --git a/src/pages_mine/pages/setting/index.vue b/src/pages_mine/pages/setting/index.vue
index d5351f2..5d8e23b 100644
--- a/src/pages_mine/pages/setting/index.vue
+++ b/src/pages_mine/pages/setting/index.vue
@@ -8,13 +8,6 @@
{{ t('setting.language') }}
{{ translateWithParams('setting.currentLanguage', { language: currentLanguageLabel }) }}
-
-
-
- {{ translateWithParams('setting.currentTerminal', { terminal: currentTerminalLabel }) }}