From 92faa0fe0998e155790b49132a5fea772ae92789 Mon Sep 17 00:00:00 2001 From: panfudan Date: Thu, 21 Aug 2025 14:05:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=85=BE=E8=AE=AF=E4=BA=91=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E6=9B=B4=E6=96=B0,=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E8=B5=84=E6=BA=90=E6=B6=88=E8=80=97,?= =?UTF-8?q?=E5=88=86=E5=BC=80=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/gui/role_controller.prefab | 6 +++--- .../cloud_functions/cocos_cloud/modules/heros.js | 9 +-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index b67dd9eb..bcd7d20d 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -30173,7 +30173,7 @@ }, { "__type__": "cc.Node", - "_name": "ResourceBar_01_White_Add_Bg", + "_name": "Bg", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -31267,7 +31267,7 @@ }, { "__type__": "cc.Node", - "_name": "ResourceBar_01_White_Add_Bg", + "_name": "Bg", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -33455,7 +33455,7 @@ }, { "__type__": "cc.Node", - "_name": "ResourceBar_01_White_Add_Bg", + "_name": "Bg", "_objFlags": 0, "__editorExtras__": {}, "_parent": { diff --git a/build-templates/wechatgame/cloud_functions/cocos_cloud/modules/heros.js b/build-templates/wechatgame/cloud_functions/cocos_cloud/modules/heros.js index 4af6893a..523d8f7b 100644 --- a/build-templates/wechatgame/cloud_functions/cocos_cloud/modules/heros.js +++ b/build-templates/wechatgame/cloud_functions/cocos_cloud/modules/heros.js @@ -290,7 +290,7 @@ async function setHeroProperty(db, openid, heroId, property, value) { * @param {number} levels 升级级数(默认1级) * @returns {Object} 操作结果 */ -async function levelUpHero(db, openid, heroId, exp,gold,levels = 1) { +async function levelUpHero(db, openid, heroId,levels = 1) { try { let user = await getOrCreaterUser(db, openid); if (!user) { @@ -314,13 +314,6 @@ async function levelUpHero(db, openid, heroId, exp,gold,levels = 1) { msg: "等级必须为正数" }; } - let result=await spendDataField(db, openid, {'exp':exp,'gold':gold}); - if(result.code!==200){ - return { - code: -1, - msg: `升级失败,${result.msg}` - }; - } const currentLevel = user.heros[heroId].lv || 1; const newLevel = currentLevel + levels; return await setHeroProperty(db, openid, heroId, 'lv', newLevel);