Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
data_report
/
daw
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 5d82719d
authored
Jul 10, 2026
by
江名洋
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 适配子路径部署的路径与API基础地址
1 parent
afed034e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
app/static/js/auth.js
app/templates/strategy_detail.html
app/static/js/auth.js
View file @
5d82719
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
try
{
try
{
const
response
=
await
originalFetch
.
apply
(
this
,
args
);
const
response
=
await
originalFetch
.
apply
(
this
,
args
);
if
(
response
.
status
===
401
&&
!
window
.
location
.
pathname
.
includes
(
'/login'
))
{
if
(
response
.
status
===
401
&&
!
window
.
location
.
pathname
.
includes
(
'/login'
))
{
window
.
location
.
href
=
'/login'
;
window
.
location
.
href
=
'
.
/login'
;
}
}
return
response
;
return
response
;
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -22,8 +22,10 @@
...
@@ -22,8 +22,10 @@
}
}
};
};
// API 基础路径始终为 /api(FastAPI 统一挂载)
// API 基础路径:动态计算(适配子路径部署),页面已设置则保留
window
.
API_BASE
=
'/api'
;
// if (!window.API_BASE) {
(
function
(){
var
p
=
window
.
location
.
pathname
;
if
(
p
.
endsWith
(
'/'
))
p
=
p
.
slice
(
0
,
-
1
);
var
i
=
p
.
lastIndexOf
(
'/'
);
window
.
API_BASE
=
p
.
substring
(
0
,
i
)
+
'/api'
;})();
// }
// 登录页不执行后续逻辑
// 登录页不执行后续逻辑
if
(
window
.
location
.
pathname
.
includes
(
'/login'
))
{
if
(
window
.
location
.
pathname
.
includes
(
'/login'
))
{
...
...
app/templates/strategy_detail.html
View file @
5d82719
...
@@ -193,19 +193,19 @@
...
@@ -193,19 +193,19 @@
<header>
<header>
<div
class=
"logo"
>
问界运营分析平台
</div>
<div
class=
"logo"
>
问界运营分析平台
</div>
<nav
class=
"nav-links"
>
<nav
class=
"nav-links"
>
<a
class=
"nav-item"
href=
"/"
>
首页
</a>
<a
class=
"nav-item"
href=
"
.
/"
>
首页
</a>
<a
class=
"nav-item"
href=
"/ods"
>
ODS 同步任务
</a>
<a
class=
"nav-item"
href=
"
.
/ods"
>
ODS 同步任务
</a>
<a
class=
"nav-item"
href=
"/dw"
>
DWS/DWM/DWA 任务
</a>
<a
class=
"nav-item"
href=
"
.
/dw"
>
DWS/DWM/DWA 任务
</a>
<a
class=
"nav-item"
href=
"/analysis"
>
问界生态系数分析
</a>
<a
class=
"nav-item"
href=
"
.
/analysis"
>
问界生态系数分析
</a>
<a
class=
"nav-item"
href=
"/harmony"
>
鸿蒙生态分析
</a>
<a
class=
"nav-item"
href=
"
.
/harmony"
>
鸿蒙生态分析
</a>
<a
class=
"nav-item active"
href=
"/strategy"
>
策略效果盯防
</a>
<a
class=
"nav-item active"
href=
"
.
/strategy"
>
策略效果盯防
</a>
</nav>
</nav>
<div
class=
"user-info"
id=
"user-info"
>
管理员
</div>
<div
class=
"user-info"
id=
"user-info"
>
管理员
</div>
</header>
</header>
<div
class=
"detail-header"
>
<div
class=
"detail-header"
>
<div
class=
"breadcrumb"
>
<div
class=
"breadcrumb"
>
<a
href=
"/strategy"
>
盯防管理
</a>
>
<span
class=
"current"
>
盯防效果数据查看
</span>
<a
href=
"
.
/strategy"
>
盯防管理
</a>
>
<span
class=
"current"
>
盯防效果数据查看
</span>
</div>
</div>
<div
class=
"header-actions"
>
<div
class=
"header-actions"
>
<button
class=
"btn btn-primary"
onclick=
"history.back()"
>
返回列表
</button>
<button
class=
"btn btn-primary"
onclick=
"history.back()"
>
返回列表
</button>
...
@@ -569,6 +569,6 @@
...
@@ -569,6 +569,6 @@
document
.
addEventListener
(
'DOMContentLoaded'
,
loadDetail
);
document
.
addEventListener
(
'DOMContentLoaded'
,
loadDetail
);
</script>
</script>
<script
src=
"/static/js/auth.js"
></script>
<script
src=
"
.
/static/js/auth.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
\ No newline at end of file
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