// Learn cc.Class: // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html // Learn Attribute: // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html if (CC_WECHATGAME) { window.Global = { //Urls loginUrl: 'https://api-touhu.duowan.com/auth/loginByGame.do', userReport: 'https://api-touhu.duowan.com/user/report.do', totalRank: 'https://api-touhu.duowan.com/user/getAllRank.do', //SystemInfo ver: 100, os: 1, channel: "wexin", //userInfo user: null, // user = { // token:data.token, // uid:user.id, // openId:user.openId, // nick:userInfo.nickName, // avatarUrl:userInfo.avatarUrl, // gender:userInfo.gender, // gold:user.coin, // score:user.score, // revivedCount:0 // }; showLoginPage: true }; // wx.onShow(res => { // wx.checkSession({ // success: function () { // //session_key 未过期,并且在本生命周期一直有效 // }, // fail: function () { // // session_key 已经失效,需要重新执行登录流程 // Global.showLoginPage = true; // cc.director.loadScene("GameScene"); // } // }) // }); }