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) },