Commit 48cf9aa3 authored by guxukai's avatar guxukai

chore: proxy调整

parent 97283f57
...@@ -28,7 +28,7 @@ const routes = [ ...@@ -28,7 +28,7 @@ const routes = [
{ {
path: '/proxy', path: '/proxy',
name: 'proxy', name: 'proxy',
component: () => import('@account/views/fixed/proxy/index.vue'), component: () => import('@federation/views/fixed/proxy/index.vue'),
}, },
...SYSTEM_ROUTES, ...SYSTEM_ROUTES,
] ]
......
...@@ -12,51 +12,6 @@ ...@@ -12,51 +12,6 @@
"icon": "401", "icon": "401",
"showInAsideMenu": true "showInAsideMenu": true
} }
},
{
"path": "admin",
"name": "admin",
"meta": {
"title": "管理员",
"level": 1,
"icon": "401",
"showInAsideMenu": true
},
"children": [
{
"path": "",
"name": "admin-list",
"meta": {
"element": "admin/index.vue",
"title": "列表",
"level": 2,
"icon": "401",
"showInAsideMenu": true
}
},
{
"path": "create",
"name": "admin-create",
"meta": {
"element": "admin/create.vue",
"title": "新建",
"level": 2,
"icon": "401",
"showInAsideMenu": false
}
},
{
"path": "edit/:id",
"name": "admin-edit",
"meta": {
"element": "admin/edit.vue",
"title": "编辑",
"level": 2,
"icon": "401",
"showInAsideMenu": false
}
}
]
} }
] ]
} }
...@@ -28,7 +28,7 @@ const routes = [ ...@@ -28,7 +28,7 @@ const routes = [
{ {
path: '/proxy', path: '/proxy',
name: 'proxy', name: 'proxy',
component: () => import('@account/views/fixed/proxy/index.vue'), component: () => import('@organization/views/fixed/proxy/index.vue'),
}, },
...SYSTEM_ROUTES, ...SYSTEM_ROUTES,
] ]
......
<template> <template>
<div></div> <g-query-wrapper :data="menuData" :loading="menuLoading" :error="menuError" :run="menuRun" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useRequest } from 'vue-request'
import { AuthMenuInfo } from '@shared/models/auth-service/AuthMenuInfo'
import { useUser } from '@shared/store/modules/user'
import { useAuth } from '@shared/store/modules/auth'
import { GATEWAY_CODE } from '@shared/http/constants'
const $router = useRouter() const $router = useRouter()
$router.push({ name: 'home' }) const userStore = useUser()
const authStore = useAuth()
const {
data: menuData,
loading: menuLoading,
error: menuError,
run: menuRun,
} = useRequest(() =>
AuthMenuInfo.get({
objectId: authStore.consoleInfo.consoleObjectId,
userId: userStore.userInfo.id,
}).then(res => {
if (res.code === GATEWAY_CODE.success) {
$router.push({ name: 'home' })
}
return res
}),
)
</script> </script>
...@@ -28,7 +28,7 @@ const routes = [ ...@@ -28,7 +28,7 @@ const routes = [
{ {
path: '/proxy', path: '/proxy',
name: 'proxy', name: 'proxy',
component: () => import('@account/views/fixed/proxy/index.vue'), component: () => import('@super/views/fixed/proxy/index.vue'),
}, },
...SYSTEM_ROUTES, ...SYSTEM_ROUTES,
] ]
......
...@@ -29,7 +29,7 @@ const routes = [ ...@@ -29,7 +29,7 @@ const routes = [
{ {
path: '/proxy', path: '/proxy',
name: 'proxy', name: 'proxy',
component: () => import('@account/views/fixed/proxy/index.vue'), component: () => import('@system/views/fixed/proxy/index.vue'),
}, },
...SYSTEM_ROUTES, ...SYSTEM_ROUTES,
] ]
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div> <div>
<slot v-if="!loading && !error && !hasError" /> <slot v-if="!loading && !error && !hasError" />
<div v-if="loading">数据获取中...</div> <div v-if="loading">数据获取中...</div>
<template v-if="!loading">
<div v-if="error"> <div v-if="error">
{{ error }} {{ error }}
</div> </div>
...@@ -9,14 +10,15 @@ ...@@ -9,14 +10,15 @@
{{ data.message }} {{ data.message }}
</div> </div>
<div v-if="error || hasError"> <div v-if="error || hasError">
<el-button @click="run">重新请求</el-button> <el-button @click="run()">重新请求</el-button>
</div> </div>
</template>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { GATEWAY_CODE } from '@shared/http/constants' import { GATEWAY_CODE } from '@shared/http/constants'
import { HttpResponse } from '@shared/http/HttpResponse' import { HttpResponse } from '@shared/http/HttpResponse'
import { PropType } from 'vue' import { computed, PropType } from 'vue'
const props = defineProps({ const props = defineProps({
loading: { loading: {
...@@ -35,5 +37,5 @@ const props = defineProps({ ...@@ -35,5 +37,5 @@ const props = defineProps({
required: true, required: true,
}, },
}) })
const hasError = props.data && props.data?.code !== GATEWAY_CODE.success const hasError = computed(() => (props.data ? props.data?.code !== GATEWAY_CODE.success : false))
</script> </script>
...@@ -94,7 +94,6 @@ const handleToggleConsole = ({ parent, child }) => { ...@@ -94,7 +94,6 @@ const handleToggleConsole = ({ parent, child }) => {
2: 'federation', 2: 'federation',
3: 'organization', 3: 'organization',
} }
userStore.$reset()
window.location.replace(`${window.location.origin}/${reference[parent.id]}/proxy`) window.location.replace(`${window.location.origin}/${reference[parent.id]}/proxy`)
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment