对于跳转的,使用跳转参数中的isoffice来确定是访问正式服还是测试服的数据
This commit is contained in:
parent
6701261cbb
commit
9f64cad51b
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"description": "游戏电商小程序",
|
"description": "游戏电商小程序",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false,
|
"urlCheck": true,
|
||||||
"es6": false,
|
"es6": false,
|
||||||
"postcss": false,
|
"postcss": false,
|
||||||
"minified": false,
|
"minified": false,
|
||||||
|
16
src/app.wpy
16
src/app.wpy
@ -21,6 +21,8 @@
|
|||||||
import wepy from 'wepy'
|
import wepy from 'wepy'
|
||||||
import 'wepy-async-function'
|
import 'wepy-async-function'
|
||||||
import jcEvent from './common/jc-event';
|
import jcEvent from './common/jc-event';
|
||||||
|
import global from './common/global';
|
||||||
|
var g = require('./common/global').default;
|
||||||
|
|
||||||
let sdkManage = require('./jcfw/SDKManage');
|
let sdkManage = require('./jcfw/SDKManage');
|
||||||
|
|
||||||
@ -53,11 +55,6 @@ export default class extends wepy.app {
|
|||||||
super()
|
super()
|
||||||
this.use('requestfix');
|
this.use('requestfix');
|
||||||
this.use('promisify');
|
this.use('promisify');
|
||||||
sdkManage.init();
|
|
||||||
sdkManage.Login(() => {
|
|
||||||
jcEvent.emit(jcEvent.events.LOGIN_FINISHED, {});
|
|
||||||
console.log('finish parse jcfw');
|
|
||||||
});
|
|
||||||
//全局拦截器
|
//全局拦截器
|
||||||
this.intercept('request', {
|
this.intercept('request', {
|
||||||
config(p) {
|
config(p) {
|
||||||
@ -92,6 +89,7 @@ export default class extends wepy.app {
|
|||||||
onShow(options) {
|
onShow(options) {
|
||||||
console.log('app.onShow');
|
console.log('app.onShow');
|
||||||
console.log(options);
|
console.log(options);
|
||||||
|
let isoffical = g.env === 'product';
|
||||||
if (options.scene === 1037 || options.scene === 1038) {
|
if (options.scene === 1037 || options.scene === 1038) {
|
||||||
let params = options.query;
|
let params = options.query;
|
||||||
this.globalData.gameToken = params.token;
|
this.globalData.gameToken = params.token;
|
||||||
@ -100,8 +98,16 @@ export default class extends wepy.app {
|
|||||||
let referrerInfo = options.referrerInfo;
|
let referrerInfo = options.referrerInfo;
|
||||||
this.globalData.fromAppId = referrerInfo.appId;
|
this.globalData.fromAppId = referrerInfo.appId;
|
||||||
this.globalData.extraData = referrerInfo.extraData;
|
this.globalData.extraData = referrerInfo.extraData;
|
||||||
|
isoffical = referrerInfo.extraData.isoffical
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sdkManage.isoffical = isoffical;
|
||||||
|
g.env = isoffical ? 'product' : 'test';
|
||||||
|
sdkManage.init();
|
||||||
|
sdkManage.Login(() => {
|
||||||
|
jcEvent.emit(jcEvent.events.LOGIN_FINISHED, {});
|
||||||
|
console.log('finish parse jcfw');
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user