Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-book
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-book
Commits
74e84745
提交
74e84745
authored
7月 17, 2026
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: normalize admin config line endings
上级
bfe4669f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
41 行增加
和
41 行删除
+41
-41
index.html
apps/admin/index.html
+1
-1
main.jsx
apps/admin/src/main.jsx
+1
-1
request.js
apps/admin/src/utils/request.js
+11
-11
vite.config.js
apps/admin/vite.config.js
+28
-28
没有找到文件。
apps/admin/index.html
浏览文件 @
74e84745
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
</head>
</head>
<body>
<body>
<div
id=
"root"
></div>
<div
id=
"root"
></div>
<script
src=
"%BASE_URL%formula-editor/dist/formula-editor.min.js"
></script>
<script
src=
"%BASE_URL%formula-editor/dist/formula-editor.min.js"
></script>
<script
type=
"module"
src=
"/src/main.jsx"
></script>
<script
type=
"module"
src=
"/src/main.jsx"
></script>
</body>
</body>
</html>
</html>
apps/admin/src/main.jsx
浏览文件 @
74e84745
...
@@ -18,7 +18,7 @@ createRoot(document.getElementById('root')).render(
...
@@ -18,7 +18,7 @@ createRoot(document.getElementById('root')).render(
<
PersistGate
loading=
{
null
}
persistor=
{
persistor
}
>
<
PersistGate
loading=
{
null
}
persistor=
{
persistor
}
>
<
ConfigProvider
locale=
{
zhCN
}
theme=
{
{
token
:
{
colorPrimary
:
'#ab1941'
}
}
}
>
<
ConfigProvider
locale=
{
zhCN
}
theme=
{
{
token
:
{
colorPrimary
:
'#ab1941'
}
}
}
>
<
App
>
<
App
>
<
BrowserRouter
basename=
"/admin"
>
<
BrowserRouter
basename=
"/admin"
>
<
MyApp
/>
<
MyApp
/>
</
BrowserRouter
>
</
BrowserRouter
>
</
App
>
</
App
>
...
...
apps/admin/src/utils/request.js
浏览文件 @
74e84745
...
@@ -3,9 +3,9 @@ import Axios from 'axios'
...
@@ -3,9 +3,9 @@ import Axios from 'axios'
import
{
message
,
Modal
,
notification
}
from
'antd'
import
{
message
,
Modal
,
notification
}
from
'antd'
import
md5
from
'js-md5'
import
md5
from
'js-md5'
import
{
get
}
from
'lodash-es'
import
{
get
}
from
'lodash-es'
import
{
sortObjASCII
}
from
'@/utils/common.js'
import
{
sortObjASCII
}
from
'@/utils/common.js'
import
{
ADMIN_LOGIN_PATH
,
normalizeAdminApiPath
,
stripAdminGatewayPrefix
}
from
'@/utils/adminPaths.js'
import
{
ADMIN_LOGIN_PATH
,
normalizeAdminApiPath
,
stripAdminGatewayPrefix
}
from
'@/utils/adminPaths.js'
import
qs
from
'qs'
import
qs
from
'qs'
// import { sm4 as Sm4js } from 'evit-gm-crypt'
// import { sm4 as Sm4js } from 'evit-gm-crypt'
// const sm4 = new Sm4js({
// const sm4 = new Sm4js({
...
@@ -38,9 +38,9 @@ function getToken() {
...
@@ -38,9 +38,9 @@ function getToken() {
}
}
// 请求拦截器
// 请求拦截器
axios
.
interceptors
.
request
.
use
(
axios
.
interceptors
.
request
.
use
(
(
config
)
=>
{
(
config
)
=>
{
config
.
url
=
normalizeAdminApiPath
(
config
.
url
)
config
.
url
=
normalizeAdminApiPath
(
config
.
url
)
// 登录流程控制中,根据本地是否存在token判断用户的登录情况
// 登录流程控制中,根据本地是否存在token判断用户的登录情况
// 但是即使token存在,也有可能token是过期的,所以在每次的请求头中携带token
// 但是即使token存在,也有可能token是过期的,所以在每次的请求头中携带token
// 后台根据携带的token判断用户的登录情况,并返回给我们对应的状态码
// 后台根据携带的token判断用户的登录情况,并返回给我们对应的状态码
...
@@ -71,7 +71,7 @@ axios.interceptors.request.use(
...
@@ -71,7 +71,7 @@ axios.interceptors.request.use(
if
(
config
.
url
.
indexOf
(
'.tiangong.cn'
)
>
-
1
)
{
if
(
config
.
url
.
indexOf
(
'.tiangong.cn'
)
>
-
1
)
{
s
=
config
.
url
s
=
config
.
url
}
else
{
}
else
{
s
=
stripAdminGatewayPrefix
(
import
.
meta
.
env
.
VITE_API_URL
+
config
.
url
)
s
=
stripAdminGatewayPrefix
(
import
.
meta
.
env
.
VITE_API_URL
+
config
.
url
)
}
}
signData
.
url
=
decodeURIComponent
(
s
)
signData
.
url
=
decodeURIComponent
(
s
)
// signData.url = 'http: //zijing.com/index.php/user/user/getList'
// signData.url = 'http: //zijing.com/index.php/user/user/getList'
...
@@ -132,7 +132,7 @@ axios.interceptors.response.use(
...
@@ -132,7 +132,7 @@ axios.interceptors.response.use(
if
(
code
===
401
||
code
===
403
)
{
if
(
code
===
401
||
code
===
403
)
{
if
(
!
axios
.
errorNotified
)
{
if
(
!
axios
.
errorNotified
)
{
axios
.
errorNotified
=
true
// 添加标志,表示通知已经弹出
axios
.
errorNotified
=
true
// 添加标志,表示通知已经弹出
if
(
pathname
===
ADMIN_LOGIN_PATH
)
{
if
(
pathname
===
ADMIN_LOGIN_PATH
)
{
return
return
}
}
Modal
.
warning
({
Modal
.
warning
({
...
@@ -140,7 +140,7 @@ axios.interceptors.response.use(
...
@@ -140,7 +140,7 @@ axios.interceptors.response.use(
// content: '请重新登录',
// content: '请重新登录',
onOk
()
{
onOk
()
{
localStorage
.
removeItem
(
'kiwi.gpt.token'
)
localStorage
.
removeItem
(
'kiwi.gpt.token'
)
window
.
location
.
pathname
=
ADMIN_LOGIN_PATH
window
.
location
.
pathname
=
ADMIN_LOGIN_PATH
},
},
})
})
cancelPending
(
response
.
config
)
// 取消后续请求
cancelPending
(
response
.
config
)
// 取消后续请求
...
@@ -165,7 +165,7 @@ axios.interceptors.response.use(
...
@@ -165,7 +165,7 @@ axios.interceptors.response.use(
content
:
'请重新登录'
,
content
:
'请重新登录'
,
onOk
()
{
onOk
()
{
localStorage
.
removeItem
(
'kiwi.gpt.token'
)
localStorage
.
removeItem
(
'kiwi.gpt.token'
)
window
.
location
.
href
=
ADMIN_LOGIN_PATH
window
.
location
.
href
=
ADMIN_LOGIN_PATH
},
},
})
})
}
}
...
@@ -180,7 +180,7 @@ axios.interceptors.response.use(
...
@@ -180,7 +180,7 @@ axios.interceptors.response.use(
content
:
'请重新登录'
,
content
:
'请重新登录'
,
onOk
()
{
onOk
()
{
localStorage
.
removeItem
(
'kiwi.gpt.token'
)
localStorage
.
removeItem
(
'kiwi.gpt.token'
)
window
.
location
.
href
=
ADMIN_LOGIN_PATH
window
.
location
.
href
=
ADMIN_LOGIN_PATH
},
},
})
})
}
}
...
...
apps/admin/vite.config.js
浏览文件 @
74e84745
import
{
fileURLToPath
,
URL
}
from
'node:url'
import
{
fileURLToPath
,
URL
}
from
'node:url'
import
{
defineConfig
,
loadEnv
}
from
'vite'
import
{
defineConfig
,
loadEnv
}
from
'vite'
import
react
from
'@vitejs/plugin-react'
import
react
from
'@vitejs/plugin-react'
import
mkcert
from
'vite-plugin-mkcert'
import
mkcert
from
'vite-plugin-mkcert'
// https://vitejs.dev/config/
// https://vitejs.dev/config/
export
default
defineConfig
(({
mode
})
=>
{
export
default
defineConfig
(({
mode
})
=>
{
const
env
=
loadEnv
(
mode
,
process
.
cwd
(),
''
)
const
env
=
loadEnv
(
mode
,
process
.
cwd
(),
''
)
const
adminApiTarget
=
env
.
VITE_ADMIN_API_TARGET
||
'http://127.0.0.1:7419'
const
adminApiTarget
=
env
.
VITE_ADMIN_API_TARGET
||
'http://127.0.0.1:7419'
return
{
return
{
base
:
'/admin/'
,
base
:
'/admin/'
,
plugins
:
[
react
(),
mkcert
()],
plugins
:
[
react
(),
mkcert
()],
server
:
{
server
:
{
open
:
'/admin/'
,
open
:
'/admin/'
,
host
:
'dev.ezijing.com'
,
host
:
'dev.ezijing.com'
,
port
:
5174
,
port
:
5174
,
strictPort
:
true
,
strictPort
:
true
,
proxy
:
{
proxy
:
{
'/api/admin'
:
{
'/api/admin'
:
{
target
:
adminApiTarget
,
target
:
adminApiTarget
,
changeOrigin
:
true
,
changeOrigin
:
true
,
secure
:
false
,
secure
:
false
,
rewrite
:
path
=>
path
.
replace
(
/^
\/
api
\/
admin/
,
''
),
rewrite
:
path
=>
path
.
replace
(
/^
\/
api
\/
admin/
,
''
),
},
},
},
},
},
},
build
:
{
build
:
{
outDir
:
'../../dist/admin'
,
outDir
:
'../../dist/admin'
,
emptyOutDir
:
true
,
emptyOutDir
:
true
,
},
},
resolve
:
{
resolve
:
{
alias
:
{
alias
:
{
'@'
:
fileURLToPath
(
new
URL
(
'./src'
,
import
.
meta
.
url
)),
'@'
:
fileURLToPath
(
new
URL
(
'./src'
,
import
.
meta
.
url
)),
...
@@ -37,7 +37,7 @@ export default defineConfig(({ mode }) => {
...
@@ -37,7 +37,7 @@ export default defineConfig(({ mode }) => {
},
},
css
:
{
css
:
{
preprocessorOptions
:
{
preprocessorOptions
:
{
less
:
{
javascriptEnabled
:
true
},
less
:
{
javascriptEnabled
:
true
},
},
},
},
},
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论