|
|
@@ -1800,6 +1800,7 @@ this.adSdk = t;
|
|
|
this.init();
|
|
|
}
|
|
|
t.prototype.init = function() {
|
|
|
+cc.sys.os == cc.sys.OS_ANDROID ? mk.ad.ifShowAd = !0 : mk.ad.ifShowAd = !1;
|
|
|
this.adSdk.initSDK();
|
|
|
};
|
|
|
t.prototype.watchAd = function(t) {
|
|
|
@@ -6960,7 +6961,7 @@ done: !0
|
|
|
Object.defineProperty(n, "__esModule", {
|
|
|
value: !0
|
|
|
});
|
|
|
-n.EVENT_TYPE = n.AUDIO_TYPE = n.RewardType = n.RewardState = n.GameProp = n.GameData = void 0;
|
|
|
+n.StorageKey = n.EVENT_TYPE = n.AUDIO_TYPE = n.RewardType = n.RewardState = n.GameProp = n.GameData = void 0;
|
|
|
var r, a = function() {
|
|
|
function t() {
|
|
|
this.dataFinish = !1;
|
|
|
@@ -6971,6 +6972,7 @@ this.configs = {};
|
|
|
this.funOpenData = [];
|
|
|
this.gameData = null;
|
|
|
this.init_coin = !1;
|
|
|
+this.init_head = !1;
|
|
|
this.props = new Map();
|
|
|
this.pools = [ {
|
|
|
url: "game/prefab/tips",
|
|
|
@@ -7222,6 +7224,7 @@ t.ef_fly = "ef_fly";
|
|
|
t.BACK_WxAuth = "BACK_WxAuth";
|
|
|
t.UPDATE_CashNum = "UPDATE_CashNum";
|
|
|
})(n.EVENT_TYPE || (n.EVENT_TYPE = {}));
|
|
|
+n.StorageKey || (n.StorageKey = {});
|
|
|
cc._RF.pop();
|
|
|
}, {} ],
|
|
|
GameLogic: [ function(t, e, n) {
|
|
|
@@ -8242,11 +8245,123 @@ t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n(
|
|
|
var i, r = arguments.length, a = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, n) : o;
|
|
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(t, e, n, o); else for (var c = t.length - 1; c >= 0; c--) (i = t[c]) && (a = (r < 3 ? i(a) : r > 3 ? i(e, n, a) : i(e, n)) || a);
|
|
|
return r > 3 && a && Object.defineProperty(e, n, a), a;
|
|
|
+}, a = this && this.__awaiter || function(t, e, n, o) {
|
|
|
+return new (n || (n = Promise))(function(i, r) {
|
|
|
+function a(t) {
|
|
|
+try {
|
|
|
+s(o.next(t));
|
|
|
+} catch (t) {
|
|
|
+r(t);
|
|
|
+}
|
|
|
+}
|
|
|
+function c(t) {
|
|
|
+try {
|
|
|
+s(o.throw(t));
|
|
|
+} catch (t) {
|
|
|
+r(t);
|
|
|
+}
|
|
|
+}
|
|
|
+function s(t) {
|
|
|
+t.done ? i(t.value) : (e = t.value, e instanceof n ? e : new n(function(t) {
|
|
|
+t(e);
|
|
|
+})).then(a, c);
|
|
|
+var e;
|
|
|
+}
|
|
|
+s((o = o.apply(t, e || [])).next());
|
|
|
+});
|
|
|
+}, c = this && this.__generator || function(t, e) {
|
|
|
+var n, o, i, r, a = {
|
|
|
+label: 0,
|
|
|
+sent: function() {
|
|
|
+if (1 & i[0]) throw i[1];
|
|
|
+return i[1];
|
|
|
+},
|
|
|
+trys: [],
|
|
|
+ops: []
|
|
|
+};
|
|
|
+return r = {
|
|
|
+next: c(0),
|
|
|
+throw: c(1),
|
|
|
+return: c(2)
|
|
|
+}, "function" == typeof Symbol && (r[Symbol.iterator] = function() {
|
|
|
+return this;
|
|
|
+}), r;
|
|
|
+function c(t) {
|
|
|
+return function(e) {
|
|
|
+return s([ t, e ]);
|
|
|
+};
|
|
|
+}
|
|
|
+function s(r) {
|
|
|
+if (n) throw new TypeError("Generator is already executing.");
|
|
|
+for (;a; ) try {
|
|
|
+if (n = 1, o && (i = 2 & r[0] ? o.return : r[0] ? o.throw || ((i = o.return) && i.call(o),
|
|
|
+0) : o.next) && !(i = i.call(o, r[1])).done) return i;
|
|
|
+(o = 0, i) && (r = [ 2 & r[0], i.value ]);
|
|
|
+switch (r[0]) {
|
|
|
+case 0:
|
|
|
+case 1:
|
|
|
+i = r;
|
|
|
+break;
|
|
|
+
|
|
|
+case 4:
|
|
|
+a.label++;
|
|
|
+return {
|
|
|
+value: r[1],
|
|
|
+done: !1
|
|
|
+};
|
|
|
+
|
|
|
+case 5:
|
|
|
+a.label++;
|
|
|
+o = r[1];
|
|
|
+r = [ 0 ];
|
|
|
+continue;
|
|
|
+
|
|
|
+case 7:
|
|
|
+r = a.ops.pop();
|
|
|
+a.trys.pop();
|
|
|
+continue;
|
|
|
+
|
|
|
+default:
|
|
|
+if (!(i = a.trys, i = i.length > 0 && i[i.length - 1]) && (6 === r[0] || 2 === r[0])) {
|
|
|
+a = 0;
|
|
|
+continue;
|
|
|
+}
|
|
|
+if (3 === r[0] && (!i || r[1] > i[0] && r[1] < i[3])) {
|
|
|
+a.label = r[1];
|
|
|
+break;
|
|
|
+}
|
|
|
+if (6 === r[0] && a.label < i[1]) {
|
|
|
+a.label = i[1];
|
|
|
+i = r;
|
|
|
+break;
|
|
|
+}
|
|
|
+if (i && a.label < i[2]) {
|
|
|
+a.label = i[2];
|
|
|
+a.ops.push(r);
|
|
|
+break;
|
|
|
+}
|
|
|
+i[2] && a.ops.pop();
|
|
|
+a.trys.pop();
|
|
|
+continue;
|
|
|
+}
|
|
|
+r = e.call(t, a);
|
|
|
+} catch (t) {
|
|
|
+r = [ 6, t ];
|
|
|
+o = 0;
|
|
|
+} finally {
|
|
|
+n = i = 0;
|
|
|
+}
|
|
|
+if (5 & r[0]) throw r[1];
|
|
|
+return {
|
|
|
+value: r[0] ? r[1] : void 0,
|
|
|
+done: !0
|
|
|
+};
|
|
|
+}
|
|
|
};
|
|
|
Object.defineProperty(n, "__esModule", {
|
|
|
value: !0
|
|
|
});
|
|
|
-var a = t("../../mk/system/JsbSystem"), c = t("./FunBtns"), s = cc._decorator, l = s.ccclass, u = s.property, p = function(t) {
|
|
|
+var s = t("../../mk/system/JsbSystem"), l = t("./FunBtns"), u = cc._decorator, p = u.ccclass, d = u.property, h = function(t) {
|
|
|
i(e, t);
|
|
|
function e() {
|
|
|
var e = null !== t && t.apply(this, arguments) || this;
|
|
|
@@ -8278,15 +8393,17 @@ this.initInfo();
|
|
|
};
|
|
|
e.prototype.update = function() {
|
|
|
gData.gameData.init_coin && this.initInfo();
|
|
|
+gData.gameData.init_head && this.initHead();
|
|
|
};
|
|
|
e.prototype.lateUpdate = function() {
|
|
|
gData.gameData.init_coin = !1;
|
|
|
+gData.gameData.init_head = !1;
|
|
|
};
|
|
|
e.prototype.initMusic = function() {
|
|
|
mk.audio.playMusic("bgm");
|
|
|
};
|
|
|
e.prototype.initBtns = function() {
|
|
|
-this.node_btn.getComponent(c.default).init();
|
|
|
+this.node_btn.getComponent(l.default).init();
|
|
|
};
|
|
|
e.prototype.initQiPaos = function() {
|
|
|
mk.tween.scale(this.btn_getRed1, .6, 0, 1, null, "backOut");
|
|
|
@@ -8324,6 +8441,22 @@ e.prototype.initInfo = function() {
|
|
|
this.lbl_redMoney.string = gData.gameData.gameData.redMoney + "";
|
|
|
this.lbl_rmb.string = gData.gameData.gameData.piggyBank + "";
|
|
|
};
|
|
|
+e.prototype.initHead = function() {
|
|
|
+return a(this, void 0, void 0, function() {
|
|
|
+var t;
|
|
|
+return c(this, function(e) {
|
|
|
+switch (e.label) {
|
|
|
+case 0:
|
|
|
+return [ 4, mk.loader.loadRemote(gData.wechatData.avatar + "?aaa=aa.jpg", null) ];
|
|
|
+
|
|
|
+case 1:
|
|
|
+t = e.sent();
|
|
|
+this.img_head.spriteFrame = new cc.SpriteFrame(t);
|
|
|
+return [ 2 ];
|
|
|
+}
|
|
|
+});
|
|
|
+});
|
|
|
+};
|
|
|
e.prototype.testFly = function() {
|
|
|
mk.fly.PlayCoinAnim(1, 20, cc.v2(0, -300), cc.v2(0, 0));
|
|
|
};
|
|
|
@@ -8331,67 +8464,67 @@ e.prototype.onClickStart = function() {
|
|
|
this.node_gameplay.active = !0;
|
|
|
};
|
|
|
e.prototype.onClickShare = function() {
|
|
|
-a.default.sharePic();
|
|
|
+gData.loginData.isAuth ? s.default.sharePic() : mk.tip.pop("请先点击头像,在设置界面授权");
|
|
|
};
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Node,
|
|
|
displayName: "游戏核心玩法"
|
|
|
}) ], e.prototype, "node_gameplay", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Node,
|
|
|
displayName: "功能按钮"
|
|
|
}) ], e.prototype, "node_btn", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Sprite,
|
|
|
displayName: "头像"
|
|
|
}) ], e.prototype, "img_head", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Label,
|
|
|
displayName: "红包币"
|
|
|
}) ], e.prototype, "lbl_redMoney", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Label,
|
|
|
displayName: "金猪币"
|
|
|
}) ], e.prototype, "lbl_rmb", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Sprite,
|
|
|
displayName: "红包提现"
|
|
|
}) ], e.prototype, "btn_cashOutNormal", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Sprite,
|
|
|
displayName: "金猪提现"
|
|
|
}) ], e.prototype, "btn_cashOutGold", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Node,
|
|
|
displayName: "气泡红包1"
|
|
|
}) ], e.prototype, "btn_getRed1", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Node,
|
|
|
displayName: "气泡红包2"
|
|
|
}) ], e.prototype, "btn_getRed2", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Node,
|
|
|
displayName: "气泡红包3"
|
|
|
}) ], e.prototype, "btn_getRed3", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Button,
|
|
|
displayName: "开始游戏"
|
|
|
}) ], e.prototype, "btn_start", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Node,
|
|
|
displayName: "红包币图标"
|
|
|
}) ], e.prototype, "icon_hb", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Node,
|
|
|
displayName: "金猪币图标"
|
|
|
}) ], e.prototype, "icon_zb", void 0);
|
|
|
-r([ u({
|
|
|
+r([ d({
|
|
|
type: cc.Node,
|
|
|
displayName: "顶部ui组"
|
|
|
}) ], e.prototype, "node_top_ui", void 0);
|
|
|
-return r([ l ], e);
|
|
|
+return r([ p ], e);
|
|
|
}(cc.Component);
|
|
|
-n.default = p;
|
|
|
+n.default = h;
|
|
|
cc._RF.pop();
|
|
|
}, {
|
|
|
"../../mk/system/JsbSystem": "JsbSystem",
|
|
|
@@ -9224,7 +9357,7 @@ return t;
|
|
|
};
|
|
|
t.getWxAppId = function() {
|
|
|
var t = "";
|
|
|
-cc.sys.os == cc.sys.OS_ANDROID ? t = this.callStaticMethod(this._JSB_ANDROID_PATH, "getWXAppId", "()Ljava/lang/String;") : cc.sys.os == cc.sys.OS_IOS && (t = this.callStaticMethod("CsjAdReward", "getWXAppId", ""));
|
|
|
+cc.sys.os == cc.sys.OS_ANDROID ? t = this.callStaticMethod(this._JSB_ANDROID_PATH, "getWxAppId", "()Ljava/lang/String;") : cc.sys.os == cc.sys.OS_IOS && (t = this.callStaticMethod("CsjAdReward", "getWxAppId", ""));
|
|
|
return t;
|
|
|
};
|
|
|
t.getAdvertisingChannel = function() {
|
|
|
@@ -9289,11 +9422,9 @@ t.WxAuth = function() {
|
|
|
cc.sys.os == cc.sys.OS_ANDROID ? this.callStaticMethod(this._JSB_ANDROID_PATH, "WxAuth", "()V") : cc.sys.os == cc.sys.OS_IOS && this.callStaticMethod("AppController", "WxAuth", "");
|
|
|
};
|
|
|
t.onGetWxAccessCode = function(t) {
|
|
|
-gData.loginData.sessionKey = "";
|
|
|
-gData.loginData.uin = "";
|
|
|
gData.wechatData.code = t;
|
|
|
console.log("=== gData.wechatData.code", gData.wechatData.code);
|
|
|
-gData.loginData.login();
|
|
|
+gData.loginData.wxLogin();
|
|
|
};
|
|
|
t.OpenMiniGame = function() {
|
|
|
cc.sys.os == cc.sys.OS_ANDROID ? this.callStaticMethod(this._JSB_ANDROID_PATH, "OpenMiniGame", "()V") : cc.sys.os == cc.sys.OS_IOS && this.callStaticMethod("AppController", "WxAuth", "");
|
|
|
@@ -9677,6 +9808,7 @@ function t() {
|
|
|
this.loadResCompelete = !1;
|
|
|
this.isLogin = !1;
|
|
|
this.sessionKey = "";
|
|
|
+this.randomKey = "abcdefghijklopqrstuvwxyzabcdefgh";
|
|
|
this.uin = "";
|
|
|
this.tempUin = "";
|
|
|
this.loginTicket = "";
|
|
|
@@ -9706,139 +9838,172 @@ return [ 2 ];
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
+t.prototype.init = function() {
|
|
|
+var t = mk.storage.getStorage(r.StorageKey.uin);
|
|
|
+this.uin = t || "";
|
|
|
+var e = mk.storage.getStorage(r.StorageKey.sessionKey);
|
|
|
+this.sessionKey = e || "";
|
|
|
+};
|
|
|
t.prototype.login = function() {
|
|
|
return o(this, void 0, void 0, function() {
|
|
|
-var t, e, n, o, a;
|
|
|
-return i(this, function(i) {
|
|
|
-switch (i.label) {
|
|
|
-case 0:
|
|
|
-mk.pool.init(gData.gameData.pools);
|
|
|
-gData.appData.init();
|
|
|
-gData.adData.init();
|
|
|
-cc.sys.os == cc.sys.OS_ANDROID ? mk.ad.ifShowAd = !0 : mk.ad.ifShowAd = !1;
|
|
|
+return i(this, function() {
|
|
|
if ("" != this.sessionKey && "" != this.uin) {
|
|
|
console.log("=== login 有登录记录直接跳转到登录流程最后一步");
|
|
|
this.getAccountInfo();
|
|
|
return [ 2 ];
|
|
|
}
|
|
|
console.log("=== login 无登录记录");
|
|
|
-t = mk.encrypt.randomString();
|
|
|
-e = {
|
|
|
+this.connect();
|
|
|
+return [ 2 ];
|
|
|
+});
|
|
|
+});
|
|
|
+};
|
|
|
+t.prototype.connect = function() {
|
|
|
+return o(this, void 0, void 0, function() {
|
|
|
+var t, e;
|
|
|
+return i(this, function(n) {
|
|
|
+switch (n.label) {
|
|
|
+case 0:
|
|
|
+this.randomKey = mk.encrypt.randomString();
|
|
|
+t = {
|
|
|
mac: gData.appData.mac,
|
|
|
-psk: t,
|
|
|
+psk: this.randomKey,
|
|
|
appId: gData.appData.appId
|
|
|
};
|
|
|
-return [ 4, mk.http.sendRequest("connectTest", "POST", JSON.stringify(e)) ];
|
|
|
+return [ 4, mk.http.sendRequest("connectTest", "POST", JSON.stringify(t)) ];
|
|
|
|
|
|
case 1:
|
|
|
-if (0 != (n = i.sent()).errcode) return [ 2 ];
|
|
|
-e = mk.encrypt.decrypt(n.encrypt, t, gData.appData.appId);
|
|
|
-this.tempUin = JSON.parse(e).tmp_uin;
|
|
|
+if (0 != (e = n.sent()).errcode) return [ 2 ];
|
|
|
+t = mk.encrypt.decrypt(e.encrypt, this.randomKey, gData.appData.appId);
|
|
|
+console.log("[FC]connectTest decryptData", t);
|
|
|
+this.tempUin = JSON.parse(t).tmp_uin;
|
|
|
+mk.storage.setStorage(r.StorageKey.uin, this.tempUin);
|
|
|
+this.wxLogin();
|
|
|
+return [ 2 ];
|
|
|
+}
|
|
|
+});
|
|
|
+});
|
|
|
+};
|
|
|
+t.prototype.wxLogin = function() {
|
|
|
+return o(this, void 0, void 0, function() {
|
|
|
+var t, e, n;
|
|
|
+return i(this, function(o) {
|
|
|
+switch (o.label) {
|
|
|
+case 0:
|
|
|
if (null != gData.wechatData.code) {
|
|
|
-o = mk.encrypt.encrypt(JSON.stringify({
|
|
|
+e = mk.encrypt.encrypt(JSON.stringify({
|
|
|
code: gData.wechatData.code
|
|
|
}), this.sessionKey, gData.appData.appId);
|
|
|
-e = {
|
|
|
+t = {
|
|
|
uin: this.uin,
|
|
|
-encrypt: o
|
|
|
+encrypt: e
|
|
|
};
|
|
|
} else {
|
|
|
-o = mk.encrypt.encrypt(JSON.stringify({
|
|
|
+e = mk.encrypt.encrypt(JSON.stringify({
|
|
|
code: ""
|
|
|
-}), t, gData.appData.appId);
|
|
|
-e = {
|
|
|
+}), this.randomKey, gData.appData.appId);
|
|
|
+t = {
|
|
|
uin: this.tempUin,
|
|
|
-encrypt: o
|
|
|
+encrypt: e
|
|
|
};
|
|
|
}
|
|
|
-return [ 4, mk.http.sendRequest("wxlogin", "POST", JSON.stringify(e), !1, !1) ];
|
|
|
+return [ 4, mk.http.sendRequest("wxlogin", "POST", JSON.stringify(t), !1, !1) ];
|
|
|
|
|
|
-case 2:
|
|
|
-if (0 != (n = i.sent()).errcode) {
|
|
|
+case 1:
|
|
|
+if (0 != (n = o.sent()).errcode) {
|
|
|
-10003 != n.errcode && -20003 != n.errcode || this.reload();
|
|
|
return [ 2 ];
|
|
|
}
|
|
|
-e = null != gData.wechatData.code ? mk.encrypt.decrypt(n.encrypt, this.sessionKey, gData.appData.appId) : mk.encrypt.decrypt(n.encrypt, t, gData.appData.appId);
|
|
|
-e = JSON.parse(e);
|
|
|
-this.loginTicket = e.login_ticket;
|
|
|
+t = null != gData.wechatData.code ? mk.encrypt.decrypt(n.encrypt, this.sessionKey, gData.appData.appId) : mk.encrypt.decrypt(n.encrypt, this.randomKey, gData.appData.appId);
|
|
|
+t = JSON.parse(t);
|
|
|
+this.loginTicket = t.login_ticket;
|
|
|
+console.log("[FC]wxLoginTest decrypt", t);
|
|
|
mk.storage.setStorage(r.StorageKey.loginTicket, this.loginTicket);
|
|
|
-if (null == mk.storage.getStorage("isFirstIn")) {
|
|
|
+if (null == mk.storage.getStorage(r.StorageKey.isFirstIn)) {
|
|
|
this.isFirstIn = !0;
|
|
|
mk.storage.setStorage(r.StorageKey.isFirstIn, 1);
|
|
|
}
|
|
|
-if (this.uin != e.uin) {
|
|
|
-this.uin = e.uin;
|
|
|
+if (this.uin != t.uin) {
|
|
|
+this.uin = t.uin;
|
|
|
this.isNew = !1;
|
|
|
} else this.isNew = !0;
|
|
|
-mk.console.log("uin:", this.uin);
|
|
|
mk.storage.setStorage(r.StorageKey.uin, this.uin);
|
|
|
-console.log("uin ", this.uin);
|
|
|
-console.log("tempUin ", this.tempUin);
|
|
|
-a = "";
|
|
|
-a = null != gData.wechatData.code ? this.sessionKey : mk.encrypt.randomString();
|
|
|
+this.checkLogin();
|
|
|
+return [ 2 ];
|
|
|
+}
|
|
|
+});
|
|
|
+});
|
|
|
+};
|
|
|
+t.prototype.checkLogin = function() {
|
|
|
+return o(this, void 0, void 0, function() {
|
|
|
+var t, e, n, o, a;
|
|
|
+return i(this, function(i) {
|
|
|
+switch (i.label) {
|
|
|
+case 0:
|
|
|
+t = "";
|
|
|
+t = null != gData.wechatData.code ? this.sessionKey : mk.encrypt.randomString();
|
|
|
e = {
|
|
|
-tmp_key: a,
|
|
|
+tmp_key: t,
|
|
|
uin: this.uin,
|
|
|
login_ticket: this.loginTicket,
|
|
|
appId: gData.appData.appId
|
|
|
};
|
|
|
return [ 4, mk.http.sendRequest("checklogin", "POST", JSON.stringify(e)) ];
|
|
|
|
|
|
-case 3:
|
|
|
+case 1:
|
|
|
if (0 != (n = i.sent()).errcode) return [ 2 ];
|
|
|
-e = null != gData.wechatData.code ? mk.encrypt.decrypt(n.encrypt, this.sessionKey, gData.appData.appId) : mk.encrypt.decrypt(n.encrypt, a, gData.appData.appId);
|
|
|
-e = JSON.parse(e);
|
|
|
-this.sessionKey = e.session_key;
|
|
|
-mk.storage.setStorage("sessionKey", this.sessionKey);
|
|
|
-if (null != gData.wechatData.code) if (this.isNew) this.getAccountInfo(); else {
|
|
|
-this.isNew = !1;
|
|
|
-gData.wechatData.code = null;
|
|
|
-this.reload();
|
|
|
-} else this.getAccountInfo();
|
|
|
+o = null != gData.wechatData.code ? mk.encrypt.decrypt(n.encrypt, this.sessionKey, gData.appData.appId) : mk.encrypt.decrypt(n.encrypt, t, gData.appData.appId);
|
|
|
+a = JSON.parse(o);
|
|
|
+this.sessionKey = a.session_key;
|
|
|
+console.log("[FC]checkLogin decrypt", a);
|
|
|
+mk.storage.setStorage(r.StorageKey.sessionKey, this.sessionKey);
|
|
|
+this.getUserInfo();
|
|
|
return [ 2 ];
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
+t.prototype.getUserInfo = function() {
|
|
|
+return o(this, void 0, void 0, function() {
|
|
|
+return i(this, function() {
|
|
|
+this.getAccountInfo();
|
|
|
+return [ 2 ];
|
|
|
+});
|
|
|
+});
|
|
|
+};
|
|
|
t.prototype.getAccountInfo = function() {
|
|
|
return o(this, void 0, void 0, function() {
|
|
|
-var t, e, n, o;
|
|
|
-return i(this, function(i) {
|
|
|
-switch (i.label) {
|
|
|
+var t, e, n;
|
|
|
+return i(this, function(o) {
|
|
|
+switch (o.label) {
|
|
|
case 0:
|
|
|
-if (!(t = mk.storage.getStorage(r.StorageKey.nickname))) return [ 3, 1 ];
|
|
|
-gData.wechatData.nickName = t;
|
|
|
-return [ 3, 3 ];
|
|
|
-
|
|
|
-case 1:
|
|
|
-e = {
|
|
|
+t = {
|
|
|
uin: this.uin,
|
|
|
login_ticket: this.loginTicket
|
|
|
};
|
|
|
-n = {
|
|
|
+e = {
|
|
|
uin: this.uin,
|
|
|
-encrypt: mk.encrypt.encrypt(JSON.stringify(e), this.sessionKey, gData.appData.appId)
|
|
|
+encrypt: mk.encrypt.encrypt(JSON.stringify(t), this.sessionKey, gData.appData.appId)
|
|
|
};
|
|
|
-return [ 4, mk.http.sendRequest("user", "POST", JSON.stringify(n), !1, !1) ];
|
|
|
+return [ 4, mk.http.sendRequest("user", "POST", JSON.stringify(e), !1, !1) ];
|
|
|
|
|
|
-case 2:
|
|
|
-if (0 != (o = i.sent()).errcode) {
|
|
|
--10003 != o.errcode && -20003 != o.errcode || this.reload();
|
|
|
+case 1:
|
|
|
+if (0 != (n = o.sent()).errcode) {
|
|
|
+-10003 != n.errcode && -20003 != n.errcode || this.reload();
|
|
|
return [ 2 ];
|
|
|
}
|
|
|
-o = mk.http.checkData(o, !0);
|
|
|
-n = o.data;
|
|
|
-this.isAuth = n.is_auth;
|
|
|
+n = mk.http.checkData(n, !0);
|
|
|
+e = n.data;
|
|
|
+mk.console.logSingle("[FC] getAccountInfo decrypt", e);
|
|
|
+this.isAuth = e.is_auth;
|
|
|
if (this.isAuth) {
|
|
|
-gData.wechatData.nickName = n.nickname;
|
|
|
-gData.wechatData.avatar = n.headimgurl;
|
|
|
+gData.wechatData.nickName = e.nickname;
|
|
|
+gData.wechatData.avatar = e.headimgurl;
|
|
|
+gData.gameData.init_head = !0;
|
|
|
mk.storage.setStorage(r.StorageKey.isAuth, 1);
|
|
|
mk.storage.setStorage(r.StorageKey.nickname, gData.wechatData.nickName, !1);
|
|
|
mk.storage.setStorage(r.StorageKey.avatar, gData.wechatData.avatar, !1);
|
|
|
}
|
|
|
-i.label = 3;
|
|
|
-
|
|
|
-case 3:
|
|
|
gData.gameData.init();
|
|
|
return [ 2 ];
|
|
|
}
|
|
|
@@ -9899,6 +10064,7 @@ e.prototype.onLoad = function() {
|
|
|
this.setProgress(0);
|
|
|
};
|
|
|
e.prototype.start = function() {
|
|
|
+a.default.getWxAppId() && (gData.appData.appId = a.default.getWxAppId());
|
|
|
a.default.getDeviceInfo();
|
|
|
};
|
|
|
e.prototype.setProgress = function(t) {
|
|
|
@@ -9912,7 +10078,7 @@ this.setProgress(this.process);
|
|
|
}
|
|
|
if (gData.loginData.loadResCompelete) {
|
|
|
if (gData.appData.getDeviceInfoCompelete) {
|
|
|
-gData.loginData.login();
|
|
|
+this.login();
|
|
|
gData.appData.getDeviceInfoCompelete = !1;
|
|
|
} else if (gData.gameData.dataFinish) {
|
|
|
mk.storage.getStorage("notShowAgreementTip") ? mk.ui.openPanel("game/prefab/game") : mk.ui.openPanel("module/agreementTip/agreementTip");
|
|
|
@@ -9920,6 +10086,14 @@ gData.gameData.dataFinish = !1;
|
|
|
}
|
|
|
} else gData.loginData.loadLocalRes();
|
|
|
};
|
|
|
+e.prototype.login = function() {
|
|
|
+mk.pool.init(gData.gameData.pools);
|
|
|
+gData.appData.init();
|
|
|
+gData.adData.init();
|
|
|
+gData.loginData.init();
|
|
|
+console.log("[FC] gData.appData.appId", gData.appData.appId);
|
|
|
+gData.loginData.login();
|
|
|
+};
|
|
|
r([ u(c.default) ], e.prototype, "bar", void 0);
|
|
|
r([ u({
|
|
|
displayName: "加载文字",
|
|
|
@@ -15391,11 +15565,13 @@ return [ 4, mk.loader.load(e, cc.SpriteFrame) ];
|
|
|
|
|
|
case 2:
|
|
|
o.spriteFrame = r.sent();
|
|
|
-return [ 4, mk.loader.loadRemote(gData.wechatData.avatar, null) ];
|
|
|
+console.log("=== gData.wechatData.avatar", gData.wechatData.avatar);
|
|
|
+return [ 4, mk.loader.loadRemote(gData.wechatData.avatar + "?aaa=aa.jpg", null) ];
|
|
|
|
|
|
case 3:
|
|
|
i = r.sent();
|
|
|
-console.log("loadHead:", i);
|
|
|
+this.img_head.spriteFrame = new cc.SpriteFrame(i);
|
|
|
+console.log("=== loadHead:", i);
|
|
|
return [ 2 ];
|
|
|
}
|
|
|
});
|
|
|
@@ -15446,8 +15622,10 @@ return [ 2 ];
|
|
|
};
|
|
|
e.prototype.clickUpdate = function() {};
|
|
|
e.prototype.onClickWxAuth = function() {
|
|
|
+if (!gData.loginData.isAuth) {
|
|
|
mk.ui.closePanel(this.node.name);
|
|
|
s.default.WxAuth();
|
|
|
+}
|
|
|
};
|
|
|
e.prototype.clickRule = function(t) {
|
|
|
return a(this, void 0, void 0, function() {
|