From b88b6251de539cb2756801058e9b2eca7f41f449 Mon Sep 17 00:00:00 2001 From: huanghaipeng Date: Fri, 16 Jan 2026 10:59:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B8=85=E7=90=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=88=96=E8=80=85=E6=9B=B4=E6=8D=A2=E6=9C=BA=E5=99=A8?= =?UTF-8?q?addLevel+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/module/Pay/Utils.ts | 12 ++++++------ assets/Script/module/Tool/GameTool.ts | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/assets/Script/module/Pay/Utils.ts b/assets/Script/module/Pay/Utils.ts index 02af540..ec66027 100644 --- a/assets/Script/module/Pay/Utils.ts +++ b/assets/Script/module/Pay/Utils.ts @@ -496,7 +496,7 @@ export default class Utils { /** 上传关卡等级信息 */ //上传关卡等级信息 - static setUserLevel(callBack) { + static setUserLevel(callBack, wuxian?) { //@ts-ignore if ((typeof wx !== 'undefined' && wx !== null) || (typeof tt !== 'undefined' && tt !== null)) { let uid = cc.fx.StorageMessage.getStorage("uid"); @@ -507,16 +507,16 @@ export default class Utils { if (cc.fx.GameConfig.GM_INFO.level <= 0 || cc.fx.GameConfig.GM_INFO.level == undefined) { cc.fx.GameConfig.GM_INFO.level = 0; } - let wuXian = false; - if (cc.fx.GameTool.maxLevel() && cc.fx.GameConfig.GM_INFO.GameplayType == 1) { - wuXian = true; - } + + let isWuxian = wuxian !== undefined ? wuxian : false; // 如果wuxian有传值则使用该值,否则默认为false + let setData = { uid: cc.fx.GameConfig.GM_INFO.uid, action: 'save', levelAmount: parseInt(cc.fx.GameConfig.GM_INFO.level), - isWuXian: wuXian + isWuXian: isWuxian } + console.log("无限值", isWuxian); Utils.POST("userLevel", setData, res => { //console.log("获得userLevel数据:", res); if (res.code === 1) { diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index ba86312..f815cf7 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -404,6 +404,12 @@ var GameTool = { if (cc.fx.GameConfig.GM_INFO.addLevel == 4) { updateLocation = true; } + + let isWuxian = false; + if (cc.fx.GameTool.maxLevel() && cc.fx.GameConfig.GM_INFO.GameplayType == 1) { + isWuxian = true; + } + Utils.setUserLevel((data) => { if (callBack) { if (data.code == 1) { @@ -429,7 +435,7 @@ var GameTool = { // console.log("获取到的IP信息:", data, data.data.address, data.data.IP); callBack(data); } - }) + }, isWuxian) },