Authored by yyq

添加设备型号

@@ -163,6 +163,17 @@ const xianyu = { @@ -163,6 +163,17 @@ const xianyu = {
163 errorAction && errorAction(error); 163 errorAction && errorAction(error);
164 }); 164 });
165 } 165 }
  166 + },
  167 + getClientInfo(okAction, errorAction) {
  168 + if (this.isAliApp && window.WindVane) {
  169 + window.WindVane.call('WVNativeDetector', 'getModelInfo', {}, data => {
  170 + okAction && okAction(data);
  171 + }, error => {
  172 + errorAction && errorAction(error);
  173 + });
  174 + } else {
  175 + errorAction && errorAction();
  176 + }
166 } 177 }
167 }; 178 };
168 179
@@ -78,6 +78,7 @@ Vue.use(ChangeBidPriceDialog); @@ -78,6 +78,7 @@ Vue.use(ChangeBidPriceDialog);
78 initClient(store); 78 initClient(store);
79 initBaseLogs(); 79 initBaseLogs();
80 80
  81 +store.$xianyu = xianyu;
81 xianyu.$router = router; 82 xianyu.$router = router;
82 yoho.auth = async(args) => { 83 yoho.auth = async(args) => {
83 let { 84 let {
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