Authored by 李奇
Committed by 李奇

yas上报、公共参数设定

@@ -152,7 +152,6 @@ class App extends Component { @@ -152,7 +152,6 @@ class App extends Component {
152 Taro.setStorage({ key: 'unionid', data: '' }); 152 Taro.setStorage({ key: 'unionid', data: '' });
153 Taro.setStorage({ key: 'user_union_type', data: '' }); 153 Taro.setStorage({ key: 'user_union_type', data: '' });
154 } 154 }
155 - console.log(result);  
156 }).catch(error => { 155 }).catch(error => {
157 console.log(error); 156 console.log(error);
158 }); 157 });
@@ -243,7 +242,6 @@ class App extends Component { @@ -243,7 +242,6 @@ class App extends Component {
243 }); 242 });
244 } 243 }
245 } 244 }
246 - console.log(result);  
247 }).catch(error => { 245 }).catch(error => {
248 let userInfo = Taro.getStorageSync('userInfo'); 246 let userInfo = Taro.getStorageSync('userInfo');
249 if (userInfo && userInfo.uid && userInfo.session_key) { 247 if (userInfo && userInfo.uid && userInfo.session_key) {
@@ -263,7 +263,6 @@ const _reportData = async (reportType, pt, pn, param, appObject) => { @@ -263,7 +263,6 @@ const _reportData = async (reportType, pt, pn, param, appObject) => {
263 device, 263 device,
264 sid: sid 264 sid: sid
265 } 265 }
266 - console.log(report_params);  
267 return report_params 266 return report_params
268 }; 267 };
269 268
@@ -2,7 +2,6 @@ import api from '../utils/api'; @@ -2,7 +2,6 @@ import api from '../utils/api';
2 2
3 export default { 3 export default {
4 resource(code) { 4 resource(code) {
5 - console.log(code);  
6 return api.get({ 5 return api.get({
7 url: '/resources', 6 url: '/resources',
8 data: { 7 data: {
@@ -68,7 +68,6 @@ export default class Index extends Component { @@ -68,7 +68,6 @@ export default class Index extends Component {
68 async getResource() { 68 async getResource() {
69 const pk = await getPrivateKey(); 69 const pk = await getPrivateKey();
70 Taro.setStorage({ key: 'verifyKey', data: pk }); 70 Taro.setStorage({ key: 'verifyKey', data: pk });
71 - console.log(contentCode.index);  
72 return commonModel.resource(contentCode.index).then(res => { 71 return commonModel.resource(contentCode.index).then(res => {
73 if (res && res.code === 200) { 72 if (res && res.code === 200) {
74 this.setState({ 73 this.setState({
@@ -339,7 +339,6 @@ export default class Login extends Component { @@ -339,7 +339,6 @@ export default class Login extends Component {
339 render () { 339 render () {
340 let { tipText, verifyBtnText, countryArea, graphicsCodeElement, graphicsCodeSwitch, graphicsCodeUrl, hasUnionID, is_bind } = this.state; 340 let { tipText, verifyBtnText, countryArea, graphicsCodeElement, graphicsCodeSwitch, graphicsCodeUrl, hasUnionID, is_bind } = this.state;
341 let showBind = wx.getStorageSync('show_bind'); 341 let showBind = wx.getStorageSync('show_bind');
342 - console.log(hasUnionID);  
343 342
344 return ( 343 return (
345 <View className="login-page"> 344 <View className="login-page">
@@ -43,15 +43,11 @@ export default class yas { @@ -43,15 +43,11 @@ export default class yas {
43 uploadData(params) { 43 uploadData(params) {
44 let sid = ''; 44 let sid = '';
45 let globalData = getGlobalData(); 45 let globalData = getGlobalData();
  46 +
46 if (this.app && this.app.globalData) { 47 if (this.app && this.app.globalData) {
47 sid = globalData.sid || ''; 48 sid = globalData.sid || '';
48 } 49 }
49 50
50 - // 开发环境不上报  
51 - if (this.devEnv) {  
52 - return console.log(params);  
53 - }  
54 -  
55 return Taro.request({ 51 return Taro.request({
56 url: config.domains.yasHost, 52 url: config.domains.yasHost,
57 data: { _mlogs: JSON.stringify(params) }, 53 data: { _mlogs: JSON.stringify(params) },
@@ -117,12 +113,16 @@ export default class yas { @@ -117,12 +113,16 @@ export default class yas {
117 } 113 }
118 }, 114 },
119 complete() { 115 complete() {
120 - self.app.globalData = self.app.globalData || {}; 116 + let globalData = getGlobalData();
  117 + let userData = globalData.userInfo || {};
  118 +
  119 + if (!Object.keys(userData).length) {
  120 + userData = Taro.getStorageSync('userInfo') || {};
  121 + }
121 122
122 - let ch = self.app.globalData.ch || '';  
123 - let uid = self.app.globalData.userInfo && self.app.globalData.userInfo.uid || ''; 123 + let ch = globalData.ch || '';
  124 + let uid = userData.uid || '';
124 125
125 - // ch = self.app.getUnion_type() || ch;  
126 self.deviceInfo.ch = ch; 126 self.deviceInfo.ch = ch;
127 return resolve(self.uploadData({ 127 return resolve(self.uploadData({
128 status: statusInfo, 128 status: statusInfo,
@@ -132,7 +132,7 @@ export default class yas { @@ -132,7 +132,7 @@ export default class yas {
132 ts: new Date().getTime(), 132 ts: new Date().getTime(),
133 op: event, 133 op: event,
134 uid: uid, 134 uid: uid,
135 - sid: self.app.globalData.sid || '' 135 + sid: globalData.sid || ''
136 }] 136 }]
137 })); 137 }));
138 } 138 }