Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas3-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas3-fe
Commits
7af1519d
Commit
7af1519d
authored
Dec 29, 2021
by
guxukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: proxy调整
parent
48cf9aa3
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
126 additions
and
48 deletions
+126
-48
dom-shims.d.ts
src/dom-shims.d.ts
+16
-0
index.vue
src/pages/account/views/fixed/proxy/index.vue
+4
-3
index.ts
src/pages/federation/router/index.ts
+1
-1
index.vue
src/pages/federation/views/fixed/proxy/index.vue
+0
-8
index.ts
src/pages/organization/router/index.ts
+1
-1
index.ts
src/pages/super/router/index.ts
+1
-1
index.vue
src/pages/super/views/fixed/proxy/index.vue
+0
-8
index.ts
src/pages/system/router/index.ts
+1
-1
index.vue
src/pages/system/views/fixed/proxy/index.vue
+0
-8
useRedirect.ts
src/shared/hooks/useRedirect.ts
+14
-0
useRefresh.ts
src/shared/hooks/useRefresh.ts
+19
-0
axios.ts
src/shared/http/axios.ts
+4
-0
default-layout.vue
src/shared/layouts/default-layout.vue
+16
-14
401.svg
src/shared/pages/fixed/401/components/401.svg
+2
-0
index.vue
src/shared/pages/fixed/401/index.vue
+1
-1
index.vue
src/shared/pages/fixed/proxy/index.vue
+15
-2
constants.ts
src/shared/router/constants.ts
+1
-0
route-utils.ts
src/shared/utils/route-utils.ts
+22
-0
shims-router.d.ts
src/shims-router.d.ts
+8
-0
No files found.
src/dom-shims.d.ts
0 → 100644
View file @
7af1519d
declare
global
{
interface
Document
{
mozCancelFullScreen
?:
()
=>
Promise
<
void
>
msExitFullscreen
?:
()
=>
Promise
<
void
>
webkitExitFullscreen
?:
()
=>
Promise
<
void
>
mozFullScreenElement
?:
Element
msFullscreenElement
?:
Element
webkitFullscreenElement
?:
Element
}
interface
HTMLElement
{
msRequestFullscreen
?:
()
=>
Promise
<
void
>
mozRequestFullscreen
?:
()
=>
Promise
<
void
>
webkitRequestFullscreen
?:
()
=>
Promise
<
void
>
}
}
src/pages/account/views/fixed/proxy/index.vue
View file @
7af1519d
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
<div></div>
<div></div>
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
useRouter
}
from
'vue-router'
import
{
useRedirect
}
from
'@shared/hooks/useRedirect'
const
$router
=
useRouter
()
$router
.
push
({
name
:
'home'
})
const
{
redirect
}
=
useRedirect
()
redirect
()
</
script
>
</
script
>
src/pages/federation/router/index.ts
View file @
7af1519d
...
@@ -28,7 +28,7 @@ const routes = [
...
@@ -28,7 +28,7 @@ const routes = [
{
{
path
:
'/proxy'
,
path
:
'/proxy'
,
name
:
'proxy'
,
name
:
'proxy'
,
component
:
()
=>
import
(
'@
federation/view
s/fixed/proxy/index.vue'
),
component
:
()
=>
import
(
'@
shared/page
s/fixed/proxy/index.vue'
),
},
},
...
SYSTEM_ROUTES
,
...
SYSTEM_ROUTES
,
]
]
...
...
src/pages/federation/views/fixed/proxy/index.vue
deleted
100644 → 0
View file @
48cf9aa3
<
template
>
<div></div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
useRouter
}
from
'vue-router'
const
$router
=
useRouter
()
$router
.
push
({
name
:
'home'
})
</
script
>
src/pages/organization/router/index.ts
View file @
7af1519d
...
@@ -28,7 +28,7 @@ const routes = [
...
@@ -28,7 +28,7 @@ const routes = [
{
{
path
:
'/proxy'
,
path
:
'/proxy'
,
name
:
'proxy'
,
name
:
'proxy'
,
component
:
()
=>
import
(
'@
organization/view
s/fixed/proxy/index.vue'
),
component
:
()
=>
import
(
'@
shared/page
s/fixed/proxy/index.vue'
),
},
},
...
SYSTEM_ROUTES
,
...
SYSTEM_ROUTES
,
]
]
...
...
src/pages/super/router/index.ts
View file @
7af1519d
...
@@ -28,7 +28,7 @@ const routes = [
...
@@ -28,7 +28,7 @@ const routes = [
{
{
path
:
'/proxy'
,
path
:
'/proxy'
,
name
:
'proxy'
,
name
:
'proxy'
,
component
:
()
=>
import
(
'@s
uper/view
s/fixed/proxy/index.vue'
),
component
:
()
=>
import
(
'@s
hared/page
s/fixed/proxy/index.vue'
),
},
},
...
SYSTEM_ROUTES
,
...
SYSTEM_ROUTES
,
]
]
...
...
src/pages/super/views/fixed/proxy/index.vue
deleted
100644 → 0
View file @
48cf9aa3
<
template
>
<div></div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
useRouter
}
from
'vue-router'
const
$router
=
useRouter
()
$router
.
push
({
name
:
'home'
})
</
script
>
src/pages/system/router/index.ts
View file @
7af1519d
...
@@ -29,7 +29,7 @@ const routes = [
...
@@ -29,7 +29,7 @@ const routes = [
{
{
path
:
'/proxy'
,
path
:
'/proxy'
,
name
:
'proxy'
,
name
:
'proxy'
,
component
:
()
=>
import
(
'@s
ystem/view
s/fixed/proxy/index.vue'
),
component
:
()
=>
import
(
'@s
hared/page
s/fixed/proxy/index.vue'
),
},
},
...
SYSTEM_ROUTES
,
...
SYSTEM_ROUTES
,
]
]
...
...
src/pages/system/views/fixed/proxy/index.vue
deleted
100644 → 0
View file @
48cf9aa3
<
template
>
<div></div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
useRouter
}
from
'vue-router'
const
$router
=
useRouter
()
$router
.
push
({
name
:
'home'
})
</
script
>
src/shared/hooks/useRedirect.ts
0 → 100644
View file @
7af1519d
import
{
useRoute
,
useRouter
}
from
'vue-router'
//重定向至刷新页面或者首页
export
const
useRedirect
=
()
=>
{
const
$router
=
useRouter
()
const
$route
=
useRoute
()
const
redirect
=
()
=>
{
if
(
$route
.
query
.
path
)
{
$router
.
replace
(
$route
.
query
.
path
as
string
)
}
else
{
$router
.
replace
({
name
:
'home'
})
}
}
return
{
redirect
}
}
src/shared/hooks/useRefresh.ts
0 → 100644
View file @
7af1519d
import
{
useRoute
,
useRouter
}
from
'vue-router'
// 刷新页面跳转到proxy页面
export
const
useRefresh
=
()
=>
{
const
$router
=
useRouter
()
const
$route
=
useRoute
()
const
key
=
'refresh'
window
.
onbeforeunload
=
()
=>
{
sessionStorage
.
setItem
(
key
,
'1'
)
}
if
(
sessionStorage
.
getItem
(
key
))
{
$router
.
replace
({
name
:
'proxy'
,
query
:
{
path
:
$route
.
fullPath
,
},
})
sessionStorage
.
removeItem
(
key
)
}
}
src/shared/http/axios.ts
View file @
7af1519d
...
@@ -48,8 +48,12 @@ class PureHttp {
...
@@ -48,8 +48,12 @@ class PureHttp {
(
config
:
PureHttpRequestConfig
)
=>
{
(
config
:
PureHttpRequestConfig
)
=>
{
const
authStore
=
useAuth
()
const
authStore
=
useAuth
()
const
token
=
authStore
.
loginInfo
?.
token
const
token
=
authStore
.
loginInfo
?.
token
const
objectId
=
authStore
.
consoleInfo
?.
consoleObjectId
const
ObjectType
=
authStore
.
consoleInfo
?.
consoleTypeId
if
(
token
)
{
if
(
token
)
{
config
.
headers
[
'Authorization'
]
=
`Bearer
${
token
}
`
config
.
headers
[
'Authorization'
]
=
`Bearer
${
token
}
`
config
.
headers
[
'Object-Id'
]
=
objectId
config
.
headers
[
'Object-Type'
]
=
ObjectType
}
}
const
$config
=
config
const
$config
=
config
// 优先判断post/get等方法是否传入回调,否则执行初始化设置等回掉
// 优先判断post/get等方法是否传入回调,否则执行初始化设置等回掉
...
...
src/shared/layouts/default-layout.vue
View file @
7af1519d
...
@@ -104,8 +104,8 @@
...
@@ -104,8 +104,8 @@
</el-container>
</el-container>
</el-container>
</el-container>
</template>
</template>
<
script
setup
>
<
script
lang=
"ts"
setup
>
import
{
onBeforeRouteUpdate
}
from
'vue-router'
import
{
onBeforeRouteUpdate
,
useRoute
,
useRouter
}
from
'vue-router'
import
{
ref
,
toRaw
,
onMounted
,
getCurrentInstance
}
from
'vue'
import
{
ref
,
toRaw
,
onMounted
,
getCurrentInstance
}
from
'vue'
import
{
ArrowRight
}
from
'@element-plus/icons-vue'
import
{
ArrowRight
}
from
'@element-plus/icons-vue'
import
AsideMenuList
from
'@shared/layouts/components/aside-menu-list/index.vue'
import
AsideMenuList
from
'@shared/layouts/components/aside-menu-list/index.vue'
...
@@ -116,15 +116,16 @@ import { GATEWAY_CODE } from '../http/constants'
...
@@ -116,15 +116,16 @@ import { GATEWAY_CODE } from '../http/constants'
import
{
MessageUtils
}
from
'../utils/message-utils'
import
{
MessageUtils
}
from
'../utils/message-utils'
import
{
useAuth
}
from
'@shared/store/modules/auth'
import
{
useAuth
}
from
'@shared/store/modules/auth'
import
{
useLayout
}
from
'@shared/store/modules/layout'
import
{
useLayout
}
from
'@shared/store/modules/layout'
import
ConsoleMenu
from
'./components/console-menu'
import
ConsoleMenu
from
'./components/console-menu/index.vue'
import
{
useRefresh
}
from
'@shared/hooks/useRefresh'
const
layoutStore
=
useLayout
()
const
layoutStore
=
useLayout
()
const
PROJECT_NAME
=
process
.
env
.
APP_NAME
const
PROJECT_NAME
=
process
.
env
.
APP_NAME
let
{
proxy
}
=
getCurrentInstanc
e
()
const
$route
=
useRout
e
()
const
$router
=
useRouter
()
let
currentActiveRoute
=
ref
(
'home'
)
let
currentActiveRoute
=
ref
(
'home'
)
onMounted
(()
=>
{
onMounted
(()
=>
{
setTheme
(
false
)
setTheme
(
false
)
currentActiveRoute
.
value
=
proxy
.
$route
.
name
currentActiveRoute
.
value
=
$route
.
name
as
string
})
})
/**
/**
* @description 面包屑导航和侧边导航
* @description 面包屑导航和侧边导航
...
@@ -135,12 +136,12 @@ onBeforeRouteUpdate((to, from) => {
...
@@ -135,12 +136,12 @@ onBeforeRouteUpdate((to, from) => {
if
(
!
to
.
meta
?.
level
)
{
if
(
!
to
.
meta
?.
level
)
{
return
return
}
}
let
bread
=
toRaw
(
layoutStore
.
$state
.
breadcrumbList
)
let
bread
=
toRaw
(
layoutStore
.
breadcrumbList
)
// 1. 已有层级,则替换path和name 2. 已添加的层级有小于新增的层级,则过滤 3. 若新增层级大于所有已有层级,则push
// 1. 已有层级,则替换path和name 2. 已添加的层级有小于新增的层级,则过滤 3. 若新增层级大于所有已有层级,则push
let
result
=
bread
let
result
=
bread
.
map
(
val
=>
{
.
map
(
val
=>
{
if
(
to
.
meta
.
level
===
val
.
level
)
{
if
(
to
.
meta
.
level
===
val
.
level
)
{
val
.
title
=
to
.
meta
.
title
val
.
title
=
to
.
meta
.
title
!
val
.
path
=
to
.
path
val
.
path
=
to
.
path
}
}
return
val
return
val
...
@@ -149,11 +150,11 @@ onBeforeRouteUpdate((to, from) => {
...
@@ -149,11 +150,11 @@ onBeforeRouteUpdate((to, from) => {
return
a
.
level
-
b
.
level
return
a
.
level
-
b
.
level
})
})
.
filter
(
val
=>
{
.
filter
(
val
=>
{
return
val
.
level
<=
to
.
meta
.
level
return
val
.
level
<=
to
.
meta
.
level
!
})
})
if
(
result
[
result
.
length
-
1
].
level
<
to
.
meta
.
level
)
{
if
(
result
[
result
.
length
-
1
].
level
<
to
.
meta
.
level
)
{
result
.
push
({
result
.
push
({
title
:
to
.
meta
.
title
,
title
:
to
.
meta
.
title
!
,
path
:
to
.
path
,
path
:
to
.
path
,
level
:
to
.
meta
.
level
,
level
:
to
.
meta
.
level
,
})
})
...
@@ -179,9 +180,9 @@ const setTheme = function (isChangeTheme = true) {
...
@@ -179,9 +180,9 @@ const setTheme = function (isChangeTheme = true) {
themeFlag
.
value
=
theme
===
'light'
?
'dark'
:
'light'
themeFlag
.
value
=
theme
===
'light'
?
'dark'
:
'light'
}
}
if
(
localStorage
.
getItem
(
'theme'
)
===
'dark'
)
{
if
(
localStorage
.
getItem
(
'theme'
)
===
'dark'
)
{
document
.
querySelector
(
'html'
).
classList
.
add
(
'dark'
)
document
.
querySelector
(
'html'
)
!
.
classList
.
add
(
'dark'
)
}
else
{
}
else
{
document
.
querySelector
(
'html'
).
classList
.
remove
(
'dark'
)
document
.
querySelector
(
'html'
)
!
.
classList
.
remove
(
'dark'
)
}
}
}
}
...
@@ -204,8 +205,8 @@ const fullScreen = function () {
...
@@ -204,8 +205,8 @@ const fullScreen = function () {
element
.
requestFullscreen
()
element
.
requestFullscreen
()
}
else
if
(
element
.
msRequestFullscreen
)
{
}
else
if
(
element
.
msRequestFullscreen
)
{
element
.
msRequestFullscreen
()
element
.
msRequestFullscreen
()
}
else
if
(
element
.
mozRequestFull
S
creen
)
{
}
else
if
(
element
.
mozRequestFull
s
creen
)
{
element
.
mozRequestFull
S
creen
()
element
.
mozRequestFull
s
creen
()
}
else
if
(
element
.
webkitRequestFullscreen
)
{
}
else
if
(
element
.
webkitRequestFullscreen
)
{
element
.
webkitRequestFullscreen
()
element
.
webkitRequestFullscreen
()
}
}
...
@@ -228,4 +229,5 @@ const handleLogout = () => {
...
@@ -228,4 +229,5 @@ const handleLogout = () => {
}
}
})
})
}
}
useRefresh
()
</
script
>
</
script
>
src/shared/pages/fixed/401/components/401.svg
0 → 100644
View file @
7af1519d
<svg
id=
"a5c16198-98a1-478b-8909-43624583dcf2"
data-name=
"Layer 1"
xmlns=
"http://www.w3.org/2000/svg"
width=
"793"
height=
"551.73152"
viewBox=
"0 0 793 551.73152"
><ellipse
cx=
"158"
cy=
"539.73152"
rx=
"158"
ry=
"12"
fill=
"#e6e6e6"
/><path
d=
"M324.27227,296.55377c27.49676-11.6953,61.74442-4.28528,95.19092.85757.31124-6.228,4.08385-13.80782.132-18.15284-4.80115-5.2788-4.35917-10.82529-1.47008-16.40375,7.38788-14.265-3.1969-29.44375-13.88428-42.0647a23.66937,23.66937,0,0,0-19.75537-8.29179l-19.7975,1.41411A23.70939,23.70939,0,0,0,343.635,230.85851v0c-4.72724,6.42917-7.25736,12.84055-5.66438,19.21854-7.08065,4.83882-8.27029,10.67977-5.08851,17.2644,2.698,4.14592,2.66928,8.18161-.12275,12.1056a55.89079,55.89079,0,0,0-8.31011,16.5061Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#2f2e41"
/><path
d=
"M977.70889,651.09727H417.29111A18.79111,18.79111,0,0,1,398.5,632.30616h0q304.727-35.41512,598,0h0A18.79111,18.79111,0,0,1,977.70889,651.09727Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#2f2e41"
/><path
d=
"M996.5,633.41151l-598-1.10536,69.30611-116.61553.3316-.55268V258.13057a23.7522,23.7522,0,0,1,23.75418-23.75418H899.792a23.7522,23.7522,0,0,1,23.75418,23.75418V516.90649Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#3f3d56"
/><path
d=
"M491.35028,250.95679a7.74623,7.74623,0,0,0-7.73753,7.73753V493.03073a7.74657,7.74657,0,0,0,7.73753,7.73752H903.64972a7.74691,7.74691,0,0,0,7.73753-7.73752V258.69432a7.74657,7.74657,0,0,0-7.73753-7.73753Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#fff"
/><path
d=
"M493.07794,531.71835a3.32522,3.32522,0,0,0-3.01275,1.93006l-21.35537,46.42514a3.31594,3.31594,0,0,0,3.01221,4.7021H920.81411a3.3157,3.3157,0,0,0,2.96526-4.79925L900.5668,533.55126a3.29926,3.29926,0,0,0-2.96526-1.83291Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#2f2e41"
/><circle
cx=
"492.34196"
cy=
"67.97967"
r=
"4.97412"
fill=
"#fff"
/><path
d=
"M651.69986,593.61853a3.32114,3.32114,0,0,0-3.20165,2.4536l-5.35679,19.89649a3.31576,3.31576,0,0,0,3.20166,4.17856h101.874a3.31531,3.31531,0,0,0,3.13257-4.40093l-6.88691-19.89649a3.31784,3.31784,0,0,0-3.13366-2.23123Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#2f2e41"
/><polygon
points=
"720.046 337.135 720.046 341.556 264.306 341.556 264.649 341.004 264.649 337.135 720.046 337.135"
fill=
"#2f2e41"
/><circle
cx=
"707.33457"
cy=
"77.37523"
r=
"77.37523"
fill=
"#6c63ff"
/><path
d=
"M942.89,285.223H878.77911a4.42582,4.42582,0,0,1-4.42144-4.42145V242.11391a4.42616,4.42616,0,0,1,4.42144-4.42144H942.89a4.42616,4.42616,0,0,1,4.42144,4.42144v38.68761A4.42582,4.42582,0,0,1,942.89,285.223Zm-64.11091-43.10906v38.68761h64.11415L942.89,242.11391Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#fff"
/><path
d=
"M930.73105,242.11391h-39.793V224.42814c0-12.80987,8.36792-22.10721,19.89649-22.10721s19.89648,9.29734,19.89648,22.10721Zm-35.37153-4.42144h30.95009V224.42814c0-10.413-6.36338-17.68576-15.475-17.68576s-15.47505,7.27281-15.47505,17.68576Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#fff"
/><circle
cx=
"707.33457"
cy=
"86.21811"
r=
"4.42144"
fill=
"#fff"
/><path
d=
"M856.81994,421.28372H538.18006a5.90767,5.90767,0,0,1-5.90073-5.90073V336.342a5.90767,5.90767,0,0,1,5.90073-5.90072H856.81994a5.90767,5.90767,0,0,1,5.90073,5.90072V415.383A5.90767,5.90767,0,0,1,856.81994,421.28372Zm-318.63988-88.4821a3.5443,3.5443,0,0,0-3.54043,3.54043V415.383a3.54431,3.54431,0,0,0,3.54043,3.54044H856.81994a3.54431,3.54431,0,0,0,3.54043-3.54044V336.342a3.5443,3.5443,0,0,0-3.54043-3.54043Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#e6e6e6"
/><circle
cx=
"384.19021"
cy=
"198.69546"
r=
"24.03645"
fill=
"#e6e6e6"
/><path
d=
"M643.203,356.80541a4.00608,4.00608,0,1,0,0,8.01215H832.06074a4.00607,4.00607,0,0,0,0-8.01215Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#e6e6e6"
/><path
d=
"M643.203,380.84186a4.00607,4.00607,0,1,0,0,8.01214H724.469a4.00607,4.00607,0,1,0,0-8.01214Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#e6e6e6"
/><path
d=
"M467.022,382.46241,408.1189,413.778l-.74561-26.09629c19.22553-3.20948,37.51669-8.7974,54.42941-17.8946l6.1605-15.22008a10.31753,10.31753,0,0,1,17.53643-2.67788l0,0a10.31753,10.31753,0,0,1-.90847,14.06885Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#ffb8b8"
/><path
d=
"M323.09819,563.26707v0a11.57378,11.57378,0,0,1,1.46928-9.36311l12.93931-19.85777a22.61221,22.61221,0,0,1,29.335-7.73927h0c-5.438,9.25647-4.67994,17.37679,1.87806,24.43365a117.63085,117.63085,0,0,0-27.93606,19.04492A11.57386,11.57386,0,0,1,323.09819,563.26707Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#2f2e41"
/><path
d=
"M469.70475,537.30274l0,0a22.20314,22.20314,0,0,1-18.87085,10.77909l-85.96027.65122-3.728-21.62264,38.026-11.18413-32.06116-24.60507L402.154,450.31277l63.65,59.32431A22.20317,22.20317,0,0,1,469.70475,537.30274Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#2f2e41"
/><path
d=
"M351.45266,685.17939H331.32124c-18.07509-123.89772-36.47383-248.14186,17.8946-294.51529l64.12231,10.43852L405.13646,455.532l-35.7892,41.00845Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#2f2e41"
/><path
d=
"M369.14917,713.24594h0a11.57381,11.57381,0,0,1-9.3632-1.46873l-21.85854-2.93814a22.61221,22.61221,0,0,1-7.741-29.33451v0c9.2568,5.43749,17.37707,4.67891,24.43354-1.8795,4.98593,10.06738,13.20093,9.45331,21.04657,17.93494A11.57385,11.57385,0,0,1,369.14917,713.24594Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#2f2e41"
/><path
d=
"M399.1716,307.90158l-37.28042-8.94731c6.19168-12.6739,6.70155-26.77618,3.728-41.75406l25.35068-.74561C391.76421,275.08,394.16732,292.48081,399.1716,307.90158Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#ffb8b8"
/><path
d=
"M409.41752,423.55243c-27.13873,18.49308-46.31418.63272-60.94729-26.92346,2.03338-16.86188-1.259-37.04061-7.35672-58.96635a40.13762,40.13762,0,0,1,24.50567-48.40124h0l32.06116,13.421c27.22362,22.19038,32.582,46.227,22.36825,71.5784Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#6c63ff"
/><path
d=
"M331.32124,326.54178,301.4969,342.19956l52.9382,31.31555,7.366,18.16951a9.63673,9.63673,0,0,1-5.78925,12.73088h0a9.63673,9.63673,0,0,1-12.76159-8.54442l-.74489-12.66307-67.2838-22.20366a15.73306,15.73306,0,0,1-9.87265-9.61147v0a15.733,15.733,0,0,1,5.90262-18.30258l54.10485-37.11845Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#ffb8b8"
/><path
d=
"M361.14557,329.52422c-12.43861-5.4511-23.74934.47044-38.026,5.21926l-2.23683-39.51725c14.17612-7.55568,27.69209-9.59281,40.26285-3.728Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#6c63ff"
/><circle
cx=
"172.52496"
cy=
"78.09251"
r=
"23.80211"
fill=
"#ffb8b8"
/><path
d=
"M404.5,249.22353c-23.56616,2.30811-41.52338-1.54606-53-12.52007v-8.8377h51Z"
transform=
"translate(-203.5 -174.13424)"
fill=
"#2f2e41"
/></svg>
\ No newline at end of file
src/shared/pages/fixed/401/index.vue
View file @
7af1519d
<
template
>
<
template
>
<div
class=
"flex flex-row justify-center items-center h-screen w-screen"
>
<div
class=
"flex flex-row justify-center items-center h-screen w-screen"
>
<img
src=
"
@/assets/icons/svg
/401.svg"
class=
"w-[120px]"
/>
<img
src=
"
./components
/401.svg"
class=
"w-[120px]"
/>
<div
class=
"ml-12"
>
<div
class=
"ml-12"
>
<p
class=
"mb-6 text-gray-700 text-4xl"
>
抱歉 , 你没有权限 !
</p>
<p
class=
"mb-6 text-gray-700 text-4xl"
>
抱歉 , 你没有权限 !
</p>
<el-button
type=
"info"
class=
"px-12"
@
click=
"back"
>
返回
</el-button>
<el-button
type=
"info"
class=
"px-12"
@
click=
"back"
>
返回
</el-button>
...
...
src/
pages/organization/view
s/fixed/proxy/index.vue
→
src/
shared/page
s/fixed/proxy/index.vue
View file @
7af1519d
<!--权限代理页面-->
<
template
>
<
template
>
<g-query-wrapper
:data=
"menuData"
:loading=
"menuLoading"
:error=
"menuError"
:run=
"menuRun"
/>
<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
{
useRoute
,
useRoute
r
}
from
'vue-router'
import
{
useRequest
}
from
'vue-request'
import
{
useRequest
}
from
'vue-request'
import
{
AuthMenuInfo
}
from
'@shared/models/auth-service/AuthMenuInfo'
import
{
AuthMenuInfo
}
from
'@shared/models/auth-service/AuthMenuInfo'
import
{
useUser
}
from
'@shared/store/modules/user'
import
{
useUser
}
from
'@shared/store/modules/user'
import
{
useAuth
}
from
'@shared/store/modules/auth'
import
{
useAuth
}
from
'@shared/store/modules/auth'
import
{
GATEWAY_CODE
}
from
'@shared/http/constants'
import
{
GATEWAY_CODE
}
from
'@shared/http/constants'
import
{
filterAsyncRoutes
,
hasPermission
}
from
'@shared/utils/route-utils'
import
{
useRedirect
}
from
'@shared/hooks/useRedirect'
const
$router
=
useRouter
()
const
$router
=
useRouter
()
const
$route
=
useRoute
()
const
userStore
=
useUser
()
const
userStore
=
useUser
()
const
authStore
=
useAuth
()
const
authStore
=
useAuth
()
const
{
redirect
}
=
useRedirect
()
const
{
const
{
data
:
menuData
,
data
:
menuData
,
loading
:
menuLoading
,
loading
:
menuLoading
,
...
@@ -22,7 +27,15 @@ const {
...
@@ -22,7 +27,15 @@ const {
userId
:
userStore
.
userInfo
.
id
,
userId
:
userStore
.
userInfo
.
id
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
code
===
GATEWAY_CODE
.
success
)
{
if
(
res
.
code
===
GATEWAY_CODE
.
success
)
{
$router
.
push
({
name
:
'home'
})
const
menuList
=
res
.
data
$router
.
getRoutes
().
forEach
(
_
=>
{
if
(
!
hasPermission
(
_
,
menuList
))
{
$router
.
removeRoute
(
_
.
name
as
string
)
}
})
const
restRoutes
=
$router
.
getRoutes
()
$router
.
options
.
routes
=
filterAsyncRoutes
(
$router
.
options
.
routes
,
restRoutes
)
redirect
()
}
}
return
res
return
res
}),
}),
...
...
src/shared/router/constants.ts
View file @
7af1519d
...
@@ -6,6 +6,7 @@ export const SYSTEM_ROUTES = [
...
@@ -6,6 +6,7 @@ export const SYSTEM_ROUTES = [
component
:
()
=>
import
(
'@shared/pages/fixed/401/index.vue'
),
component
:
()
=>
import
(
'@shared/pages/fixed/401/index.vue'
),
},
},
{
{
name
:
'404'
,
path
:
'/:pathMatch(.*)*'
,
path
:
'/:pathMatch(.*)*'
,
component
:
()
=>
import
(
'@shared/pages/fixed/404/index.vue'
),
component
:
()
=>
import
(
'@shared/pages/fixed/404/index.vue'
),
},
},
...
...
src/shared/utils/route-utils.ts
0 → 100644
View file @
7af1519d
// 过滤异步路由表
export
function
filterAsyncRoutes
(
routes
,
auth
)
{
return
routes
.
filter
(
route
=>
{
if
(
auth
.
some
(
_
=>
_
.
name
===
route
.
name
))
{
if
(
route
.
children
?.
length
)
{
route
.
children
=
filterAsyncRoutes
(
route
.
children
,
auth
)
}
return
true
}
else
{
return
false
}
})
}
// 判断是否有菜单权限
export
function
hasPermission
(
route
,
auth
)
{
return
route
.
meta
.
code
?
auth
.
some
(
item
=>
{
return
route
.
meta
.
code
===
item
.
menuId
})
:
true
}
src/shims-router.d.ts
0 → 100644
View file @
7af1519d
import
'vue-router'
declare
module
'vue-router'
{
interface
RouteMeta
{
title
?:
string
level
?:
number
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment