浏览代码

add url http string

ming 3 年之前
父节点
当前提交
d2cfff82b2
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 0
      api/main.py
  2. 1 1
      api/static/script_msg.js

+ 2 - 0
api/main.py

@@ -102,6 +102,8 @@ async def make_anchor_video_v2(req:request):
     name_hash = str(time.time()).replace('.','')
     for imgu in req.image_urls:
         try:
+            if 'http' not in imgu:
+                imgu = 'http://'+imgu
             if get_url_type(imgu) =='video/mp4':
                 r=requests.get(imgu)
             else:

+ 1 - 1
api/static/script_msg.js

@@ -36,7 +36,7 @@ function prepareUpload(event) {
     dataType: 'json',
     success: function (jsonData) {
       event.target.previousSibling.value =jsonData.msg;
-      $(this).prev().val('http://'+jsonData.msg);
+      $(this).prev().val(jsonData.msg);
     },
     error: function (error) {
       alert('圖片錯誤');