shenwu hai 7 meses
pai
achega
3185884cf2
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      config/oss.js

+ 7 - 1
config/oss.js

@@ -9,7 +9,10 @@ const { REACT_APP_ENV = 'dev' } = process.env;
  * 1.步骤为删除当前bucket的全部文件
  * 2.然后再上传
  */
-let bucket = REACT_APP_ENV === 'dev' ? 'zx-web-book-distribution-test' : '-';
+
+
+/**重要bucket*/ 
+let bucket = REACT_APP_ENV === 'dev' ? 'zx-web-book-distribution-test' : '';
 
 // 创建 OSS 客户端实例
 var client = new OSS({
@@ -66,6 +69,9 @@ async function uploadFilesFromDist(dirPath, ossPath) {
 
 // 主程序
 (async () => {
+  if(!bucket){
+    return
+  }
   await deleteAllFiles();
   const distPath = path.join(__dirname, '../dist');
   await uploadFilesFromDist(distPath, ''); // OSS根目录