Authored by 李奇

开关请求添加

... ... @@ -4,6 +4,7 @@
// export const ACTIVITY_HOST = 'https://action.yoho.cn';
// export const APP_REPORT_HOST = 'https://app.yoho.cn/collect/v3';
// export const LOG_EVENT_HOST = 'https://analysis.yohobuy.com/yas_mobile';
// export const ICONFIG_HOST = 'https://iconfig.yoho.cn/lb/v3';
// 测试环境
export const API_HOST = 'http://api-test3.dev.yohocorp.com';
... ... @@ -11,6 +12,7 @@ export const SERVICE_HOST = 'http://api-test3.dev.yohocorp.com';
export const ACTIVITY_HOST = 'http://yoho-activity-platform.test3.ingress.dev.yohocorp.com';
export const APP_REPORT_HOST = 'http://app.yoho.cn/collect/v3';
export const LOG_EVENT_HOST = 'https://analysis.yohobuy.com/yas_mobile';
export const ICONFIG_HOST = 'http://iconfig.yoho.cn/lb/v3';
export const MINI_APP_TYPE = 29;
export const MINI_QR_TYPE = 16;
... ...
import Promise from '../vendors/es6-promise';
import {APP_VERSION, ICONFIG_HOST} from '../libs/config';
import {encrypt, decrypt} from '../utils/icfg-aes';
import {stringify} from '../vendors/query-string';
let iconfSwitch = function (app) {
let data = {};
let device = app.globalData.systemInfo;
data.app_ver = APP_VERSION;
data.uid = app.getUid() || '';
data.os = device.platform.indexOf('ios') > -1 ? 0 : 1;
data.osv = device.osv || device.version;
data.model = device.model;
data.udid = app.globalData.udid ? app.globalData.udid : '';
data.patchv = '';
data.ci = (app.getUnion_type() ? app.getUnion_type() : app.globalData.ch) || '';
return new Promise(function (resolve, reject) {
wx.request({
url: `${ICONFIG_HOST}?${encrypt(stringify(data))}`,
success({data} = {}) {
resolve(JSON.parse(decrypt(data)));
},
fail(err) {
reject(err);
}
});
})
};
export default iconfSwitch;
\ No newline at end of file
... ...