update
This commit is contained in:
parent
e09a3e0a4a
commit
319b4c2319
@ -47,8 +47,8 @@
|
|||||||
},
|
},
|
||||||
"_scale": {
|
"_scale": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0.416015625,
|
"x": 0.5703125,
|
||||||
"y": 0.416015625,
|
"y": 0.5703125,
|
||||||
"z": 1
|
"z": 1
|
||||||
},
|
},
|
||||||
"_quat": {
|
"_quat": {
|
||||||
@ -12654,7 +12654,7 @@
|
|||||||
"__id__": 377
|
"__id__": 377
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": false,
|
"_active": true,
|
||||||
"_level": 2,
|
"_level": 2,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
|
@ -13759,7 +13759,7 @@
|
|||||||
"__id__": 368
|
"__id__": 368
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": false,
|
||||||
"_level": 3,
|
"_level": 3,
|
||||||
"_components": [],
|
"_components": [],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
@ -14355,7 +14355,7 @@
|
|||||||
"__id__": 478
|
"__id__": 478
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": false,
|
||||||
"_level": 3,
|
"_level": 3,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
var NetManage = require('NetManage');
|
var NetManage = require("NetManage");
|
||||||
var gameConfig = require('gameConfig');
|
var gameConfig = require("gameConfig");
|
||||||
var Utils = require('Utils');
|
var Utils = require("Utils");
|
||||||
const { uimanger, UIManger } = require('./UIManger');
|
const { uimanger, UIManger } = require("./UIManger");
|
||||||
const { KeyanMain } = require('./Academy/UIKeyanMain');
|
const { KeyanMain } = require("./Academy/UIKeyanMain");
|
||||||
|
|
||||||
const Config = require('../Config');
|
const Config = require("../Config");
|
||||||
const { default: Loading } = require('../gif/Loading');
|
const { default: Loading } = require("../gif/Loading");
|
||||||
const { GuestLoginTip } = require('../tips/GuestLoginTip');
|
const { GuestLoginTip } = require("../tips/GuestLoginTip");
|
||||||
const { LogoutTip } = require('../tips/LogoutTip');
|
const { LogoutTip } = require("../tips/LogoutTip");
|
||||||
const { operation, OperationType } = require('../Operation/Operation');
|
const { operation, OperationType } = require("../Operation/Operation");
|
||||||
const jcgamelog = require('../jcfw/service/jcgamelog');
|
const jcgamelog = require("../jcfw/service/jcgamelog");
|
||||||
cc.Class({
|
cc.Class({
|
||||||
extends: cc.Component,
|
extends: cc.Component,
|
||||||
|
|
||||||
@ -182,18 +182,18 @@ cc.Class({
|
|||||||
//
|
//
|
||||||
|
|
||||||
cc.uiMain = this;
|
cc.uiMain = this;
|
||||||
cc.Notifier.on('openSelfPlayerInfoUI', this, this.callInfo.bind(this));
|
cc.Notifier.on("openSelfPlayerInfoUI", this, this.callInfo.bind(this));
|
||||||
cc.Notifier.on('joinTeamRoom', this, this.joinTeamRoom.bind(this));
|
cc.Notifier.on("joinTeamRoom", this, this.joinTeamRoom.bind(this));
|
||||||
// cc.Notifier.on("openheroinfo", this, this.openheroinfo.bind(this));
|
// cc.Notifier.on("openheroinfo", this, this.openheroinfo.bind(this));
|
||||||
cc.Notifier.on('buyitem', this, this.buyitem.bind(this));
|
cc.Notifier.on("buyitem", this, this.buyitem.bind(this));
|
||||||
cc.Notifier.on(
|
cc.Notifier.on(
|
||||||
'refreshBaseInfo',
|
"refreshBaseInfo",
|
||||||
this,
|
this,
|
||||||
this.refreshBaseInfo.bind(this)
|
this.refreshBaseInfo.bind(this)
|
||||||
);
|
);
|
||||||
cc.Notifier.on('getreward', this, this.callreward.bind(this));
|
cc.Notifier.on("getreward", this, this.callreward.bind(this));
|
||||||
cc.Notifier.on(
|
cc.Notifier.on(
|
||||||
'hasConnectWallet',
|
"hasConnectWallet",
|
||||||
this,
|
this,
|
||||||
this.getwalletEvent.bind(this)
|
this.getwalletEvent.bind(this)
|
||||||
);
|
);
|
||||||
@ -236,7 +236,7 @@ cc.Class({
|
|||||||
|
|
||||||
// 将钱包地址中间字段换成 *****
|
// 将钱包地址中间字段换成 *****
|
||||||
replacepos(text, start, stop) {
|
replacepos(text, start, stop) {
|
||||||
var mid = '*****';
|
var mid = "*****";
|
||||||
let mystr =
|
let mystr =
|
||||||
text.toString().substr(0, start - 1) +
|
text.toString().substr(0, start - 1) +
|
||||||
mid +
|
mid +
|
||||||
@ -245,18 +245,18 @@ cc.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
cc.Notifier.off('openSelfPlayerInfoUI', this);
|
cc.Notifier.off("openSelfPlayerInfoUI", this);
|
||||||
cc.Notifier.off('joinTeamRoom', this);
|
cc.Notifier.off("joinTeamRoom", this);
|
||||||
// cc.Notifier.off("openheroinfo", this);
|
// cc.Notifier.off("openheroinfo", this);
|
||||||
cc.Notifier.off('buyitem', this);
|
cc.Notifier.off("buyitem", this);
|
||||||
cc.Notifier.off('refreshBaseInfo', this);
|
cc.Notifier.off("refreshBaseInfo", this);
|
||||||
cc.Notifier.off('getreward', this);
|
cc.Notifier.off("getreward", this);
|
||||||
cc.Notifier.on('hasConnectWallet', this);
|
cc.Notifier.on("hasConnectWallet", this);
|
||||||
},
|
},
|
||||||
refreshBaseInfo() {
|
refreshBaseInfo() {
|
||||||
var pdata = cc.playerData;
|
var pdata = cc.playerData;
|
||||||
this.lb_name.string = pdata.name;
|
this.lb_name.string = pdata.name;
|
||||||
this.lb_lv.string = 'LV.' + pdata.level;
|
this.lb_lv.string = "LV." + pdata.level;
|
||||||
this.lb_gold.string = pdata.gold;
|
this.lb_gold.string = pdata.gold;
|
||||||
this.lb_diamond.string = pdata.diamond;
|
this.lb_diamond.string = pdata.diamond;
|
||||||
this.pr_progress.progress = pdata.exp / pdata.max_exp;
|
this.pr_progress.progress = pdata.exp / pdata.max_exp;
|
||||||
@ -269,12 +269,12 @@ cc.Class({
|
|||||||
this.nowheroid = pdata.hero_id;
|
this.nowheroid = pdata.hero_id;
|
||||||
var skinres = cc.playerData.getheroSkinbyId(this.nowheroid, 0);
|
var skinres = cc.playerData.getheroSkinbyId(this.nowheroid, 0);
|
||||||
cc.loader.loadRes(
|
cc.loader.loadRes(
|
||||||
'spine/heropic/pic_hero' + skinres,
|
"spine/heropic/pic_hero" + skinres,
|
||||||
sp.SkeletonData,
|
sp.SkeletonData,
|
||||||
function (err, sp) {
|
function (err, sp) {
|
||||||
this.spine_hero.skeletonData = sp;
|
this.spine_hero.skeletonData = sp;
|
||||||
this.spine_hero._updateSkeletonData();
|
this.spine_hero._updateSkeletonData();
|
||||||
this.spine_hero.setAnimation(0, 'animation', true);
|
this.spine_hero.setAnimation(0, "animation", true);
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -299,31 +299,31 @@ cc.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onClickOfficial() {
|
onClickOfficial() {
|
||||||
this.openUrlinNative('https://www.cebg.games/');
|
this.openUrlinNative("https://www.cebg.games/");
|
||||||
},
|
},
|
||||||
onClickTwitter() {
|
onClickTwitter() {
|
||||||
this.openUrlinNative('https://twitter.com/CEBG_GAME');
|
this.openUrlinNative("https://twitter.com/CEBG_GAME");
|
||||||
},
|
},
|
||||||
onClickTelegram() {
|
onClickTelegram() {
|
||||||
this.openUrlinNative('https://t.me/CEBG_official');
|
this.openUrlinNative("https://t.me/CEBG_official");
|
||||||
},
|
},
|
||||||
onClickDiscord() {
|
onClickDiscord() {
|
||||||
this.openUrlinNative('https://discord.gg/8dWX6jpcME');
|
this.openUrlinNative("https://discord.gg/8dWX6jpcME");
|
||||||
},
|
},
|
||||||
|
|
||||||
openUrlinNative(url) {
|
openUrlinNative(url) {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'openurl', url);
|
jcgamelog.addOperation(OperationType.BUTTON, "openurl", url);
|
||||||
if (cc.sys.os == cc.sys.OS_ANDROID) {
|
if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||||
jsb.reflection.callStaticMethod(
|
jsb.reflection.callStaticMethod(
|
||||||
'org/cocos2dx/javascript/AppActivity',
|
"org/cocos2dx/javascript/AppActivity",
|
||||||
'openSocialUrl',
|
"openSocialUrl",
|
||||||
'(Ljava/lang/String;)V',
|
"(Ljava/lang/String;)V",
|
||||||
url
|
url
|
||||||
);
|
);
|
||||||
} else if (cc.sys.os == cc.sys.OS_IOS) {
|
} else if (cc.sys.os == cc.sys.OS_IOS) {
|
||||||
jsb.reflection.callStaticMethod(
|
jsb.reflection.callStaticMethod(
|
||||||
'AppController',
|
"AppController",
|
||||||
'openSocialUrl:',
|
"openSocialUrl:",
|
||||||
url
|
url
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -331,11 +331,11 @@ cc.Class({
|
|||||||
|
|
||||||
callreward(v) {
|
callreward(v) {
|
||||||
var nd = cc.instantiate(this.pb_reward1);
|
var nd = cc.instantiate(this.pb_reward1);
|
||||||
nd.getComponent('UIReward').initdata(v);
|
nd.getComponent("UIReward").initdata(v);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
callBattle() {
|
callBattle() {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'intobattle');
|
jcgamelog.addOperation(OperationType.BUTTON, "intobattle");
|
||||||
if (cc.sys.isNative) {
|
if (cc.sys.isNative) {
|
||||||
if (Config.isTest) {
|
if (Config.isTest) {
|
||||||
// 审核
|
// 审核
|
||||||
@ -357,29 +357,29 @@ cc.Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
callChat() {
|
callChat() {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'intochat');
|
jcgamelog.addOperation(OperationType.BUTTON, "intochat");
|
||||||
var nd = cc.instantiate(this.pb_chat);
|
var nd = cc.instantiate(this.pb_chat);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
callbattlechosehero(opt) {
|
callbattlechosehero(opt) {
|
||||||
var nd = cc.instantiate(this.pb_chosehero);
|
var nd = cc.instantiate(this.pb_chosehero);
|
||||||
nd.getComponent('UIChoseHero').initdata(opt);
|
nd.getComponent("UIChoseHero").initdata(opt);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
callteammatch(teamid) {
|
callteammatch(teamid) {
|
||||||
var nd = cc.instantiate(this.pb_teammatch);
|
var nd = cc.instantiate(this.pb_teammatch);
|
||||||
nd.getComponent('UITeamMatch').initdata(teamid);
|
nd.getComponent("UITeamMatch").initdata(teamid);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
onclickinfo() {
|
onclickinfo() {
|
||||||
this.callInfo(NetManage.account_id);
|
this.callInfo(NetManage.account_id);
|
||||||
},
|
},
|
||||||
callInfo(v) {
|
callInfo(v) {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'into userinfo');
|
jcgamelog.addOperation(OperationType.BUTTON, "into userinfo");
|
||||||
NetManage.getUeserInfo(v, (data) => {
|
NetManage.getUeserInfo(v, (data) => {
|
||||||
if (data.errcode == 0) {
|
if (data.errcode == 0) {
|
||||||
var nd = cc.instantiate(this.pb_userinfo);
|
var nd = cc.instantiate(this.pb_userinfo);
|
||||||
nd.getComponent('UIRoleInfo').initdata(data.info);
|
nd.getComponent("UIRoleInfo").initdata(data.info);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -398,7 +398,7 @@ cc.Class({
|
|||||||
callrole() {
|
callrole() {
|
||||||
NetManage.getHeroList((data) => {
|
NetManage.getHeroList((data) => {
|
||||||
var nd = cc.instantiate(this.pb_hero);
|
var nd = cc.instantiate(this.pb_hero);
|
||||||
nd.getComponent('UIHero').initdata(data);
|
nd.getComponent("UIHero").initdata(data);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -410,7 +410,7 @@ cc.Class({
|
|||||||
buyitem(v) {
|
buyitem(v) {
|
||||||
//待扩展其他类型的
|
//待扩展其他类型的
|
||||||
var nd = cc.instantiate(this.pb_herobuy);
|
var nd = cc.instantiate(this.pb_herobuy);
|
||||||
nd.getComponent('UIHeroBuy').initdata(v);
|
nd.getComponent("UIHeroBuy").initdata(v);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
calltop(fnode) {
|
calltop(fnode) {
|
||||||
@ -426,14 +426,14 @@ cc.Class({
|
|||||||
},
|
},
|
||||||
calleditname(itemid) {
|
calleditname(itemid) {
|
||||||
var nd = cc.instantiate(this.pb_editname);
|
var nd = cc.instantiate(this.pb_editname);
|
||||||
nd.getComponent('UINameCard').initdata(itemid);
|
nd.getComponent("UINameCard").initdata(itemid);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
|
|
||||||
callrank() {
|
callrank() {
|
||||||
NetManage.getactivityRankingList(1, (data) => {
|
NetManage.getactivityRankingList(1, (data) => {
|
||||||
var nd = cc.instantiate(this.pb_rank);
|
var nd = cc.instantiate(this.pb_rank);
|
||||||
nd.getComponent('UIRank').init(JSON.stringify(data));
|
nd.getComponent("UIRank").init(JSON.stringify(data));
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -447,7 +447,7 @@ cc.Class({
|
|||||||
calltask() {
|
calltask() {
|
||||||
NetManage.missionList(1, (data) => {
|
NetManage.missionList(1, (data) => {
|
||||||
var nd = cc.instantiate(this.pb_task);
|
var nd = cc.instantiate(this.pb_task);
|
||||||
nd.getComponent('UITask').initdata(data);
|
nd.getComponent("UITask").initdata(data);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -458,7 +458,7 @@ cc.Class({
|
|||||||
// });
|
// });
|
||||||
NetManage.gunList((data) => {
|
NetManage.gunList((data) => {
|
||||||
var nd = cc.instantiate(this.pb_gun);
|
var nd = cc.instantiate(this.pb_gun);
|
||||||
nd.getComponent('UIGuns').initdata(data);
|
nd.getComponent("UIGuns").initdata(data);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -482,7 +482,7 @@ cc.Class({
|
|||||||
callseasoncard() {
|
callseasoncard() {
|
||||||
NetManage.seasonCard((data) => {
|
NetManage.seasonCard((data) => {
|
||||||
var nd = cc.instantiate(this.pb_seasoncard);
|
var nd = cc.instantiate(this.pb_seasoncard);
|
||||||
nd.getComponent('UISeasonCard').initdata(data);
|
nd.getComponent("UISeasonCard").initdata(data);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -501,16 +501,16 @@ cc.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'logout');
|
jcgamelog.addOperation(OperationType.BUTTON, "logout");
|
||||||
uimanger.showUI(LogoutTip.prefabPath);
|
uimanger.showUI(LogoutTip.prefabPath);
|
||||||
},
|
},
|
||||||
|
|
||||||
connectwalletinmain() {
|
connectwalletinmain() {
|
||||||
jcgamelog.addOperation(
|
jcgamelog.addOperation(
|
||||||
OperationType.BUTTON,
|
OperationType.BUTTON,
|
||||||
'clickwalletconnectinmain'
|
"clickwalletconnectinmain"
|
||||||
);
|
);
|
||||||
localStorage.removeItem('walletaccount');
|
localStorage.removeItem("walletaccount");
|
||||||
window.hasWallet = false;
|
window.hasWallet = false;
|
||||||
cc.game.restart();
|
cc.game.restart();
|
||||||
},
|
},
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
|
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
|
||||||
//var httpclient = require("httpclient");
|
//var httpclient = require("httpclient");
|
||||||
//var urlbuilder = require("urlbuilder");
|
//var urlbuilder = require("urlbuilder");
|
||||||
var httpclient = require('httpclient');
|
var httpclient = require("httpclient");
|
||||||
var urlbuilder = require('urlbuilder');
|
var urlbuilder = require("urlbuilder");
|
||||||
const BaseNet = require('../../BaseNet');
|
const BaseNet = require("../../BaseNet");
|
||||||
const Config = require('../../Config');
|
const Config = require("../../Config");
|
||||||
const { isTesting } = require('../../Config');
|
const { isTesting } = require("../../Config");
|
||||||
const { WhitelistTip } = require('../../tips/WhitelistTip');
|
const { WhitelistTip } = require("../../tips/WhitelistTip");
|
||||||
const { uimanger } = require('../../UI/UIManger');
|
const { uimanger } = require("../../UI/UIManger");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// LIFE-CYCLE CALLBACKS:
|
// LIFE-CYCLE CALLBACKS:
|
||||||
@ -37,69 +37,69 @@ module.exports = {
|
|||||||
) {
|
) {
|
||||||
if (window.canAutoLogin == true) {
|
if (window.canAutoLogin == true) {
|
||||||
this.autoLogin(
|
this.autoLogin(
|
||||||
localStorage.getItem('loginaccount'),
|
localStorage.getItem("loginaccount"),
|
||||||
localStorage.getItem('loginsession'),
|
localStorage.getItem("loginsession"),
|
||||||
(res) => {
|
(res) => {
|
||||||
console.log('auto login res===' + res);
|
console.log("auto login res===" + res);
|
||||||
var obj = httpclient.JSON_parse(res);
|
var obj = httpclient.JSON_parse(res);
|
||||||
// console.log("[__login]success!" + JSON.stringify(obj));
|
// console.log("[__login]success!" + JSON.stringify(obj));
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
cc.Notifier.emit('autologinsuccess');
|
cc.Notifier.emit("autologinsuccess");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(BaseNet.getNormalApiUrl('login'));
|
console.log(BaseNet.getNormalApiUrl("login"));
|
||||||
|
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'Login')
|
.addKV("c", "Login")
|
||||||
.addKV('a', 'auth')
|
.addKV("a", "auth")
|
||||||
.addKV('gameid', gameid);
|
.addKV("gameid", gameid);
|
||||||
if (cc.appPlatformID) {
|
if (cc.appPlatformID) {
|
||||||
channelid = cc.appPlatformID;
|
channelid = cc.appPlatformID;
|
||||||
console.log('PlatformID==', channelid);
|
console.log("PlatformID==", channelid);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.urlbd.addKV('channel', channelid);
|
this.urlbd.addKV("channel", channelid);
|
||||||
|
|
||||||
if (cc.sdkdata) {
|
if (cc.sdkdata) {
|
||||||
this.urlbd.addKV('openid', cc.sdkdata.openid);
|
this.urlbd.addKV("openid", cc.sdkdata.openid);
|
||||||
// this.urlbd.addKV('token', cc.sdkdata.token);
|
// this.urlbd.addKV('token', cc.sdkdata.token);
|
||||||
|
|
||||||
this.urlbd.addKV('poly_sdk_channel', 8001);
|
this.urlbd.addKV("poly_sdk_channel", 8001);
|
||||||
this.urlbd.addKV(
|
this.urlbd.addKV(
|
||||||
'poly_sdk_subchannel',
|
"poly_sdk_subchannel",
|
||||||
cc.sdkdata.poly_sdk_subchannel
|
cc.sdkdata.poly_sdk_subchannel
|
||||||
);
|
);
|
||||||
} else if (cc.sdkData2) {
|
} else if (cc.sdkData2) {
|
||||||
console.log('SDKData3==', JSON.stringify(cc.sdkData2));
|
console.log("SDKData3==", JSON.stringify(cc.sdkData2));
|
||||||
this.urlbd.addKV('openid', cc.sdkData2.openid);
|
this.urlbd.addKV("openid", cc.sdkData2.openid);
|
||||||
// this.urlbd.addKV('token', cc.sdkData2.token);
|
// this.urlbd.addKV('token', cc.sdkData2.token);
|
||||||
} else {
|
} else {
|
||||||
if (openid && openid != '') {
|
if (openid && openid != "") {
|
||||||
this.urlbd.addKV('openid', openid);
|
this.urlbd.addKV("openid", openid);
|
||||||
} else {
|
} else {
|
||||||
this.urlbd.addKV('openid', tokencode);
|
this.urlbd.addKV("openid", tokencode);
|
||||||
}
|
}
|
||||||
this.urlbd.addKV('token', tokencode);
|
this.urlbd.addKV("token", tokencode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.env) {
|
if (this.env) {
|
||||||
this.urlbd.addKV('env', this.env);
|
this.urlbd.addKV("env", this.env);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channelid == '6516') {
|
if (channelid == "6516") {
|
||||||
this.urlbd.addKV('account', window.account);
|
this.urlbd.addKV("account", window.account);
|
||||||
this.urlbd.addKV('net_id', '321');
|
this.urlbd.addKV("net_id", "321");
|
||||||
// getNounce
|
// getNounce
|
||||||
this.urlbd.addKV('nonce', window.nonce);
|
this.urlbd.addKV("nonce", window.nonce);
|
||||||
this.urlbd.addKV('signature', window.appsign);
|
this.urlbd.addKV("signature", window.appsign);
|
||||||
this.urlbd.addKV('tips', 'sign request');
|
this.urlbd.addKV("tips", "sign request");
|
||||||
|
|
||||||
// reset token
|
// reset token
|
||||||
var tmpToken = '';
|
var tmpToken = "";
|
||||||
if (cc.sdkdata) {
|
if (cc.sdkdata) {
|
||||||
tmpToken = cc.sdkdata.token;
|
tmpToken = cc.sdkdata.token;
|
||||||
} else if (cc.sdkData2) {
|
} else if (cc.sdkData2) {
|
||||||
@ -111,12 +111,12 @@ module.exports = {
|
|||||||
token = {
|
token = {
|
||||||
token: tmpToken,
|
token: tmpToken,
|
||||||
account: window.account,
|
account: window.account,
|
||||||
tips: 'sign request',
|
tips: "sign request",
|
||||||
nonce: window.nonce,
|
nonce: window.nonce,
|
||||||
signature: window.appsign,
|
signature: window.appsign,
|
||||||
net_id: 321,
|
net_id: 321,
|
||||||
};
|
};
|
||||||
this.urlbd.addKV('type', 0);
|
this.urlbd.addKV("type", 0);
|
||||||
|
|
||||||
// if (cc.sys.os == cc.sys.OS_ANDROID) {
|
// if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||||
// token = {
|
// token = {
|
||||||
@ -141,12 +141,12 @@ module.exports = {
|
|||||||
|
|
||||||
console.log(`TOKEN --- ${JSON.stringify(token)}`);
|
console.log(`TOKEN --- ${JSON.stringify(token)}`);
|
||||||
|
|
||||||
this.urlbd.addKV('token', JSON.stringify(token));
|
this.urlbd.addKV("token", JSON.stringify(token));
|
||||||
} else {
|
} else {
|
||||||
if (cc.sdkdata) {
|
if (cc.sdkdata) {
|
||||||
this.urlbd.addKV('token', cc.sdkdata.token);
|
this.urlbd.addKV("token", cc.sdkdata.token);
|
||||||
} else if (cc.sdkData2) {
|
} else if (cc.sdkData2) {
|
||||||
this.urlbd.addKV('token', cc.sdkData2.token);
|
this.urlbd.addKV("token", cc.sdkData2.token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,28 +156,28 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
console.log(`login res --${restext}`);
|
console.log(`login res --${restext}`);
|
||||||
|
|
||||||
console.log('errcode----' + obj.errcode);
|
console.log("errcode----" + obj.errcode);
|
||||||
|
|
||||||
if (obj.errcode == 66) {
|
if (obj.errcode == 66) {
|
||||||
console.log('用户不在白名单中');
|
console.log("用户不在白名单中");
|
||||||
uimanger.showUI(WhitelistTip.prefabPath);
|
uimanger.showUI(WhitelistTip.prefabPath);
|
||||||
localStorage.removeItem('walletaccount');
|
localStorage.removeItem("walletaccount");
|
||||||
window.hasWallet = false;
|
window.hasWallet = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log('[__login]success!' + JSON.stringify(obj));
|
console.log("[__login]success!" + JSON.stringify(obj));
|
||||||
cc.subchannel = obj.channel;
|
cc.subchannel = obj.channel;
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'[__login]failed!' + obj.errcode + ':' + obj.errmsg
|
"[__login]failed!" + obj.errcode + ":" + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log('[__login]failed!' + errcode + ':' + errmsg);
|
console.log("[__login]failed!" + errcode + ":" + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -196,36 +196,36 @@ module.exports = {
|
|||||||
) {
|
) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'Login')
|
.addKV("c", "Login")
|
||||||
.addKV('a', 'activateWeiXinUser')
|
.addKV("a", "activateWeiXinUser")
|
||||||
.addKV('gameid', gameid)
|
.addKV("gameid", gameid)
|
||||||
.addKV('account_id', accountid)
|
.addKV("account_id", accountid)
|
||||||
.addKV('session_id', sessionid)
|
.addKV("session_id", sessionid)
|
||||||
.addKV('rawdata', raw)
|
.addKV("rawdata", raw)
|
||||||
.addKV('signature', sign)
|
.addKV("signature", sign)
|
||||||
.addKV('encrypted_data', encyptdata)
|
.addKV("encrypted_data", encyptdata)
|
||||||
.addKV('iv', iv);
|
.addKV("iv", iv);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (restext) {
|
function (restext) {
|
||||||
if (restext == '') {
|
if (restext == "") {
|
||||||
failcb && failcb(0, -1, 'restext is nullstring!');
|
failcb && failcb(0, -1, "restext is nullstring!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj && obj.errcode == 0) {
|
if (obj && obj.errcode == 0) {
|
||||||
console.log('[__activeWX]success!' + JSON.stringify(obj));
|
console.log("[__activeWX]success!" + JSON.stringify(obj));
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'[__activeWX]failed!' + obj.errcode + ':' + obj.errmsg
|
"[__activeWX]failed!" + obj.errcode + ":" + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log('[__activeWX]failed!' + errcode + ':' + errmsg);
|
console.log("[__activeWX]failed!" + errcode + ":" + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -234,19 +234,19 @@ module.exports = {
|
|||||||
__updateInfo(accountid, sessionid, usrinfo, successcb, failcb) {
|
__updateInfo(accountid, sessionid, usrinfo, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'Login')
|
.addKV("c", "Login")
|
||||||
.addKV('a', 'updateUserInfo')
|
.addKV("a", "updateUserInfo")
|
||||||
.addKV('account_id', accountid)
|
.addKV("account_id", accountid)
|
||||||
.addKV('session_id', sessionid)
|
.addKV("session_id", sessionid)
|
||||||
.addKV('nickname', usrinfo.nickname)
|
.addKV("nickname", usrinfo.nickname)
|
||||||
.addKV('city', usrinfo.city)
|
.addKV("city", usrinfo.city)
|
||||||
.addKV('province', usrinfo.province)
|
.addKV("province", usrinfo.province)
|
||||||
.addKV('avatar_url', usrinfo.avatar_url)
|
.addKV("avatar_url", usrinfo.avatar_url)
|
||||||
.addKV('country', usrinfo.country)
|
.addKV("country", usrinfo.country)
|
||||||
.addKV('sex', usrinfo.sex)
|
.addKV("sex", usrinfo.sex)
|
||||||
.addKV('birthday', usrinfo.birthday)
|
.addKV("birthday", usrinfo.birthday)
|
||||||
.addKV('phone', usrinfo.phone)
|
.addKV("phone", usrinfo.phone)
|
||||||
.addKV('location', usrinfo.location);
|
.addKV("location", usrinfo.location);
|
||||||
// if(!this.isoffical){
|
// if(!this.isoffical){
|
||||||
// console.log(this.urlbd.baseurl);
|
// console.log(this.urlbd.baseurl);
|
||||||
// }
|
// }
|
||||||
@ -255,17 +255,17 @@ module.exports = {
|
|||||||
function (restext) {
|
function (restext) {
|
||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log('[__updateInfo]success!' + JSON.stringify(obj));
|
console.log("[__updateInfo]success!" + JSON.stringify(obj));
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'[__updateInfo]failed!' + obj.errcode + ':' + obj.errmsg
|
"[__updateInfo]failed!" + obj.errcode + ":" + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log('[__updateInfo]failed!' + errcode + ':' + errmsg);
|
console.log("[__updateInfo]failed!" + errcode + ":" + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -274,11 +274,11 @@ module.exports = {
|
|||||||
__generalSignature(accountid, sessionid, signdata, successcb, failcb) {
|
__generalSignature(accountid, sessionid, signdata, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'Login')
|
.addKV("c", "Login")
|
||||||
.addKV('a', 'signature')
|
.addKV("a", "signature")
|
||||||
.addKV('account_id', accountid)
|
.addKV("account_id", accountid)
|
||||||
.addKV('session_id', sessionid)
|
.addKV("session_id", sessionid)
|
||||||
.addKV('params', signdata);
|
.addKV("params", signdata);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
@ -286,14 +286,14 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log(
|
console.log(
|
||||||
'[__generalSignature]success!' + JSON.stringify(obj)
|
"[__generalSignature]success!" + JSON.stringify(obj)
|
||||||
);
|
);
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'[__generalSignature]failed!' +
|
"[__generalSignature]failed!" +
|
||||||
obj.errcode +
|
obj.errcode +
|
||||||
':' +
|
":" +
|
||||||
obj.errmsg
|
obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
@ -301,7 +301,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log(
|
console.log(
|
||||||
'[__generalSignature]failed!' + errcode + ':' + errmsg
|
"[__generalSignature]failed!" + errcode + ":" + errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
@ -311,11 +311,11 @@ module.exports = {
|
|||||||
__generalToken(accountid, sessionid, sceneid, successcb, failcb) {
|
__generalToken(accountid, sessionid, sceneid, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'Login')
|
.addKV("c", "Login")
|
||||||
.addKV('a', 'getAccessToken')
|
.addKV("a", "getAccessToken")
|
||||||
.addKV('account_id', accountid)
|
.addKV("account_id", accountid)
|
||||||
.addKV('session_id', sessionid)
|
.addKV("session_id", sessionid)
|
||||||
.addKV('scene', sceneid);
|
.addKV("scene", sceneid);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
@ -323,21 +323,21 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log(
|
console.log(
|
||||||
'[__generalToken]success!' + JSON.stringify(obj)
|
"[__generalToken]success!" + JSON.stringify(obj)
|
||||||
);
|
);
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'[__generalToken]failed!' +
|
"[__generalToken]failed!" +
|
||||||
obj.errcode +
|
obj.errcode +
|
||||||
':' +
|
":" +
|
||||||
obj.errmsg
|
obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log('[__generalToken]failed!' + errcode + ':' + errmsg);
|
console.log("[__generalToken]failed!" + errcode + ":" + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -346,10 +346,10 @@ module.exports = {
|
|||||||
__getAnnouncement(channelid, gameid, successcb, failcb) {
|
__getAnnouncement(channelid, gameid, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'Annc')
|
.addKV("c", "Annc")
|
||||||
.addKV('a', 'getAnnouncement')
|
.addKV("a", "getAnnouncement")
|
||||||
.addKV('gameid', gameid)
|
.addKV("gameid", gameid)
|
||||||
.addKV('channel', channelid);
|
.addKV("channel", channelid);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
@ -357,14 +357,14 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log(
|
console.log(
|
||||||
'[__getAnnouncement]success!' + JSON.stringify(obj)
|
"[__getAnnouncement]success!" + JSON.stringify(obj)
|
||||||
);
|
);
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'[__getAnnouncement]failed!' +
|
"[__getAnnouncement]failed!" +
|
||||||
obj.errcode +
|
obj.errcode +
|
||||||
':' +
|
":" +
|
||||||
obj.errmsg
|
obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
@ -372,7 +372,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log(
|
console.log(
|
||||||
'[__getAnnouncement]failed!' + errcode + ':' + errmsg
|
"[__getAnnouncement]failed!" + errcode + ":" + errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
@ -382,13 +382,13 @@ module.exports = {
|
|||||||
__getServerList(channelid, gameid, successcb, failcb) {
|
__getServerList(channelid, gameid, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'SrvList')
|
.addKV("c", "SrvList")
|
||||||
.addKV('a', 'getSrvList')
|
.addKV("a", "getSrvList")
|
||||||
.addKV('gameid', gameid)
|
.addKV("gameid", gameid)
|
||||||
.addKV('channel', channelid);
|
.addKV("channel", channelid);
|
||||||
|
|
||||||
if (this.env) {
|
if (this.env) {
|
||||||
this.urlbd.addKV('env', this.env);
|
this.urlbd.addKV("env", this.env);
|
||||||
}
|
}
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
@ -397,14 +397,14 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log(
|
console.log(
|
||||||
'[__getServerList]success!' + JSON.stringify(obj)
|
"[__getServerList]success!" + JSON.stringify(obj)
|
||||||
);
|
);
|
||||||
successcb && successcb(obj.server_list);
|
successcb && successcb(obj.server_list);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'[__getServerList]failed!' +
|
"[__getServerList]failed!" +
|
||||||
obj.errcode +
|
obj.errcode +
|
||||||
':' +
|
":" +
|
||||||
obj.errmsg
|
obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
@ -412,7 +412,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log(
|
console.log(
|
||||||
'[__getServerList]failed!' + errcode + ':' + errmsg
|
"[__getServerList]failed!" + errcode + ":" + errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
@ -422,28 +422,28 @@ module.exports = {
|
|||||||
__loginYoume(accountid, sessionid, nickname, successcb, failcb) {
|
__loginYoume(accountid, sessionid, nickname, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'YouMe')
|
.addKV("c", "YouMe")
|
||||||
.addKV('a', 'login')
|
.addKV("a", "login")
|
||||||
.addKV('account_id', accountid)
|
.addKV("account_id", accountid)
|
||||||
.addKV('session_id', sessionid)
|
.addKV("session_id", sessionid)
|
||||||
.addKV('nickname', nickname);
|
.addKV("nickname", nickname);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (restext) {
|
function (restext) {
|
||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log('[__loginYoume]success!' + JSON.stringify(obj));
|
console.log("[__loginYoume]success!" + JSON.stringify(obj));
|
||||||
successcb && successcb(obj.token);
|
successcb && successcb(obj.token);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'[__loginYoume]failed!' + obj.errcode + ':' + obj.errmsg
|
"[__loginYoume]failed!" + obj.errcode + ":" + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log('[__loginYoume]failed!' + errcode + ':' + errmsg);
|
console.log("[__loginYoume]failed!" + errcode + ":" + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -530,7 +530,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
console.log('[_loadLocalInfo]finish');
|
console.log("[_loadLocalInfo]finish");
|
||||||
this._localinfoloaded = true;
|
this._localinfoloaded = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -560,56 +560,56 @@ module.exports = {
|
|||||||
this.svuserinfo.birthday = info.birthday;
|
this.svuserinfo.birthday = info.birthday;
|
||||||
this.svuserinfo.phone = info.phone;
|
this.svuserinfo.phone = info.phone;
|
||||||
this.svuserinfo.location = info.location;
|
this.svuserinfo.location = info.location;
|
||||||
console.log('[_loadServerInfo]finish');
|
console.log("[_loadServerInfo]finish");
|
||||||
this._svinfoloaded = true;
|
this._svinfoloaded = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
_combineInfo(svinfo, lcinfo) {
|
_combineInfo(svinfo, lcinfo) {
|
||||||
let bupdated = false;
|
let bupdated = false;
|
||||||
if (lcinfo.nickname && svinfo.nickname != lcinfo.nickname) {
|
if (lcinfo.nickname && svinfo.nickname != lcinfo.nickname) {
|
||||||
console.log('[nickname]' + svinfo.nickName + '|' + lcinfo.nickname);
|
console.log("[nickname]" + svinfo.nickName + "|" + lcinfo.nickname);
|
||||||
svinfo.nickname = lcinfo.nickname;
|
svinfo.nickname = lcinfo.nickname;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.city && svinfo.city != lcinfo.city) {
|
if (lcinfo.city && svinfo.city != lcinfo.city) {
|
||||||
console.log('[city]' + svinfo.city + '|' + lcinfo.city);
|
console.log("[city]" + svinfo.city + "|" + lcinfo.city);
|
||||||
svinfo.city = lcinfo.city;
|
svinfo.city = lcinfo.city;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.province && svinfo.province != lcinfo.province) {
|
if (lcinfo.province && svinfo.province != lcinfo.province) {
|
||||||
console.log('[province]' + svinfo.province + '|' + lcinfo.province);
|
console.log("[province]" + svinfo.province + "|" + lcinfo.province);
|
||||||
svinfo.province = lcinfo.province;
|
svinfo.province = lcinfo.province;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.country && svinfo.country != lcinfo.country) {
|
if (lcinfo.country && svinfo.country != lcinfo.country) {
|
||||||
console.log('[country]' + svinfo.country + '|' + lcinfo.country);
|
console.log("[country]" + svinfo.country + "|" + lcinfo.country);
|
||||||
svinfo.country = lcinfo.country;
|
svinfo.country = lcinfo.country;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.avatar_url && svinfo.avatar_url != lcinfo.avatar_url) {
|
if (lcinfo.avatar_url && svinfo.avatar_url != lcinfo.avatar_url) {
|
||||||
console.log(
|
console.log(
|
||||||
'[avatar_url]' + svinfo.avatar_url + '|' + lcinfo.avatar_url
|
"[avatar_url]" + svinfo.avatar_url + "|" + lcinfo.avatar_url
|
||||||
);
|
);
|
||||||
svinfo.avatar_url = lcinfo.avatar_url;
|
svinfo.avatar_url = lcinfo.avatar_url;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.sex && svinfo.sex != lcinfo.sex) {
|
if (lcinfo.sex && svinfo.sex != lcinfo.sex) {
|
||||||
console.log('[sex]' + svinfo.sex + '|' + lcinfo.sex);
|
console.log("[sex]" + svinfo.sex + "|" + lcinfo.sex);
|
||||||
svinfo.sex = lcinfo.sex;
|
svinfo.sex = lcinfo.sex;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.birthday && svinfo.birthday != lcinfo.birthday) {
|
if (lcinfo.birthday && svinfo.birthday != lcinfo.birthday) {
|
||||||
console.log('[birthday]' + svinfo.birthday + '|' + lcinfo.birthday);
|
console.log("[birthday]" + svinfo.birthday + "|" + lcinfo.birthday);
|
||||||
svinfo.birthday = lcinfo.birthday;
|
svinfo.birthday = lcinfo.birthday;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.phone && svinfo.phone != lcinfo.phone) {
|
if (lcinfo.phone && svinfo.phone != lcinfo.phone) {
|
||||||
console.log('[phone]' + svinfo.phone + '|' + lcinfo.phone);
|
console.log("[phone]" + svinfo.phone + "|" + lcinfo.phone);
|
||||||
svinfo.phone = lcinfo.phone;
|
svinfo.phone = lcinfo.phone;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.location && svinfo.location != lcinfo.location) {
|
if (lcinfo.location && svinfo.location != lcinfo.location) {
|
||||||
console.log('[location]' + svinfo.location + '|' + lcinfo.location);
|
console.log("[location]" + svinfo.location + "|" + lcinfo.location);
|
||||||
svinfo.location = lcinfo.location;
|
svinfo.location = lcinfo.location;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
@ -621,15 +621,15 @@ module.exports = {
|
|||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this.channelid = channelid;
|
this.channelid = channelid;
|
||||||
this.gameid = gameid;
|
this.gameid = gameid;
|
||||||
this.sessionid = this.sessionid ? this.sessionid : '';
|
this.sessionid = this.sessionid ? this.sessionid : "";
|
||||||
this.accountid = this.accountid ? this.accountid : '';
|
this.accountid = this.accountid ? this.accountid : "";
|
||||||
this.openid = this.openid ? this.openid : '';
|
this.openid = this.openid ? this.openid : "";
|
||||||
this.env = env;
|
this.env = env;
|
||||||
this.isoffical = isoffical;
|
this.isoffical = isoffical;
|
||||||
this.logined = this.logined ? this.logined : false;
|
this.logined = this.logined ? this.logined : false;
|
||||||
this.urlbd = new urlbuilder(BaseNet.getNormalApiUrl('login'));
|
this.urlbd = new urlbuilder(BaseNet.getNormalApiUrl("login"));
|
||||||
console.log(
|
console.log(
|
||||||
'[jclogin]init:' + gameid + '|' + channelid + '|' + isoffical
|
"[jclogin]init:" + gameid + "|" + channelid + "|" + isoffical
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -678,12 +678,12 @@ module.exports = {
|
|||||||
//
|
//
|
||||||
let self = this;
|
let self = this;
|
||||||
let openId = BK.getSystemInfoSync().openId;
|
let openId = BK.getSystemInfoSync().openId;
|
||||||
console.log('loginQQ openid:' + openId);
|
console.log("loginQQ openid:" + openId);
|
||||||
// BK.Script.loadlib("GameRes://qqPlayCore.js") //预加载bricks js层接口
|
// BK.Script.loadlib("GameRes://qqPlayCore.js") //预加载bricks js层接口
|
||||||
BK.QQ.fetchOpenKey(function (errCode, cmd, data) {
|
BK.QQ.fetchOpenKey(function (errCode, cmd, data) {
|
||||||
if (errCode == 0) {
|
if (errCode == 0) {
|
||||||
let openKey = data.openKey;
|
let openKey = data.openKey;
|
||||||
console.log('loginQQ openKey:' + openKey);
|
console.log("loginQQ openKey:" + openKey);
|
||||||
self.login(openKey, successcb, failcb, openId);
|
self.login(openKey, successcb, failcb, openId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -691,12 +691,12 @@ module.exports = {
|
|||||||
break;
|
break;
|
||||||
case 6003:
|
case 6003:
|
||||||
{
|
{
|
||||||
console.log('[qg.login]BEGIN:' + exparam);
|
console.log("[qg.login]BEGIN:" + exparam);
|
||||||
if (typeof qg != 'undefined') {
|
if (typeof qg != "undefined") {
|
||||||
qg.login({
|
qg.login({
|
||||||
pkgName: exparam,
|
pkgName: exparam,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('[qg.login]success');
|
console.log("[qg.login]success");
|
||||||
console.log(JSON.stringify(res));
|
console.log(JSON.stringify(res));
|
||||||
this.login(
|
this.login(
|
||||||
res.token,
|
res.token,
|
||||||
@ -707,7 +707,7 @@ module.exports = {
|
|||||||
this.updateuserinfo(res);
|
this.updateuserinfo(res);
|
||||||
},
|
},
|
||||||
fail: (res) => {
|
fail: (res) => {
|
||||||
console.log('[qg.login]fail');
|
console.log("[qg.login]fail");
|
||||||
console.log(JSON.stringify(res));
|
console.log(JSON.stringify(res));
|
||||||
failcb && failcb();
|
failcb && failcb();
|
||||||
},
|
},
|
||||||
@ -722,7 +722,7 @@ module.exports = {
|
|||||||
qg.getProfile({
|
qg.getProfile({
|
||||||
token: vivotoken,
|
token: vivotoken,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
console.log('[vivo.login]success');
|
console.log("[vivo.login]success");
|
||||||
self.login(
|
self.login(
|
||||||
vivotoken,
|
vivotoken,
|
||||||
successcb,
|
successcb,
|
||||||
@ -732,20 +732,20 @@ module.exports = {
|
|||||||
self.updateuserinfo(data);
|
self.updateuserinfo(data);
|
||||||
},
|
},
|
||||||
fail: function (data, code) {
|
fail: function (data, code) {
|
||||||
console.log('[vivo.login]fail');
|
console.log("[vivo.login]fail");
|
||||||
failcb && failcb();
|
failcb && failcb();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
qg.authorize({
|
qg.authorize({
|
||||||
type: 'token',
|
type: "token",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
console.log('vivoAuthorize success');
|
console.log("vivoAuthorize success");
|
||||||
vivoGetUserInfo(data.accessToken);
|
vivoGetUserInfo(data.accessToken);
|
||||||
},
|
},
|
||||||
fail: function (data, code) {
|
fail: function (data, code) {
|
||||||
console.log('vivoAuthorize fail');
|
console.log("vivoAuthorize fail");
|
||||||
failcb && failcb();
|
failcb && failcb();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -767,16 +767,16 @@ module.exports = {
|
|||||||
this._loginstarttime = new Date().getTime();
|
this._loginstarttime = new Date().getTime();
|
||||||
wx.login({
|
wx.login({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('[wx]login success!' + res.code);
|
console.log("[wx]login success!" + res.code);
|
||||||
self.login(res.code, successcb, failcb);
|
self.login(res.code, successcb, failcb);
|
||||||
},
|
},
|
||||||
fail: function (res) {
|
fail: function (res) {
|
||||||
console.log('[wx]login fail!');
|
console.log("[wx]login fail!");
|
||||||
failcb && failcb(0, res.errcode, res.errmsg);
|
failcb && failcb(0, res.errcode, res.errmsg);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
failcb && failcb(-1, 0, 'not weixin platform!');
|
failcb && failcb(-1, 0, "not weixin platform!");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -861,10 +861,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
AccountID(openid) {
|
AccountID(openid) {
|
||||||
if (this.accountid && this.accountid != '') {
|
if (this.accountid && this.accountid != "") {
|
||||||
return this.accountid;
|
return this.accountid;
|
||||||
}
|
}
|
||||||
return this.channelid + '_' + this.gameid + '_' + openid;
|
return this.channelid + "_" + this.gameid + "_" + openid;
|
||||||
},
|
},
|
||||||
|
|
||||||
setAccountID(accountid, sessionid) {
|
setAccountID(accountid, sessionid) {
|
||||||
@ -890,44 +890,44 @@ module.exports = {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'Login')
|
.addKV("c", "Login")
|
||||||
.addKV('a', 'getNonce')
|
.addKV("a", "getNonce")
|
||||||
.addKV('gameid', this.gameid)
|
.addKV("gameid", this.gameid)
|
||||||
.addKV('account', window.account);
|
.addKV("account", window.account);
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (res) {
|
function (res) {
|
||||||
window.nonce = httpclient.JSON_parse(res).nonce;
|
window.nonce = httpclient.JSON_parse(res).nonce;
|
||||||
if (cc.sys.os == cc.sys.OS_IOS) {
|
if (cc.sys.os == cc.sys.OS_IOS) {
|
||||||
jsb.reflection.callStaticMethod(
|
jsb.reflection.callStaticMethod(
|
||||||
'AppController',
|
"AppController",
|
||||||
'signApp:',
|
"signApp:",
|
||||||
window.nonce
|
window.nonce
|
||||||
);
|
);
|
||||||
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
|
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||||
var signData = {
|
var signData = {
|
||||||
types: {
|
types: {
|
||||||
EIP712Domain: [
|
EIP712Domain: [
|
||||||
{ name: 'name', type: 'string' },
|
{ name: "name", type: "string" },
|
||||||
{ name: 'version', type: 'string' },
|
{ name: "version", type: "string" },
|
||||||
],
|
],
|
||||||
set: [
|
set: [
|
||||||
{ name: 'tips', type: 'string' },
|
{ name: "tips", type: "string" },
|
||||||
{ name: 'nonce', type: 'string' },
|
{ name: "nonce", type: "string" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
primaryType: 'set',
|
primaryType: "set",
|
||||||
domain: { name: 'Auth', version: '1' },
|
domain: { name: "Auth", version: "1" },
|
||||||
message: {
|
message: {
|
||||||
tips: 'sign request',
|
tips: "sign request",
|
||||||
nonce: window.nonce,
|
nonce: window.nonce,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
jsb.reflection.callStaticMethod(
|
jsb.reflection.callStaticMethod(
|
||||||
'org/cocos2dx/javascript/AppActivity',
|
"org/cocos2dx/javascript/AppActivity",
|
||||||
'signApp',
|
"signApp",
|
||||||
'(Ljava/lang/String;)V',
|
"(Ljava/lang/String;)V",
|
||||||
JSON.stringify(signData)
|
JSON.stringify(signData)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -944,20 +944,20 @@ module.exports = {
|
|||||||
autoLogin(accountid, sessionid, successcb) {
|
autoLogin(accountid, sessionid, successcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'Login')
|
.addKV("c", "Login")
|
||||||
.addKV('a', 'sessionAuth')
|
.addKV("a", "sessionAuth")
|
||||||
.addKV('account_id', accountid)
|
.addKV("account_id", accountid)
|
||||||
.addKV('session_id', sessionid);
|
.addKV("session_id", sessionid);
|
||||||
|
|
||||||
console.log('auto....');
|
console.log("auto....");
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (res) {
|
function (res) {
|
||||||
console.log('login success');
|
console.log("login success");
|
||||||
successcb && successcb(res);
|
successcb && successcb(res);
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log('login err' + errcode + errmsg);
|
console.log("login err" + errcode + errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -965,16 +965,16 @@ module.exports = {
|
|||||||
getSwitch(cb) {
|
getSwitch(cb) {
|
||||||
const tmpUrlBd = new urlbuilder(BaseNet.getExaminingUrl());
|
const tmpUrlBd = new urlbuilder(BaseNet.getExaminingUrl());
|
||||||
tmpUrlBd
|
tmpUrlBd
|
||||||
.addKV('c', 'ServerSwitch')
|
.addKV("c", "ServerSwitch")
|
||||||
.addKV('a', 'getSwitch')
|
.addKV("a", "getSwitch")
|
||||||
.addKV('gameid', 2006);
|
.addKV("gameid", 2006);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
tmpUrlBd.baseurl,
|
tmpUrlBd.baseurl,
|
||||||
function (res) {
|
function (res) {
|
||||||
var obj = httpclient.JSON_parse(res);
|
var obj = httpclient.JSON_parse(res);
|
||||||
if (obj.examining == '1') {
|
if (obj.examining == "1") {
|
||||||
Config.isTest = false;
|
Config.isTest = true;
|
||||||
} else {
|
} else {
|
||||||
Config.isTest = false;
|
Config.isTest = false;
|
||||||
}
|
}
|
||||||
@ -987,29 +987,29 @@ module.exports = {
|
|||||||
getVoipSign(group_id, successcb, failcb) {
|
getVoipSign(group_id, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV('c', 'Login')
|
.addKV("c", "Login")
|
||||||
.addKV('a', 'getVoipSign')
|
.addKV("a", "getVoipSign")
|
||||||
.addKV('gameid', this.gameid)
|
.addKV("gameid", this.gameid)
|
||||||
.addKV('account_id', this.accountid)
|
.addKV("account_id", this.accountid)
|
||||||
.addKV('session_id', this.sessionid)
|
.addKV("session_id", this.sessionid)
|
||||||
.addKV('group_id', group_id);
|
.addKV("group_id", group_id);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (restext) {
|
function (restext) {
|
||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log('[getVoipSign]success!' + JSON.stringify(obj));
|
console.log("[getVoipSign]success!" + JSON.stringify(obj));
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'[getVoipSign]failed!' + obj.errcode + ':' + obj.errmsg
|
"[getVoipSign]failed!" + obj.errcode + ":" + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log('[getVoipSign]failed!' + errcode + ':' + errmsg);
|
console.log("[getVoipSign]failed!" + errcode + ":" + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user