Commit 48cf9aa3 authored by guxukai's avatar guxukai

chore: proxy调整

parent 97283f57
......@@ -28,7 +28,7 @@ const routes = [
{
path: '/proxy',
name: 'proxy',
component: () => import('@account/views/fixed/proxy/index.vue'),
component: () => import('@federation/views/fixed/proxy/index.vue'),
},
...SYSTEM_ROUTES,
]
......
......@@ -12,51 +12,6 @@
"icon": "401",
"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 = [
{
path: '/proxy',
name: 'proxy',
component: () => import('@account/views/fixed/proxy/index.vue'),
component: () => import('@organization/views/fixed/proxy/index.vue'),
},
...SYSTEM_ROUTES,
]
......
<template>
<div></div>
<g-query-wrapper :data="menuData" :loading="menuLoading" :error="menuError" :run="menuRun" />
</template>
<script lang="ts" setup>
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()
$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>
......@@ -28,7 +28,7 @@ const routes = [
{
path: '/proxy',
name: 'proxy',
component: () => import('@account/views/fixed/proxy/index.vue'),
component: () => import('@super/views/fixed/proxy/index.vue'),
},
...SYSTEM_ROUTES,
]
......
......@@ -29,7 +29,7 @@ const routes = [
{
path: '/proxy',
name: 'proxy',
component: () => import('@account/views/fixed/proxy/index.vue'),
component: () => import('@system/views/fixed/proxy/index.vue'),
},
...SYSTEM_ROUTES,
]
......
......@@ -2,21 +2,23 @@
<div>
<slot v-if="!loading && !error && !hasError" />
<div v-if="loading">数据获取中...</div>
<div v-if="error">
{{ error }}
</div>
<div v-if="hasError">
{{ data.message }}
</div>
<div v-if="error || hasError">
<el-button @click="run">重新请求</el-button>
</div>
<template v-if="!loading">
<div v-if="error">
{{ error }}
</div>
<div v-if="hasError">
{{ data.message }}
</div>
<div v-if="error || hasError">
<el-button @click="run()">重新请求</el-button>
</div>
</template>
</div>
</template>
<script lang="ts" setup>
import { GATEWAY_CODE } from '@shared/http/constants'
import { HttpResponse } from '@shared/http/HttpResponse'
import { PropType } from 'vue'
import { computed, PropType } from 'vue'
const props = defineProps({
loading: {
......@@ -35,5 +37,5 @@ const props = defineProps({
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>
......@@ -94,7 +94,6 @@ const handleToggleConsole = ({ parent, child }) => {
2: 'federation',
3: 'organization',
}
userStore.$reset()
window.location.replace(`${window.location.origin}/${reference[parent.id]}/proxy`)
}
</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