diff --git a/components.d.ts b/components.d.ts index 587d2ec..f759a60 100644 --- a/components.d.ts +++ b/components.d.ts @@ -18,12 +18,12 @@ declare module 'vue' { ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCol: typeof import('element-plus/es')['ElCol'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] - ElCountdown: typeof import('element-plus/es')['ElCountdown'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] + ElHeader: typeof import('element-plus/es')['ElHeader'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] @@ -38,6 +38,8 @@ declare module 'vue' { ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElSelect: typeof import('element-plus/es')['ElSelect'] + ElStep: typeof import('element-plus/es')['ElStep'] + ElSteps: typeof import('element-plus/es')['ElSteps'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTag: typeof import('element-plus/es')['ElTag'] diff --git a/env/.env.dev b/env/.env.dev index 3fe5b11..ff089c7 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -7,7 +7,8 @@ VITE_API_URL = '/proxyApi' # 开发环境接口地址 # VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭 -VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅 +# VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅 +VITE_proxyTarget = 'http://192.168.2.123:28080' # 梁超 # VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅 # VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅 diff --git a/src/layout/header.vue b/src/layout/header.vue index 65eccde..40f695f 100644 --- a/src/layout/header.vue +++ b/src/layout/header.vue @@ -10,15 +10,17 @@ const store: any = mainStore() const userStore = useStore() const cart = cartStore() const isType = localStorage.getItem('rolesType') - userStore.editMenuList(1) - const route = useRoute() const router = useRouter() const isRolesSelect = ref(false) const rolesName = ref('1') - rolesName.value = localStorage.getItem('rolesType') +const isAdmin = ref(false) +const roles = store.userInfo.roles +if (roles.length > 0) { + isAdmin.value = roles.some((e: any) => e.roleKey == 'admin') +} // 是否显示退出登录 const isShowLogout = computed(() => { @@ -109,6 +111,7 @@ $bus.on('callBackText', (val) => { // 角色切换按钮 const onRolesCheck = () => { + if (isAdmin.value) return isRolesSelect.value = true } // 选择角色 @@ -148,6 +151,18 @@ const onCarts = () => { name: 'cart', }) } + +const onJumpUser = () => { + const roles = store.userInfo.roles + if (roles.length > 0) { + const isAdmin = roles.some((e: any) => e.roleKey == 'admin') + if (isAdmin) { + window.location.replace(`http://192.168.0.244:17788?token=${store.token}`) + } else { + router.push({ name: 'my-user' }) + } + } +}