Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
964e596f
Commit
964e596f
authored
Dec 18, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 优化
parent
833601d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
portal-manager-ui/admin/src/views/siteArrange/siteArrange.vue
...al-manager-ui/admin/src/views/siteArrange/siteArrange.vue
+26
-26
No files found.
portal-manager-ui/admin/src/views/siteArrange/siteArrange.vue
View file @
964e596f
...
...
@@ -185,18 +185,18 @@ export default {
if
(
this
.
userData
.
admin
||
this
.
userData
.
id
==
1
)
{
event
.
preventDefault
();
let
redirectUrl
=
""
;
let
hash
=
""
;
let
redirect
=
await
this
.
getFinalRedirect
(
modelUrl
);
if
(
!
modelUrl
.
includes
(
"
http
"
))
{
let
index
=
modelUrl
.
indexOf
(
"
/
"
);
hash
=
modelUrl
.
slice
(
index
+
1
);
}
if
(
redirect
)
{
redirectUrl
=
redirect
+
hash
;
}
else
{
redirectUrl
=
modelUrl
;
}
//
let redirectUrl = "";
//
let hash = "";
//
let redirect = await this.getFinalRedirect(modelUrl);
//
if (!modelUrl.includes("http")) {
//
let index = modelUrl.indexOf("/");
//
hash = modelUrl.slice(index + 1);
//
}
//
if (redirect) {
//
redirectUrl = redirect + hash;
//
} else {
//
redirectUrl = modelUrl;
//
}
this
.
$notification
.
open
({
message
:
"
跳转链接
"
,
...
...
@@ -205,7 +205,7 @@ export default {
description
:
(
<
div
>
<
div
class
=
"
notif-name
"
>
{
modelName
}
-
完整链接:
<
/div
>
<
div
>
{
redirect
Url
+
params
}
<
/div
>
<
div
>
{
model
Url
+
params
}
<
/div
>
<
div
class
=
"
notif-name
"
>
链接参数:
<
/div
>
<
div
>
{
params
}
<
/div
>
<
/div
>
...
...
@@ -275,19 +275,19 @@ export default {
},
// 获取重定向地址
getFinalRedirect
(
url
)
{
return
fetch
(
url
,
{
method
:
"
GET
"
,
redirect
:
"
follow
"
})
.
then
((
response
)
=>
{
if
(
!
response
.
ok
)
{
throw
new
Error
(
"
Network response was not ok
"
);
}
return
response
.
url
;
})
.
catch
((
error
)
=>
{
console
.
error
(
"
Error:
"
,
error
);
return
null
;
});
},
//
getFinalRedirect(url) {
//
return fetch(url, { method: "GET", redirect: "follow" })
//
.then((response) => {
//
if (!response.ok) {
//
throw new Error("Network response was not ok");
//
}
//
return response.url;
//
})
//
.catch((error) => {
//
console.error("Error:", error);
//
return null;
//
});
//
},
},
};
</
script
>
...
...
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