Browse Source

zhao:修改上传接口:修改确认是否允许上传接口,修改上传接口,取消分块上传,每次上传都重新上传。 注意:要与平台同步更新

tags/录制修改前
耀 3 years ago
parent
commit
a7580c232a
1 changed files with 27 additions and 13 deletions
  1. 27
    13
      XHWK.WKTool/DAL/DAL_Upload.cs

+ 27
- 13
XHWK.WKTool/DAL/DAL_Upload.cs View File

36
                 try
36
                 try
37
                 {
37
                 {
38
                     JObject jo = HttpHelper.PostFunction(FileRequestAddress + @"/chunkdb/isexist", @"application/x-www-form-urlencoded", @"md5=" + MD5, "");
38
                     JObject jo = HttpHelper.PostFunction(FileRequestAddress + @"/chunkdb/isexist", @"application/x-www-form-urlencoded", @"md5=" + MD5, "");
39
-                    //0成功,1失败
39
+                    ////0成功,1失败
40
+                    //if (jo["code"].ToString() == "0")
41
+                    //{
42
+                    //    if (string.IsNullOrWhiteSpace(jo["obj"].ToString()))
43
+                    //    {
44
+                    //        //不存在 允许上传
45
+                    //        return true;
46
+                    //    }
47
+                    //    else
48
+                    //    {
49
+                    //        //已存在 不允许上传
50
+                    //        return false;
51
+                    //    }
52
+                    //}
53
+                    //else
54
+                    //{
55
+                    //    Message = jo["msg"].ToString();
56
+                    //    return false;
57
+                    //}
58
+
59
+                    //修改为0为之前上传成功,1为之前未上传成功
40
                     if (jo["code"].ToString() == "0")
60
                     if (jo["code"].ToString() == "0")
41
                     {
61
                     {
42
-                        if (string.IsNullOrWhiteSpace(jo["obj"].ToString()))
43
-                        {
44
-                            //不存在 允许上传
45
-                            return true;
46
-                        }
47
-                        else
48
-                        {
49
-                            //已存在 不允许上传
50
-                            return false;
51
-                        }
62
+                        //已存在 不允许上传
63
+                        return false;
52
                     }
64
                     }
53
                     else
65
                     else
54
                     {
66
                     {
55
-                        Message = jo["msg"].ToString();
56
-                        return false;
67
+                        //不存在 允许上传
68
+                        return true;
57
                     }
69
                     }
58
                 }
70
                 }
59
                 catch (Exception e)
71
                 catch (Exception e)
237
                             VideoInfo.SliceLen = (long)(UploadSliceLenMB * 1024 * 1024);
249
                             VideoInfo.SliceLen = (long)(UploadSliceLenMB * 1024 * 1024);
238
                             VideoInfo.Block = (int)(filelen / VideoInfo.SliceLen + (filelen % VideoInfo.SliceLen > 0 ? 1 : 0));
250
                             VideoInfo.Block = (int)(filelen / VideoInfo.SliceLen + (filelen % VideoInfo.SliceLen > 0 ? 1 : 0));
239
                         }
251
                         }
252
+                        //临时修改 没有断点续传,每次上传都重新上传。
253
+                        VideoInfo.Uploaded = 0;
240
                         //已上传长度
254
                         //已上传长度
241
                         long len = VideoInfo.Uploaded * VideoInfo.SliceLen;
255
                         long len = VideoInfo.Uploaded * VideoInfo.SliceLen;
242
                         string fileName = FileToolsCommon.GetFileName(VideoInfo.VideoPath);
256
                         string fileName = FileToolsCommon.GetFileName(VideoInfo.VideoPath);

Loading…
Cancel
Save