Authored by 李奇
Committed by 李奇

yas上报、公共参数设定

... ... @@ -152,7 +152,6 @@ class App extends Component {
Taro.setStorage({ key: 'unionid', data: '' });
Taro.setStorage({ key: 'user_union_type', data: '' });
}
console.log(result);
}).catch(error => {
console.log(error);
});
... ... @@ -243,7 +242,6 @@ class App extends Component {
});
}
}
console.log(result);
}).catch(error => {
let userInfo = Taro.getStorageSync('userInfo');
if (userInfo && userInfo.uid && userInfo.session_key) {
... ...
... ... @@ -263,7 +263,6 @@ const _reportData = async (reportType, pt, pn, param, appObject) => {
device,
sid: sid
}
console.log(report_params);
return report_params
};
... ...
... ... @@ -2,7 +2,6 @@ import api from '../utils/api';
export default {
resource(code) {
console.log(code);
return api.get({
url: '/resources',
data: {
... ...
... ... @@ -68,7 +68,6 @@ export default class Index extends Component {
async getResource() {
const pk = await getPrivateKey();
Taro.setStorage({ key: 'verifyKey', data: pk });
console.log(contentCode.index);
return commonModel.resource(contentCode.index).then(res => {
if (res && res.code === 200) {
this.setState({
... ...
... ... @@ -339,7 +339,6 @@ export default class Login extends Component {
render () {
let { tipText, verifyBtnText, countryArea, graphicsCodeElement, graphicsCodeSwitch, graphicsCodeUrl, hasUnionID, is_bind } = this.state;
let showBind = wx.getStorageSync('show_bind');
console.log(hasUnionID);
return (
<View className="login-page">
... ...
... ... @@ -43,15 +43,11 @@ export default class yas {
uploadData(params) {
let sid = '';
let globalData = getGlobalData();
if (this.app && this.app.globalData) {
sid = globalData.sid || '';
}
// 开发环境不上报
if (this.devEnv) {
return console.log(params);
}
return Taro.request({
url: config.domains.yasHost,
data: { _mlogs: JSON.stringify(params) },
... ... @@ -117,12 +113,16 @@ export default class yas {
}
},
complete() {
self.app.globalData = self.app.globalData || {};
let globalData = getGlobalData();
let userData = globalData.userInfo || {};
if (!Object.keys(userData).length) {
userData = Taro.getStorageSync('userInfo') || {};
}
let ch = self.app.globalData.ch || '';
let uid = self.app.globalData.userInfo && self.app.globalData.userInfo.uid || '';
let ch = globalData.ch || '';
let uid = userData.uid || '';
// ch = self.app.getUnion_type() || ch;
self.deviceInfo.ch = ch;
return resolve(self.uploadData({
status: statusInfo,
... ... @@ -132,7 +132,7 @@ export default class yas {
ts: new Date().getTime(),
op: event,
uid: uid,
sid: self.app.globalData.sid || ''
sid: globalData.sid || ''
}]
}));
}
... ...