diff --git a/apps/develop/urls.py b/apps/develop/urls.py index 0c1c5685..d0910a96 100755 --- a/apps/develop/urls.py +++ b/apps/develop/urls.py @@ -1,5 +1,5 @@ from django.urls import path, include -from apps.develop.views import BackupDatabase, BackupMedia, ReloadClientGit, ReloadServerGit, ReloadServerOnly, TestViewSet, CorrectViewSet +from apps.develop.views import BackupDatabase, BackupMedia, ReloadClientGit, ReloadServerGit, ReloadServerOnly, TestViewSet, CorrectViewSet, testScanHtml from rest_framework.routers import DefaultRouter API_BASE_URL = 'api/develop/' @@ -15,4 +15,5 @@ urlpatterns = [ path(API_BASE_URL + 'backup_database/', BackupDatabase.as_view()), path(API_BASE_URL + 'backup_media/', BackupMedia.as_view()), path(API_BASE_URL, include(router.urls)), + path(HTML_BASE_URL + "testscan/", testScanHtml) ] diff --git a/apps/develop/views.py b/apps/develop/views.py index f6ccc81b..893b9cda 100755 --- a/apps/develop/views.py +++ b/apps/develop/views.py @@ -35,6 +35,7 @@ from apps.utils.snowflake import idWorker from django.core.cache import cache import json from apps.utils.decorators import auto_log, idempotent +from django.http import HttpResponse # Create your views here. @@ -643,3 +644,35 @@ class TestViewSet(CustomGenericViewSet): from apps.wpm.tasks import cal_exp_duration_sec cal_exp_duration_sec('3397169058570170368') return Response() + + +html_str = """ + + + + + + WebView 扫码 + + + +

扫描结果:

+ + + + +""" +def testScanHtml(request): + return HttpResponse(html_str) \ No newline at end of file