Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ab87e2c5
authored
Apr 08, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:首页脚本链接改成配置项
1 parent
1c5646cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
aus-admin/src/main/java/com/glsx/usedcar/web/action/MainController.java
aus-admin/src/main/resources/templates/main/index.html
aus-core/src/main/java/com/glsx/usedcar/module/system/enums/SystemConfigKeyEnum.java
aus-admin/src/main/java/com/glsx/usedcar/web/action/MainController.java
View file @
ab87e2c
...
...
@@ -9,6 +9,8 @@
package
com
.
glsx
.
usedcar
.
web
.
action
;
import
com.glsx.usedcar.module.security.entity.User
;
import
com.glsx.usedcar.module.system.enums.SystemConfigKeyEnum
;
import
com.glsx.usedcar.module.system.service.SystemConfigService
;
import
com.glsx.usedcar.web.JwtProvider
;
import
jakarta.annotation.Resource
;
import
jakarta.servlet.http.HttpServletRequest
;
...
...
@@ -28,6 +30,8 @@ public class MainController {
@Resource
private
JwtProvider
jwtProvider
;
@Resource
private
SystemConfigService
systemConfigService
;
@GetMapping
(
"/"
)
public
String
defaultIndex
(
Authentication
authentication
,
HttpServletResponse
response
,
HttpServletRequest
request
...
...
@@ -40,6 +44,10 @@ public class MainController {
return
"redirect:/login"
;
}
try
{
String
script
=
systemConfigService
.
getConfigValueAsString
(
SystemConfigKeyEnum
.
MAIN_PAGE_SCRIPT
.
getKey
(),
"https://aus.glsx.com.cn/assets/index-pxQEYXWe.js"
);
String
link
=
systemConfigService
.
getConfigValueAsString
(
SystemConfigKeyEnum
.
MAIN_PAGE_LINK
.
getKey
(),
"https://aus.glsx.com.cn/assets/index-CAAxcolk.css"
);
modelMap
.
addAttribute
(
"script"
,
script
);
modelMap
.
addAttribute
(
"link"
,
link
);
String
token
=
jwtProvider
.
generateUser
(
user
);
response
.
setHeader
(
"Cache-control"
,
"no-store"
);
modelMap
.
addAttribute
(
"token"
,
token
);
...
...
aus-admin/src/main/resources/templates/main/index.html
View file @
ab87e2c
...
...
@@ -6,12 +6,10 @@
<link
rel=
"icon"
href=
"/favicon/favicon.ico"
type=
"image/x-icon"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<title>
专电优拍
</title>
<!-- <script type="module" crossorigin src="https://aus.test.glsx.com.cn/assets/index-mzhnSR-o.js"></script>
<link rel="stylesheet" crossorigin href="https://aus.test.glsx.com.cn/assets/index-WADY07lV.css"> -->
<script
type=
"module"
crossorigin
src=
"https://aus.glsx.com.cn/assets/index-mzhnSR-o.js"
></script>
<link
rel=
"stylesheet"
crossorigin
href=
"https://aus.glsx.com.cn/assets/index-WADY07lV.css"
>
</head>
<body>
<script
type=
"module"
crossorigin
src=
"${script}"
></script>
<link
rel=
"stylesheet"
crossorigin
href=
"${link}"
>
</head>
<body>
<div
id=
"app"
></div>
<input
type=
"hidden"
id=
"token"
th:value=
"${token}"
value=
""
>
<!-- built files will be auto injected -->
...
...
aus-core/src/main/java/com/glsx/usedcar/module/system/enums/SystemConfigKeyEnum.java
0 → 100644
View file @
ab87e2c
package
com
.
glsx
.
usedcar
.
module
.
system
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
*
*/
@Getter
@AllArgsConstructor
public
enum
SystemConfigKeyEnum
{
MAIN_PAGE_SCRIPT
(
"main_page_script"
,
"首页脚本"
),
MAIN_PAGE_LINK
(
"main_page_link"
,
"首页链接"
),
;
private
String
key
;
private
String
desc
;
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment