优化清理数据或者更换机器addLevel+1
This commit is contained in:
parent
6926345275
commit
b88b6251de
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user