瀏覽代碼

调整oss上传路径问题

lichunlei 4 月之前
父節點
當前提交
f19beed1bf
共有 1 個文件被更改,包括 12 次插入3 次删除
  1. 12 3
      Util/OssHelper.cs

+ 12 - 3
Util/OssHelper.cs

@@ -48,7 +48,8 @@ namespace Util
                 }
                 else
                 {
-                    ScanQueue(dataFilePath, dataFilePath, client);
+                    string localFile = dataFilePath.Substring(dataFilePath.IndexOf("omega_make/") + 11).Replace("\\", "/");
+                    ScanQueue(localFile, dataFilePath, client);
                 }
             }
             else
@@ -70,8 +71,16 @@ namespace Util
                 //是文件
                 if (file != null)
                 {
-                    string localFile = file.FullName.Substring(file.FullName.IndexOf("net7.0//") + 8).Replace("\\", "/");
-                    ScanQueue(localFile, file.FullName, client);
+                    if(file.FullName.Contains("net7.0/"))
+                    {
+                        string localFile = file.FullName.Substring(file.FullName.IndexOf("net7.0//") + 8).Replace("\\", "/");
+                        ScanQueue(localFile, file.FullName, client);
+                    }
+                    else
+                    {
+                        string localFile = file.FullName.Substring(file.FullName.IndexOf("omega_make/") + 11).Replace("\\", "/");
+                        ScanQueue(localFile, file.FullName, client);
+                    }
                 }
                 else scan(files[i], client);
             }