Browse Source

批量上传代码

hank 1 năm trước cách đây
mục cha
commit
1d6370803e

+ 142 - 6
config/config.js

@@ -20,7 +20,12 @@ const appInfoObj = {
         appid: 'wx8a8aae7f462df482',
         ghid: 'gh_1098838a2d7e',
         appName: '稻香悠享阅界',
-        ads: {},
+        ads: {
+          insertAdId: 'adunit-099862d68eb0c19e',
+            rewardAdId: 'adunit-7ff33188ea39abf1',
+            bookmarkAdId: 'adunit-ce71b57d87227b6c',
+            templateAdId: 'adunit-0d3db2f0131d82d3'
+        },
     },
     wx1344c35820ac688e: {
         appid: 'wx1344c35820ac688e',
@@ -32,13 +37,23 @@ const appInfoObj = {
         appid: 'wx8bd40e8ce9deb2b6',
         ghid: 'gh_c40c32e29788',
         appName: '稻香悦读空间',
-        ads: {},
+        ads: {
+            insertAdId: 'adunit-845614eb5c48a349',
+            rewardAdId: 'adunit-ace5375fafb06dde',
+            bookmarkAdId: 'adunit-38b29a959923f2ab',
+            templateAdId: 'adunit-29715e8ff52accc0'
+        },
     },
     wx9e90adce31181f7f: {
         appid: 'wx9e90adce31181f7f',
         ghid: 'gh_8a8044f49d85',
         appName: '稻香视读空间',
-        ads: {},
+        ads: {
+            insertAdId: 'adunit-37c9e33d8a286c1c',
+            rewardAdId: 'adunit-22c7928ec266c640',
+            bookmarkAdId: 'adunit-e88afcea1a5e259f',
+            templateAdId: 'adunit-19d6379df05c8482'
+        },
     },
     wxdabfa5e02785fe9b: {
         appid: 'wxdabfa5e02785fe9b',
@@ -90,7 +105,7 @@ const appInfoObj = {
         ads: {},
     },
     wxc5e6b24889027032: {
-        appid: 'wxc5e6b24889027032',
+        appid: 'wxc5e6b24889027032', 
         ghid: 'gh_87e9da72ca79',
         appName: '蓝晶云瞰视界',
         ads: {},
@@ -102,7 +117,7 @@ const appInfoObj = {
         ads: {},
     },
     wx706acdc696d025ad: {
-        appid: 'wx706acdc696d025ad',
+        appid: 'wx706acdc696d025ad', 
         ghid: 'gh_e9351f804e32',
         appName: '蓝晶视界漫游',
         ads: {},
@@ -137,10 +152,131 @@ const appInfoObj = {
         appName: '蓝晶视界奇遇',
         ads: {},
     },
+    // -------------------------2025-04-15 新增
+    wx9641ddf3bfce4fe7: {
+        appid: 'wx9641ddf3bfce4fe7',
+        ghid: 'gh_64bd22957a0b',
+        appName: '蓝晶视界工场',
+        ads: {},
+    },
+    wxf2dd3343ad28ec14: {
+        appid: 'wxf2dd3343ad28ec14',
+        ghid: 'gh_d0e730b0b751',
+        appName: '蓝晶帧溯视界',
+        ads: {},
+    },
+    wxfd680c7b25e81a0f: {
+        appid: 'wxfd680c7b25e81a0f',
+        ghid: 'gh_4eb2c76973fb',
+        appName: '蓝晶视链星云',
+        ads: {},
+    },
+    wx246f273102a99f45: {
+        appid: 'wx246f273102a99f45',
+        ghid: 'gh_9da98ef130ee',
+        appName: '蓝晶映界魔盒',
+        ads: {},
+    },
+    wxee36470b004439ea: {
+        appid: 'wxee36470b004439ea',
+        ghid: 'gh_fcda1c86f2d5',
+        appName: '蓝晶像素工场',
+        ads: {},
+    },
+    wx6dacc3c0d8cb4b9f: {
+        appid: 'wx6dacc3c0d8cb4b9f',
+        ghid: 'gh_77c67c3bbe01',
+        appName: '蓝晶帧域奇点',
+        ads: {},
+    },
+    wx39a47cc77988c431: {
+        appid: 'wx39a47cc77988c431',
+        ghid: 'gh_7744bebfa666',
+        appName: '蓝晶流影矩阵',
+        ads: {},
+    },
+    wx91a45e115ece8a3e: {
+        appid: 'wx91a45e115ece8a3e',
+        ghid: 'gh_ec4e9f908f9f',
+        appName: '蓝晶帧跃视廊',
+        ads: {},
+    },
+    wx6e80e54b9ce8a47d: {
+        appid: 'wx6e80e54b9ce8a47d',
+        ghid: 'gh_1bacd9d64b74',
+        appName: '蓝晶视创云端',
+        ads: {},
+    },
+    wx6b11ce533c3aca92: {
+        appid: 'wx6b11ce533c3aca92',
+        ghid: 'gh_6f31b8bf1d53',
+        appName: '蓝晶光迹映画',
+        ads: {},
+    },
+    wx5d607cf4fa663c72: {
+        appid: 'wx5d607cf4fa663c72',
+        ghid: 'gh_37d4da670892',
+        appName: '蓝晶光映视看',
+        ads: {},
+    },
+    wxa9fb660c0d4bd708: {
+        appid: 'wxa9fb660c0d4bd708',
+        ghid: 'gh_2967a8bee850',
+        appName: '蓝晶光影漫游',
+        ads: {},
+    },
+    wxbece4f28b6b71271: {
+        appid: 'wxbece4f28b6b71271',
+        ghid: 'gh_a1ab49f66596',
+        appName: '蓝晶视能引擎',
+        ads: {},
+    },
+    wxf91f09a57b8aa3ae: {
+        appid: 'wxf91f09a57b8aa3ae',
+        ghid: 'gh_4b248a5a37a0',
+        appName: '蓝晶帧溯星海',
+        ads: {},
+    },
+    wxdd1bde4de9f6a6a0: {
+        appid: 'wxdd1bde4de9f6a6a0',
+        ghid: 'gh_028e0784579d',
+        appName: '蓝晶帧界星空',
+        ads: {},
+    },
+    wxcdfd21a368ed2ced: {
+        appid: 'wxcdfd21a368ed2ced',
+        ghid: 'gh_e144db7dd445',
+        appName: '蓝晶视界星链',
+        ads: {},
+    },
+    wxbf40c735c0d263a5: {
+        appid: 'wxbf40c735c0d263a5',
+        ghid: 'gh_5203fc3a1f80',
+        appName: '蓝晶影创视野',
+        ads: {},
+    },
+    wxf0248772f67666ee: {
+        appid: 'wxf0248772f67666ee',
+        ghid: 'gh_e43f5a747e67',
+        appName: '蓝晶映画视界',
+        ads: {},
+    },
+    wx3f464072571c1fd3: {
+        appid: 'wx3f464072571c1fd3',
+        ghid: 'gh_f4b45b2b82af',
+        appName: '蓝晶影音视看',
+        ads: {},
+    },
+    wx7328fabfb0a5fb8d: {
+        appid: 'wx7328fabfb0a5fb8d',
+        ghid: 'gh_f52c6dafa59a',
+        appName: '蓝晶光轨映廊',
+        ads: {},
+    },
 };
 
 // @config 确定使用的小程序appid
-const appid = 'wx1eb74c589da1731f';
+const appid = 'wx8a8aae7f462df482';
 export const apple = {
     ...appInfoObj[appid],
     appKey: '49TBR8Z1rA7PyqD30FV0v48AU',

+ 285 - 0
config/config.js_bak

@@ -0,0 +1,285 @@
+const appInfoObj = {
+    wxa7a33088566e1292: {
+        appid: 'wxa7a33088566e1292',
+        ghid: 'gh_4e55f615d5dc',
+        appName: '视读空间',
+        ads: {
+            insertAdId: 'adunit-37ee342a8fc046b7',
+            rewardAdId: 'adunit-7df7b95b78f624f8',
+            bookmarkAdId: 'adunit-343af082b8c8ea18',
+            templateAdId: 'adunit-80f6ec7a264f968b'
+        },
+    },
+    wxa13166979d7011c4: {
+        appid: 'wxa13166979d7011c4',
+        ghid: 'gh_dd2c1a9b59d8',
+        appName: '稻香悦读视界',
+        ads: {},
+    },
+    wx8a8aae7f462df482: {
+        appid: 'wx8a8aae7f462df482',
+        ghid: 'gh_1098838a2d7e',
+        appName: '稻香悠享阅界',
+        ads: {},
+    },
+    wx1344c35820ac688e: {
+        appid: 'wx1344c35820ac688e',
+        ghid: 'gh_e6ca97959a69',
+        appName: '稻香悠享视界',
+        ads: {},
+    },
+    wx8bd40e8ce9deb2b6: {
+        appid: 'wx8bd40e8ce9deb2b6',
+        ghid: 'gh_c40c32e29788',
+        appName: '稻香悦读空间',
+        ads: {
+            insertAdId: 'adunit-845614eb5c48a349',
+            rewardAdId: 'adunit-ace5375fafb06dde',
+            bookmarkAdId: 'adunit-38b29a959923f2ab',
+            templateAdId: 'adunit-29715e8ff52accc0'
+        },
+    },
+    wx9e90adce31181f7f: {
+        appid: 'wx9e90adce31181f7f',
+        ghid: 'gh_8a8044f49d85',
+        appName: '稻香视读空间',
+        ads: {
+            insertAdId: 'adunit-37c9e33d8a286c1c',
+            rewardAdId: 'adunit-22c7928ec266c640',
+            bookmarkAdId: 'adunit-e88afcea1a5e259f',
+            templateAdId: 'adunit-19d6379df05c8482'
+        },
+    },
+    wxdabfa5e02785fe9b: {
+        appid: 'wxdabfa5e02785fe9b',
+        ghid: 'gh_cb3eb04d904c',
+        appName: '稻阅视觉',
+        ads: {},
+    },
+    wx37dab28af5492d98: {
+        appid: 'wx37dab28af5492d98',
+        ghid: 'gh_c153bd1f3877',
+        appName: '蓝晶甄读空间',
+        ads: {},
+    },
+    wx04b705205757217b: {
+        appid: 'wx04b705205757217b',
+        ghid: 'gh_0f1c04dc3790',
+        appName: '蓝晶享看空间',
+        ads: {},
+    },
+    wxc4e78d0425e83571: {
+        appid: 'wxc4e78d0425e83571',
+        ghid: 'gh_e0fd18c3f79f',
+        appName: '蓝晶悦享视界',
+        ads: {},
+    },
+    wx9d93825db1c7dcbe: {
+        appid: 'wx9d93825db1c7dcbe',
+        ghid: 'gh_1042b9599e05',
+        appName: '蓝晶看这视界',
+        ads: {},
+    },
+    wx3fe2e6c200ec7133: {
+        appid: 'wx3fe2e6c200ec7133',
+        ghid: 'gh_298cbd19ddcb',
+        appName: '蓝晶畅看视界',
+        ads: {},
+    },
+    wx3800bb2ed4a326c5: {
+        appid: 'wx3800bb2ed4a326c5',
+        ghid: 'gh_7e70db53a149',
+        appName: '蓝晶享看视界',
+        ads: {},
+    },
+    // ------------------------2025-04-11 新增
+    wxa721f4474e3d548a: {
+        appid: 'wxa721f4474e3d548a',
+        ghid: 'gh_63df1cb1521b',
+        appName: '蓝晶创映空间',
+        ads: {},
+    },
+    wxc5e6b24889027032: {
+        appid: 'wxc5e6b24889027032', 
+        ghid: 'gh_87e9da72ca79',
+        appName: '蓝晶云瞰视界',
+        ads: {},
+    },
+    wxef68681d5044ca05: {
+        appid: 'wxef68681d5044ca05', // 小说类目没过
+        ghid: 'gh_1a76c4ef014a',
+        appName: '蓝晶帧享视界',
+        ads: {},
+    },
+    wx706acdc696d025ad: {
+        appid: 'wx706acdc696d025ad', 
+        ghid: 'gh_e9351f804e32',
+        appName: '蓝晶视界漫游',
+        ads: {},
+    },
+    wx8288d587b717897e: {
+        appid: 'wx8288d587b717897e',
+        ghid: 'gh_7d5b65ac29ee',
+        appName: '蓝晶瞰影工坊',
+        ads: {},
+    },
+    wx54a8d0e7b33c48c8: {
+        appid: 'wx54a8d0e7b33c48c8', // 小说类目没过
+        ghid: 'gh_cbbd0f0b8865',
+        appName: '蓝晶帧探视界',
+        ads: {},
+    },
+    wx0138dee6d680c705: {
+        appid: 'wx0138dee6d680c705',
+        ghid: 'gh_f82668af04f8',
+        appName: '蓝晶视海遨游',
+        ads: {},
+    },
+    wx4420e2d55b0ede27: {
+        appid: 'wx4420e2d55b0ede27',
+        ghid: 'gh_16815103d58f',
+        appName: '蓝晶影创空间',
+        ads: {},
+    },
+    wx1eb74c589da1731f: {
+        appid: 'wx1eb74c589da1731f',
+        ghid: 'gh_e8ccd3f2b283',
+        appName: '蓝晶视界奇遇',
+        ads: {},
+    },
+    // -------------------------2025-04-15 新增
+    wx9641ddf3bfce4fe7: {
+        appid: 'wx9641ddf3bfce4fe7',
+        ghid: 'gh_64bd22957a0b',
+        appName: '蓝晶视界工场',
+        ads: {},
+    },
+    wxf2dd3343ad28ec14: {
+        appid: 'wxf2dd3343ad28ec14',
+        ghid: 'gh_d0e730b0b751',
+        appName: '蓝晶帧溯视界',
+        ads: {},
+    },
+    wxfd680c7b25e81a0f: {
+        appid: 'wxfd680c7b25e81a0f',
+        ghid: 'gh_4eb2c76973fb',
+        appName: '蓝晶视链星云',
+        ads: {},
+    },
+    wx246f273102a99f45: {
+        appid: 'wx246f273102a99f45',
+        ghid: 'gh_9da98ef130ee',
+        appName: '蓝晶映界魔盒',
+        ads: {},
+    },
+    wxee36470b004439ea: {
+        appid: 'wxee36470b004439ea',
+        ghid: 'gh_fcda1c86f2d5',
+        appName: '蓝晶像素工场',
+        ads: {},
+    },
+    wx6dacc3c0d8cb4b9f: {
+        appid: 'wx6dacc3c0d8cb4b9f',
+        ghid: 'gh_77c67c3bbe01',
+        appName: '蓝晶帧域奇点',
+        ads: {},
+    },
+    wx39a47cc77988c431: {
+        appid: 'wx39a47cc77988c431',
+        ghid: 'gh_7744bebfa666',
+        appName: '蓝晶流影矩阵',
+        ads: {},
+    },
+    wx91a45e115ece8a3e: {
+        appid: 'wx91a45e115ece8a3e',
+        ghid: 'gh_ec4e9f908f9f',
+        appName: '蓝晶帧跃视廊',
+        ads: {},
+    },
+    wx6e80e54b9ce8a47d: {
+        appid: 'wx6e80e54b9ce8a47d',
+        ghid: 'gh_1bacd9d64b74',
+        appName: '蓝晶视创云端',
+        ads: {},
+    },
+    wx6b11ce533c3aca92: {
+        appid: 'wx6b11ce533c3aca92',
+        ghid: 'gh_6f31b8bf1d53',
+        appName: '蓝晶光迹映画',
+        ads: {},
+    },
+    wx5d607cf4fa663c72: {
+        appid: 'wx5d607cf4fa663c72',
+        ghid: 'gh_37d4da670892',
+        appName: '蓝晶光映视看',
+        ads: {},
+    },
+    wxa9fb660c0d4bd708: {
+        appid: 'wxa9fb660c0d4bd708',
+        ghid: 'gh_2967a8bee850',
+        appName: '蓝晶光影漫游',
+        ads: {},
+    },
+    wxbece4f28b6b71271: {
+        appid: 'wxbece4f28b6b71271',
+        ghid: 'gh_a1ab49f66596',
+        appName: '蓝晶视能引擎',
+        ads: {},
+    },
+    wxf91f09a57b8aa3ae: {
+        appid: 'wxf91f09a57b8aa3ae',
+        ghid: 'gh_4b248a5a37a0',
+        appName: '蓝晶帧溯星海',
+        ads: {},
+    },
+    wxdd1bde4de9f6a6a0: {
+        appid: 'wxdd1bde4de9f6a6a0',
+        ghid: 'gh_028e0784579d',
+        appName: '蓝晶帧界星空',
+        ads: {},
+    },
+    wxcdfd21a368ed2ced: {
+        appid: 'wxcdfd21a368ed2ced',
+        ghid: 'gh_e144db7dd445',
+        appName: '蓝晶视界星链',
+        ads: {},
+    },
+    wxbf40c735c0d263a5: {
+        appid: 'wxbf40c735c0d263a5',
+        ghid: 'gh_5203fc3a1f80',
+        appName: '蓝晶影创视野',
+        ads: {},
+    },
+    wxf0248772f67666ee: {
+        appid: 'wxf0248772f67666ee',
+        ghid: 'gh_e43f5a747e67',
+        appName: '蓝晶映画视界',
+        ads: {},
+    },
+    wx3f464072571c1fd3: {
+        appid: 'wx3f464072571c1fd3',
+        ghid: 'gh_f4b45b2b82af',
+        appName: '蓝晶影音视看',
+        ads: {},
+    },
+    wx7328fabfb0a5fb8d: {
+        appid: 'wx7328fabfb0a5fb8d',
+        ghid: 'gh_f52c6dafa59a',
+        appName: '蓝晶光轨映廊',
+        ads: {},
+    },
+};
+
+// @config 确定使用的小程序appid
+const appid = 'wx3f464072571c1fd3';
+export const apple = {
+    ...appInfoObj[appid],
+    appKey: '49TBR8Z1rA7PyqD30FV0v48AU',
+};
+
+// 线上域名信息
+export const https = {
+    dev_apiHttps: 'https://hyperion-novel-qa-app.mokamrp.com',
+    test_apiHttps: 'https://hyperion-novel-qa-app.mokamrp.com',
+    apiHttps: 'https://hyperion-novel-qa-app.mokamrp.com'
+};

+ 175 - 0
destroy/config.json

@@ -0,0 +1,175 @@
+{
+  "version": "2.4.2",
+  "desc": "2.4.2优化一些问题",
+  "appIds": [
+    {
+      "name": "视读空间",
+      "appid": "wxa7a33088566e1292"
+    },
+    {
+      "name": "稻香悦读视界",
+      "appid": "wxa13166979d7011c4"
+    },
+    {
+      "name": "稻香悠享阅界",
+      "appid": "wx8a8aae7f462df482"
+    },
+    {
+      "name": "稻香悠享视界",
+      "appid": "wx1344c35820ac688e"
+    },
+    {
+      "name": "稻香悦读空间",
+      "appid": "wx8bd40e8ce9deb2b6"
+    },
+    {
+      "name": "稻香视读空间",
+      "appid": "wx9e90adce31181f7f"
+    },
+    {
+      "name": "稻阅视觉",
+      "appid": "wxdabfa5e02785fe9b"
+    },
+    {
+      "name": "蓝晶甄读空间",
+      "appid": "wx37dab28af5492d98"
+    },
+    {
+      "name": "蓝晶享看空间",
+      "appid": "wx04b705205757217b"
+    },
+    {
+      "name": "蓝晶悦享视界",
+      "appid": "wxc4e78d0425e83571"
+    },
+    {
+      "name": "蓝晶看这视界",
+      "appid": "wx9d93825db1c7dcbe"
+    },
+    {
+      "name": "蓝晶畅看视界",
+      "appid": "wx3fe2e6c200ec7133"
+    },
+    {
+      "name": "蓝晶享看视界",
+      "appid": "wx3800bb2ed4a326c5"
+    },
+    {
+      "name": "蓝晶创映空间",
+      "appid": "wxa721f4474e3d548a"
+    },
+    {
+      "name": "蓝晶云瞰视界",
+      "appid": "wxc5e6b24889027032"
+    },
+    {
+      "name": "蓝晶帧享视界",
+      "appid": "wxef68681d5044ca05"
+    },
+    {
+      "name": "蓝晶视界漫游",
+      "appid": "wx706acdc696d025ad"
+    },
+    {
+      "name": "蓝晶瞰影工坊",
+      "appid": "wx8288d587b717897e"
+    },
+    {
+      "name": "蓝晶帧探视界",
+      "appid": "wx54a8d0e7b33c48c8"
+    },
+    {
+      "name": "蓝晶视海遨游",
+      "appid": "wx0138dee6d680c705"
+    },
+    {
+      "name": "蓝晶影创空间",
+      "appid": "wx4420e2d55b0ede27"
+    },
+    {
+      "name": "蓝晶视界奇遇",
+      "appid": "wx1eb74c589da1731f"
+    },
+    {
+      "name": "蓝晶视界工场",
+      "appid": "wx9641ddf3bfce4fe7"
+    },
+    {
+      "name": "蓝晶帧溯视界",
+      "appid": "wxf2dd3343ad28ec14"
+    },
+    {
+      "name": "蓝晶视链星云",
+      "appid": "wxfd680c7b25e81a0f"
+    },
+    {
+      "name": "蓝晶映界魔盒",
+      "appid": "wx246f273102a99f45"
+    },
+    {
+      "name": "蓝晶像素工场",
+      "appid": "wxee36470b004439ea"
+    },
+    {
+      "name": "蓝晶帧域奇点",
+      "appid": "wx6dacc3c0d8cb4b9f"
+    },
+    {
+      "name": "蓝晶流影矩阵",
+      "appid": "wx39a47cc77988c431"
+    },
+    {
+      "name": "蓝晶帧跃视廊",
+      "appid": "wx91a45e115ece8a3e"
+    },
+    {
+      "name": "蓝晶视创云端",
+      "appid": "wx6e80e54b9ce8a47d"
+    },
+    {
+      "name": "蓝晶光迹映画",
+      "appid": "wx6b11ce533c3aca92"
+    },
+    {
+      "name": "蓝晶光映视看",
+      "appid": "wx5d607cf4fa663c72"
+    },
+    {
+      "name": "蓝晶光影漫游",
+      "appid": "wxa9fb660c0d4bd708"
+    },
+    {
+      "name": "蓝晶视能引擎",
+      "appid": "wxbece4f28b6b71271"
+    },
+    {
+      "name": "蓝晶帧溯星海",
+      "appid": "wxf91f09a57b8aa3ae"
+    },
+    {
+      "name": "蓝晶帧界星空",
+      "appid": "wxdd1bde4de9f6a6a0"
+    },
+    {
+      "name": "蓝晶视界星链",
+      "appid": "wxcdfd21a368ed2ced"
+    },
+    {
+      "name": "蓝晶影创视野",
+      "appid": "wxbf40c735c0d263a5"
+    },
+    {
+      "name": "蓝晶映画视界",
+      "appid": "wxf0248772f67666ee"
+    },
+    {
+      "name": "蓝晶影音视看",
+      "appid": "wx3f464072571c1fd3"
+    },
+    {
+      "name": "蓝晶光轨映廊",
+      "appid": "wx7328fabfb0a5fb8d"
+    }
+  ],
+  "env": "正式环境"
+}

+ 83 - 0
destroy/upload.main.js

@@ -0,0 +1,83 @@
+const {fork} = require('child_process');
+const fs = require('fs');
+const path = require('path');
+
+let config = {
+    appIds: [], // 小程序appid
+    version: "",//版本号
+    desc: "",//版本描述
+    env: '正式环境',
+    appindex: 0,//当前执行到第几个小程序
+}
+
+function publishMiniProgram(options) {
+    return new Promise((resolve, reject) => {
+        const child = fork('./destroy/upload.wx.js');
+        // console.log('入参:',options);
+        child.send(options);
+        child.on('message', (msg) => {
+            if (msg.error) {
+                reject(new Error(msg.error));
+            } else {
+                resolve(msg);
+            }
+        });
+        child.on('error', reject);
+        child.on('exit', (code) => {
+            if (code !== 0) {
+                reject(new Error(`child process exited with code ${code}`));
+            }
+        });
+    })
+}
+
+exports.start = async () => {
+    try {
+        const file = await fs.promises.readFile(
+            path.join(__dirname, '../destroy/config.json'),
+            'utf-8'
+        );
+        const fileJson = JSON.parse(file);
+        config = {
+            ...config,
+            appIds: fileJson.appIds,
+            version: fileJson.version,
+            desc: fileJson.desc,
+            env: fileJson.env || '正式环境',
+            appindex: 0,
+        };
+        console.log(`本次提交小程序: ${config.appIds.map(item => `${item.name} (${item.appid})`).join(', ')}`);
+        console.log(`版本: ${config.version}`);
+        console.log(`环境: ${config.env}`);
+        console.log(`描述: ${config.desc}`);
+        // 3. 顺序发布(避免并发资源竞争)
+        let successCount = 0;
+        let failedCount = 0;
+        for (const [index, item] of config.appIds.entries()) {
+            try {
+                console.log(`\n开始发布第 ${index + 1} 个小程序: ${item.name} (${item.appid})`);
+                await publishMiniProgram({
+                    appid: item.appid,
+                    name: item.name,
+                    version: config.version,
+                    desc: `${config.env}——${config.desc}`,
+                    env: config.env,
+                    appindex: index, // 更新当前索引
+                });
+                successCount++;
+                console.log(`✅ 发布成功: ${item.name}`);
+            } catch (err) {
+                failedCount++;
+                console.error(`❌ 发布失败: ${item.name}`, err.message);
+            }
+        }
+        // 4. 返回统计结果
+        return {
+            success: successCount,
+            failed: failedCount,
+        };
+    } catch (e) {
+        console.error('❌ 启动发布流程失败:', e.message);
+        throw e;
+    }
+}

+ 114 - 0
destroy/upload.wx.js

@@ -0,0 +1,114 @@
+const ci = require('miniprogram-ci');
+const fs = require('fs');
+const path = require('path');
+
+let config = {
+    appIds: [], // 小程序appid
+    version: "",//版本号
+    desc: "",//版本描述
+    env: 'release',
+    appindex: 0,//当前执行到第几个小程序
+}
+
+process.on('message', async (data) => {
+    let {appid, name, version, desc, env, appindex} = data
+    await setProjectConfig(appid);
+    await setConfig(appid);
+
+    const project = new ci.Project({
+        appid: appid,
+        type: 'miniProgram',
+        projectPath: path.resolve(__dirname, '../'),
+        privateKeyPath: path.resolve(__dirname,
+            `../destroy/keys/private.${appid}.key`),
+        ignores: ['node_modules/**/*', 'destroy/**/*'],
+    });
+    // 上传
+    const uploadResult = await ci.upload({
+        project,
+        version: version,
+        desc: desc,
+        setting: {
+            es6: true,
+            minifyJS: true,
+            minifyWXML: true,
+            minifyWXSS: true,
+            minify: true
+        },
+        onProgressUpdate: (e) => {
+            // console.log('onProcessUpdate', e)
+            if (e._status == "done" && e._msg == "upload") {
+                console.log(`${appid}--${name}--${env} 上传完成`);
+                config.appindex += 1;
+            }
+        },
+    });
+    process.send('success');
+    process.exit();
+});
+
+// 设置 project.config.json
+const setProjectConfig = async (appid) => {
+    // 读取和替换的文件路径
+    const project_config = '../project.config.json';
+    const promise = new Promise((resolve, reject) => {
+        // 读取 project.config.json
+        fs.readFile(
+            path.join(__dirname, project_config),
+            'utf8',
+            (err, data) => {
+                if (err) throw err;
+                let json = JSON.parse(data);
+                // 替换appid
+                json.appid = appid;
+                // console.log('project.config.json:', json)
+
+                // 改写 project.config.json 中 appid
+                fs.writeFile(
+                    path.join(__dirname, project_config),
+                    JSON.stringify(json, null, 4),
+                    (err) => {
+                        if (err) throw err;
+                        resolve();
+                    }
+                );
+            }
+        );
+    });
+    return promise;
+}
+
+// 设置config.js
+const setConfig = async (appid) => {
+    // 读取和替换的文件路径
+    const config_file = '../config/config.js';
+    const promise = new Promise((resolve, reject) => {
+        // 读取 config.js
+        fs.readFile(
+            path.join(__dirname, config_file),
+            'utf8',
+            (err, data) => {
+                if (err) throw err;
+                let configjs = data;
+                const current_appid = appid;
+
+                // 替换文件中当前小程序的appid
+                const regex = new RegExp('(current_appid\\s*=\\s*["\']).*?(["\'])', 'g');
+                configjs = configjs.replace(regex, 'current_appid = \'' + current_appid + '\'');
+                // console.log(configjs)
+
+                // 改写 config.js 中 current_appid
+                fs.writeFile(
+                    path.join(__dirname, config_file),
+                    configjs,
+                    (err) => {
+                        if (err) throw err;
+                        resolve();
+                    }
+                );
+            }
+        );
+    });
+    return promise;
+}
+

+ 3 - 0
minitest/test.config.json

@@ -0,0 +1,3 @@
+{
+  "treeData": []
+}

+ 18 - 0
package.json

@@ -0,0 +1,18 @@
+{
+  "name": "mini_read_space_front",
+  "version": "1.0.0",
+  "description": "",
+  "main": "app.js",
+  "scripts": {
+    "upload": "node upload_ci.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "http://git.mokasz.com/maomao/mini_read_space_front.git"
+  },
+  "private": true,
+  "dependencies": {
+    "miniprogram-ci": "^2.0.10",
+    "gulp": "^5.0.0"
+  }
+}

+ 2 - 0
pages/mine/mine.js

@@ -3,6 +3,8 @@ import {
     apple
 } from '../../config/config'
 
+import {SendEvent} from '../../utils/util'
+
 let interstitialAd = null
 
 const app = getApp()

+ 8 - 5
project.config.json

@@ -1,8 +1,12 @@
 {
   "compileType": "miniprogram",
-  "libVersion": "trial",
   "packOptions": {
-    "ignore": [],
+    "ignore": [
+      {
+        "value": "/minitest",
+        "type": "folder"
+      }
+    ],
     "include": []
   },
   "setting": {
@@ -19,11 +23,10 @@
       "outputPath": ""
     }
   },
-  "condition": {},
   "editorSetting": {
     "tabIndent": "auto",
     "tabSize": 2
   },
-  "appid": "wx1eb74c589da1731f",
-  "simulatorPluginLibVersion": {}
+  "appid": "wx3800bb2ed4a326c5",
+  "testRoot": "minitest/"
 }

+ 35 - 0
project.config.json_bak

@@ -0,0 +1,35 @@
+{
+  "compileType": "miniprogram",
+  "libVersion": "trial",
+  "packOptions": {
+    "ignore": [
+      {
+        "value": "/minitest",
+        "type": "folder"
+      }
+    ],
+    "include": []
+  },
+  "setting": {
+    "coverView": true,
+    "es6": true,
+    "postcss": true,
+    "minified": true,
+    "enhance": true,
+    "showShadowRootInWxmlPanel": true,
+    "packNpmRelationList": [],
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    }
+  },
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "auto",
+    "tabSize": 2
+  },
+  "appid": "wx3f464072571c1fd3",
+  "simulatorPluginLibVersion": {},
+  "testRoot": "minitest/"
+}

+ 54 - 0
upload_alex.sh

@@ -0,0 +1,54 @@
+# 上传微信小程序代码
+# 使用方法:
+# 登录微信开发者工具,设置-安全-打开服务端口,命令行进入项目根目录 (登录用户要有小程序的开发权限)
+# 单个更新:
+#   upload.sh 1 wx734ee403c3aff0eb
+# 批量更新:
+#   upload.sh 2
+update_list=(
+#wx9641ddf3bfce4fe7
+#wxf2dd3343ad28ec14
+#wxfd680c7b25e81a0f
+#wx246f273102a99f45
+#wxee36470b004439ea
+#wx6dacc3c0d8cb4b9f
+#wx39a47cc77988c431
+#wx91a45e115ece8a3e
+#wx6e80e54b9ce8a47d
+#wx6b11ce533c3aca92
+#wx5d607cf4fa663c72
+#wxa9fb660c0d4bd708
+#wxbece4f28b6b71271
+#wxf91f09a57b8aa3ae
+#wxdd1bde4de9f6a6a0
+wxcdfd21a368ed2ced
+wxbf40c735c0d263a5
+wxf0248772f67666ee
+wx3f464072571c1fd3
+wx7328fabfb0a5fb8d
+)
+config_file='config/config.js'
+project_file='project.config.json'
+project_path=`pwd`
+
+unset NODE_OPTIONS
+
+# $1 1 单个更新 2 批量
+# $2 appid
+if [[ $1 == 1 ]]
+then
+  sed -i "_bak" "s/const appid = '[^']*'/const appid = '$2'/" "$config_file"
+  sed -i  "_bak" "s/\"appid\": \"[^']*\"/\"appid\": \"$2\"/g" project.config.json
+  /Applications/wechatwebdevtools.app/Contents/MacOS/cli upload --project $project_path -v 1.4.0 -d 'v1.4.0优化一些问题'
+elif [[ $1 == 2 ]]
+then
+  for ele in ${update_list[@]}
+  do
+    echo ${ele} "开始更新"
+    sed -i "_bak" "s/const appid = '[^']*'/const appid = '${ele}'/" "$config_file"
+    sed -i  "_bak" "s/\"appid\": \"[^']*\"/\"appid\": \"${ele}\"/g" "$project_file"
+    /Applications/wechatwebdevtools.app/Contents/MacOS/cli upload --project $project_path -v 1.4.0 -d 'v1.4.0优化一些问题'
+    echo ${ele} "结束更新"
+    sleep 3
+done
+fi

+ 13 - 0
upload_ci.js

@@ -0,0 +1,13 @@
+const path = require('path');
+const upload = require(path.join(__dirname, 'destroy/upload.main.js'))
+;
+(
+    async () => {
+        try {
+            const result = await upload.start();
+            console.log(`\n发布完成: 成功 ${result.success} 个, 失败 ${result.failed} 个`);
+        } catch (e) {
+            console.error('全局捕获错误:', e);
+        }
+    }
+)();

+ 47 - 0
upload_hank.sh

@@ -0,0 +1,47 @@
+# 上传微信小程序代码
+# 使用方法:
+# 登录微信开发者工具,设置-安全-打开服务端口,命令行进入项目根目录 (登录用户要有小程序的开发权限)
+# 单个更新:
+#   upload.sh 1 wx734ee403c3aff0eb
+# 批量更新:
+#   upload.sh 2
+update_list=(
+wxa7a33088566e1292
+wxdabfa5e02785fe9b
+wxa13166979d7011c4
+wx8a8aae7f462df482
+wx1344c35820ac688e
+wx8bd40e8ce9deb2b6
+wx9e90adce31181f7f
+wx37dab28af5492d98
+wx04b705205757217b
+wxc4e78d0425e83571
+wx9d93825db1c7dcbe
+wx3fe2e6c200ec7133
+wx3800bb2ed4a326c5
+)
+config_file='config/config.js'
+project_file='project.config.json'
+project_path=`pwd`
+
+unset NODE_OPTIONS
+
+# $1 1 单个更新 2 批量
+# $2 appid
+if [[ $1 == 1 ]]
+then
+  sed -i "_bak" "s/const appid = '[^']*'/const appid = '$2'/" "$config_file"
+  sed -i  "_bak" "s/\"appid\": \"[^']*\"/\"appid\": \"$2\"/g" project.config.json
+  /Applications/wechatwebdevtools.app/Contents/MacOS/cli upload --project $project_path -v 1.4.0 -d 'v1.4.0优化一些问题'
+elif [[ $1 == 2 ]]
+then
+  for ele in ${update_list[@]}
+  do
+    echo ${ele} "开始更新"
+    sed -i "_bak" "s/const appid = '[^']*'/const appid = '${ele}'/" "$config_file"
+    sed -i  "_bak" "s/\"appid\": \"[^']*\"/\"appid\": \"${ele}\"/g" "$project_file"
+    /Applications/wechatwebdevtools.app/Contents/MacOS/cli upload --project $project_path -v 1.4.0 -d 'v1.4.0优化一些问题'
+    echo ${ele} "结束更新"
+    sleep 3
+done
+fi