1
|
import * as Types from './types';
|
1
|
import * as Types from './types';
|
2
|
import cookie from 'yoho-cookie';
|
2
|
import cookie from 'yoho-cookie';
|
3
|
-import { merge } from 'lodash';
|
3
|
+import { get, set, merge } from 'lodash';
|
4
|
|
4
|
|
5
|
export default function(mergeState = {}) {
|
5
|
export default function(mergeState = {}) {
|
6
|
return {
|
6
|
return {
|
|
@@ -201,12 +201,38 @@ export default function(mergeState = {}) { |
|
@@ -201,12 +201,38 @@ export default function(mergeState = {}) { |
201
|
{
|
201
|
{
|
202
|
params: { appop, param },
|
202
|
params: { appop, param },
|
203
|
asyncindx = false,
|
203
|
asyncindx = false,
|
|
|
204
|
+ retry = false
|
204
|
},
|
205
|
},
|
205
|
) {
|
206
|
) {
|
|
|
207
|
+
|
206
|
try {
|
208
|
try {
|
207
|
// console.log(appop)
|
209
|
// console.log(appop)
|
208
|
// console.log(param)
|
210
|
// console.log(param)
|
209
|
setTimeout(() => {
|
211
|
setTimeout(() => {
|
|
|
212
|
+ // 获取设备信息
|
|
|
213
|
+ if (!retry && !get(window, 'appBaseLogs.device.dm') && this.$xianyu.getClientInfo) {
|
|
|
214
|
+ this.$xianyu.getClientInfo(info => {
|
|
|
215
|
+ info = info || {}
|
|
|
216
|
+ set(window, 'appBaseLogs.device.dm', info.platformName ? info.platformName : `${info.brand} ${info.model}`);
|
|
|
217
|
+
|
|
|
218
|
+ this.dispatch('reportYas', {
|
|
|
219
|
+ params: { appop, param },
|
|
|
220
|
+ asyncindx,
|
|
|
221
|
+ retry: true
|
|
|
222
|
+ });
|
|
|
223
|
+ }, (error) => {
|
|
|
224
|
+ error && set(window, 'appBaseLogs.device.dm', 'unknown');
|
|
|
225
|
+
|
|
|
226
|
+ this.dispatch('reportYas', {
|
|
|
227
|
+ params: { appop, param },
|
|
|
228
|
+ asyncindx,
|
|
|
229
|
+ retry: true
|
|
|
230
|
+ });
|
|
|
231
|
+ });
|
|
|
232
|
+
|
|
|
233
|
+ return;
|
|
|
234
|
+ }
|
|
|
235
|
+
|
210
|
if (window._yas && window._yas.sendAppLogs) {
|
236
|
if (window._yas && window._yas.sendAppLogs) {
|
211
|
param = param || {};
|
237
|
param = param || {};
|
212
|
|
238
|
|