xcx 4 vuotta sitten
vanhempi
commit
a4cddcad17
1 muutettua tiedostoa jossa 9 lisäystä ja 5 poistoa
  1. 9
    5
      src/app.js

+ 9
- 5
src/app.js Näytä tiedosto

@@ -1,7 +1,7 @@
1 1
 import React, { Component } from 'react'
2 2
 import Taro, { getCurrentInstance } from '@tarojs/taro'
3 3
 import { StoreRoot, store } from './store'
4
-import { deepCopy } from './utils'
4
+// import { deepCopy } from './utils'
5 5
 import request, { apis } from './utils/request'
6 6
 import { trackUserSource } from './utils/track'
7 7
 import * as log from './utils/rtLog'
@@ -10,12 +10,16 @@ import './app.less'
10 10
 class App extends Component {
11 11
   updateTracing;
12 12
 
13
-  onLaunch (options) {
13
+  onLaunch () {
14
+
15
+    Taro.setEnableDebug({
16
+      enableDebug: true
17
+    })
14 18
     // 此处获取不到 state, 因为 app 不会刷新
15 19
     const { setSysInfo } = store.getModel('sys').getState()
16 20
 
17 21
     // 预拉取数据
18
-    wx.getBackgroundFetchData({
22
+    Taro.getBackgroundFetchData({
19 23
       fetchType: 'pre',
20 24
       success (res) {
21 25
         if (res.errMsg === 'getBackgroundFetchData:ok') {
@@ -44,14 +48,14 @@ class App extends Component {
44 48
     // scene 与其它参数时互斥的. 有 scene 说明时扫码进来的
45 49
     const params = router.params || {}
46 50
     const { from = '', recommender = '', scene = '', mpOpenId = '' } = params
47
-    setAppParams({...params})
51
+    setAppParams({ ...params })
48 52
 
49 53
     // 登录
50 54
     Taro.login({
51 55
       success: res => {
52 56
         if (res.errMsg === 'login:ok') {
53 57
           request({ ...apis.login, params: { code: res.code, from, recommender, scene, mpOpenId } }).then(x => {
54
-            setUser({...x.person, ShowIndexAdv: false, FirstComing: true})
58
+            setUser({ ...x.person, ShowIndexAdv: false, FirstComing: true })
55 59
             Taro.setStorage({ key: 'token', data: x.token })
56 60
             Taro.setStorage({ key: 'sessionKey', data: x.sessionKey })
57 61