修正对外主机名错误
Suan API 返回的图片链接中使用的主机名现在可以进行设置。
This commit is contained in:
@@ -60,11 +60,12 @@ class Config:
|
|||||||
doc_system["host"] = "0.0.0.0"
|
doc_system["host"] = "0.0.0.0"
|
||||||
doc_system["port"] = 8000
|
doc_system["port"] = 8000
|
||||||
doc_system["reload"] = True
|
doc_system["reload"] = True
|
||||||
|
doc_system["public_host"] = "http://127.0.0.1:8000"
|
||||||
|
|
||||||
doc_schedule["playwright_headless"] = True
|
doc_schedule["playwright_headless"] = True
|
||||||
doc_schedule["jwxt_login_method"] = "sso"
|
doc_schedule["jwxt_login_method"] = "sso"
|
||||||
doc_schedule["semester_start_date"] = "2026-03-02"
|
doc_schedule["semester_start_date"] = "2026-03-02"
|
||||||
doc_schedule["schedule_title_template"] = "芒果酸的第 {title} 周课程表"
|
doc_schedule["schedule_title_template"] = "芒果酸的第 {week} 周课程表"
|
||||||
doc_schedule["schedule_subtitle_template"] = "我也要上吗?"
|
doc_schedule["schedule_subtitle_template"] = "我也要上吗?"
|
||||||
|
|
||||||
doc_log["log_api_request_details"] = False
|
doc_log["log_api_request_details"] = False
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ async def apply_enhance(course_list: list[dict], week: int, img: bool) -> Return
|
|||||||
|
|
||||||
img_url = None
|
img_url = None
|
||||||
if img:
|
if img:
|
||||||
img_url = f"http://172.28.143.24:8000/api/schedule/img/{
|
img_url = f"{config.get('system', 'public_host', 'http://127.0.0.1:8000')}/api/schedule/img/{
|
||||||
await generate_img(final_course_list, title_template.format(**vars_), subtitle_template.format(**vars_))
|
await generate_img(final_course_list, title_template.format(**vars_), subtitle_template.format(**vars_))
|
||||||
}"
|
}"
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,12 @@ function varTag(code: string, description: string) {
|
|||||||
show-switch
|
show-switch
|
||||||
title="热重载 Python 代码文件"
|
title="热重载 Python 代码文件"
|
||||||
/>
|
/>
|
||||||
|
<setting-card
|
||||||
|
v-model:string-value="CONFIG.data.system.public_host"
|
||||||
|
message="Suan API 需要对外提供资源(例如课表图片)时,使用此主机名"
|
||||||
|
show-input
|
||||||
|
title="外部域名 / 主机名"
|
||||||
|
/>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
</n-collapse-item>
|
</n-collapse-item>
|
||||||
<n-collapse-item name="schedule" title="课表设置">
|
<n-collapse-item name="schedule" title="课表设置">
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ export interface ConfigSystemDto {
|
|||||||
host?: string
|
host?: string
|
||||||
port?: number
|
port?: number
|
||||||
reload?: boolean
|
reload?: boolean
|
||||||
|
public_host?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ConfigScheduleDto {
|
export interface ConfigScheduleDto {
|
||||||
|
|||||||
Reference in New Issue
Block a user