shawenguan 1 year ago
parent
commit
75f55fc760
1 changed files with 8 additions and 7 deletions
  1. 8 7
      Scripts/hbcpre/hbcpreComposite.js

+ 8 - 7
Scripts/hbcpre/hbcpreComposite.js

@@ -132,13 +132,17 @@ async function tryComposite() {
             return;
         }
         let result = await startComposite(activityId, materials);
-        if(result){
-            magicJS.notification.appendNotifyInfo(`🎉合成活动[${activityId}]合成成功!`);
+        if(!result){
+            magicJS.notification.appendNotifyInfo(`🎉合成活动[${activityData.eventsName}]合成失败!`);
+            return;
+        }
+        if(result.code == 200){
+            magicJS.notification.appendNotifyInfo(`🎉合成活动[${activityData.eventsName}]合成成功!`);
             // 刷新合成数据
             activityData = await getCompositeList(activityId);
             saveActivitDataCache(activityId, activityData);
         } else {
-
+            magicJS.notification.appendNotifyInfo(`🎉合成活动[${activityData.eventsName}]${result.message}`);
         }
         return result;
     }
@@ -317,10 +321,7 @@ async function getCompositeList(id){
 async function startComposite(id, materials){
     let reqData = {eventsId: `${id}`, materials: materials};
     let result = await hbRequest({API: '/mall/works/composite', METHOD: 'post'}, reqData);
-    if(result.code != 200){
-        return null;
-    }
-    return result.data;
+    return result;
 }
 
 function transformKeys(keyStr) {