Skip to content

Commit 902a97c

Browse files
authored
fix: Unable to display when refreshing the page (#3615)
1 parent 79087a3 commit 902a97c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/maxkb/urls.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from pathlib import Path
1919

2020
from django.http import HttpResponse, HttpResponseRedirect
21-
from django.templatetags.static import static as _static
2221
from django.urls import path, re_path, include
2322
from django.views import static
2423
from rest_framework import status
@@ -109,7 +108,7 @@ def page_not_found(request, exception):
109108
in_ = [url for url in static_dict.get(chat_ui_prefix) if request.path.endswith(url)]
110109
if len(in_) > 0:
111110
a = chat_ui_prefix + in_[0]
112-
return HttpResponseRedirect(_static(a))
111+
return HttpResponseRedirect(a)
113112
index_path = os.path.join(PROJECT_DIR, 'apps', "static", 'chat', 'index.html')
114113
content = get_index_html(index_path)
115114
content.replace("prefix: '/chat'", f"prefix: {CONFIG.get_chat_path()}")
@@ -120,7 +119,7 @@ def page_not_found(request, exception):
120119
in_ = [url for url in static_dict.get(admin_ui_prefix) if request.path.endswith(url)]
121120
if len(in_) > 0:
122121
a = admin_ui_prefix + in_[0]
123-
return HttpResponseRedirect(_static(a))
122+
return HttpResponseRedirect(a)
124123
index_path = os.path.join(PROJECT_DIR, 'apps', "static", 'admin', 'index.html')
125124
if not os.path.exists(index_path):
126125
return HttpResponse("页面不存在", status=404)

0 commit comments

Comments
 (0)