优化清理数据或者更换机器addLevel+1

This commit is contained in:
huanghaipeng 2026-01-16 10:59:18 +08:00
parent 6926345275
commit b88b6251de
2 changed files with 13 additions and 7 deletions

View File

@ -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) {

View File

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