瀏覽代碼

버그 수정

잉여개발기 (SPDV) 2 年之前
父節點
當前提交
23ee08f0fe
共有 4 個文件被更改,包括 7 次插入9 次删除
  1. 2 4
      route/main_search_deep.py
  2. 2 2
      route/recent_edit_request.py
  3. 2 2
      route/view_random.py
  4. 1 1
      version.json

+ 2 - 4
route/main_search_deep.py

@@ -2,15 +2,13 @@ from .tool.func import *
 
 from .go_api_search import api_search
 
-def main_search_deep(name = 'Test', search_type = 'title', num = 1):
+async def main_search_deep(name = 'Test', search_type = 'title', num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
         if name == '':
             return redirect(conn)
 
-        sql_num = (num * 50 - 50) if num * 50 > 0 else 0
-
         if flask.request.method == 'POST':
             if search_type == 'title':
                 return redirect(conn, '/search_page/1/' + url_pas(flask.request.form.get('search', 'test')))
@@ -53,7 +51,7 @@ def main_search_deep(name = 'Test', search_type = 'title', num = 1):
                 <ul class="opennamu_ul">
             '''
 
-            all_list = json.loads(api_search(name, search_type, num).data)
+            all_list = json.loads((await api_search(name, search_type, num)).get_data(as_text = True))
             for data in all_list:
                 div += '<li><a href="/w/' + url_pas(data) + '">' + data + '</a></li>'
 

+ 2 - 2
route/recent_edit_request.py

@@ -4,7 +4,7 @@ from .recent_change import recent_change_send_render
 
 from .go_api_list_recent_edit_request import api_list_recent_edit_request
 
-def recent_edit_request():
+async def recent_edit_request():
     with get_db_connect() as conn:
         div = ''
         div += '''
@@ -17,7 +17,7 @@ def recent_edit_request():
                     </tr>
         '''
 
-        all_list = json.loads(api_list_recent_edit_request().data)
+        all_list = json.loads((await api_list_recent_edit_request()).get_data(as_text = True))
         for data in all_list:
             if re.search(r"\+", data[5]):
                 leng = '<span style="color:green;">(' + data[5] + ')</span>'

+ 2 - 2
route/view_random.py

@@ -2,8 +2,8 @@ from .tool.func import *
 
 from .go_api_w_random import api_w_random
 
-def view_random():
+async def view_random():
     with get_db_connect() as conn:
-        data = json.loads(api_w_random().data)["data"]
+        data = json.loads((await api_w_random()).get_data(as_text = True))["data"]
         
         return redirect(conn, '/w/' + url_pas(data))

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.5.0-v142",
+        "r_ver" : "v3.5.0-v143",
         "c_ver" : "20240513",
         "s_ver" : "20240426"
     }