@conecli/cone-render 0.8.38-beta.0 → 0.8.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/index.h5.ts +1 -1
  4. package/dist/common/index.jd.ts +1 -1
  5. package/dist/common/index.ts +1 -1
  6. package/dist/common/index.weapp.ts +1 -1
  7. package/dist/common/wxappApi.ts +1 -1
  8. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  9. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  10. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  11. package/dist/components/floorItem.tsx +1 -1
  12. package/dist/components/isv/Floor/index.tsx +1 -1
  13. package/dist/components/remoteFloorItem.tsx +1 -1
  14. package/dist/interface/common.ts +1 -1
  15. package/dist/interface/component.ts +1 -1
  16. package/dist/interface/jumpEventReport.ts +1 -1
  17. package/dist/interface/service.ts +1 -1
  18. package/dist/jumpEventReport/base.ts +1 -1
  19. package/dist/jumpEventReport/index.h5.ts +1 -1
  20. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  21. package/dist/jumpEventReport/web.base.ts +1 -1
  22. package/dist/jumpEventReport/web.jd.ts +1 -1
  23. package/dist/open/api/index.ts +1 -1
  24. package/dist/utils/h5Utils.ts +1 -1
  25. package/dist/utils/index.h5.ts +1 -1
  26. package/dist/utils/index.ts +1 -1
  27. package/dist/utils/index.weapp.ts +1 -1
  28. package/dist/utils/utils.ts +1 -1
  29. package/package.json +1 -1
  30. package/dist/common/jssdk.ts +0 -1
  31. package/dist/jumpEventReport/web.pc.ts +0 -1
  32. package/dist/wxapp/api/helper.js +0 -1
  33. package/dist/wxapp/components/launch-app/index.js +0 -1
  34. package/dist/wxapp/components/launch-app/index.json +0 -5
  35. package/dist/wxapp/components/launch-app/index.wxml +0 -0
  36. package/dist/wxapp/components/launch-app/index.wxss +0 -0
  37. package/dist/wxapp/components/subscribe-guider/helper.js +0 -1
  38. package/dist/wxapp/components/subscribe-guider/index.js +0 -1
  39. package/dist/wxapp/components/subscribe-guider/index.json +0 -5
  40. package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
  41. package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  urlCookie
3
2
  public config: {
4
3
  [key: string]: any
5
4
  }
6
5
  public lazyContainer: CommonInterFace.lazyContainer
7
6
  this.config = {}
8
7
  ...info,
9
8
  let getFullUrl = loginUrl + '?' + serialize(params)
10
9
  if(isPc) {
11
10
  getFullUrl = getFullUrl.replace(/returnurl/,'ReturnUrl')
12
11
  }
13
12
  pin: cookie.get('pin') || ''
14
13
  })
15
14
  if(!this.checkStatusAndLoginPromise){
16
15
  this.checkStatusAndLoginPromise = new Promise(async (resolve, reject) => {
17
16
  try {
18
17
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
19
18
  if(getLoginState){
20
19
  resolve(true)
21
20
  }else {
22
21
  this.toLogin(options)
23
22
  reject(false)
24
23
  }
25
24
  }catch (e) {
26
25
  this.toLogin(options)
27
26
  reject(false)
28
27
  }
29
28
  })
30
29
  return this.checkStatusAndLoginPromise
31
30
  }else {
32
31
  return this.checkStatusAndLoginPromise.then(() => {
33
32
  return Promise.resolve(true)
34
33
  }).catch (() => {
35
34
  this.toLogin(options)
36
35
  return Promise.reject(true)
37
36
  })
38
37
  }
39
38
 
40
39
  doCheckLoginStateAndForApiCheck() {
41
40
  if(this.info.loginState){
42
41
  return Promise.resolve(true)
43
42
  }else {
44
43
  return new Promise((resolve, reject) => {
45
44
  if(this.info.isJingGouMiniViewState){
46
45
  const getWqAuthToken = cookie.get("wq_auth_token")
47
46
  if(getWqAuthToken){
48
47
  this.info.loginState = true
49
48
  resolve(true)
50
49
  }else {
51
50
  reject(false)
52
51
  }
53
52
  }else{
54
53
  Taro.request({
55
54
  url: api.isLogin,
56
55
  jsonp:true,
57
56
  timeout: 3000,
58
57
  success: (res) => {
59
58
  const {statusCode,data} = res
60
59
  if (statusCode === 200 && data?.islogin && Number(data.islogin) === 1) {
61
60
  this.info.loginState = true
62
61
  resolve(true);
63
62
  } else {
64
63
  reject(false)
65
64
  }
66
65
  },
67
66
  fail:(err) => {
68
67
  console.log("登录检查异常", err)
69
68
  reject(false)
70
69
  }
71
70
  })
72
71
  }
73
72
  })
74
73
  }
75
74
  }
76
75
 
77
76
  try {
78
77
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
79
78
  if(getLoginState){
80
79
  const { pin } = await this.getLoginCookie();
81
80
  this.info.userInfo = {
82
81
  pin,
83
82
  encodePin: encodeURIComponent(pin),
84
83
  ptkey: '',
85
84
  }
86
85
  resolve(true)
87
86
  }else {
88
87
  reject(false)
89
88
  }
90
89
  }catch (e) {
91
90
  reject(false)
92
91
  }
93
92
  })
94
93
  const changeArea = un_area && un_area.length > 0 ? un_area : (ipLoc_djd ? ipLoc_djd : '')
95
94
  if(changeArea){
96
95
  this.info.pageInfo.address = changeArea
97
96
  this.info.pageInfo.un_area = changeArea
98
97
  this.info.pageInfo.addressCommaStr = changeArea.replace(/_/g, ',')
99
98
  }
99
+ import Taro from '@tarojs/taro'
100
100
  urlCookie
101
101
  public config: {
102
102
  [key: string]: any
103
103
  }
104
104
  public lazyContainer: CommonInterFace.lazyContainer
105
105
  this.config = {}
106
106
  pin: cookie.get('pin') || ''
107
107
  })
108
108
  if(!this.checkStatusAndLoginPromise){
109
109
  this.checkStatusAndLoginPromise = new Promise(async (resolve, reject) => {
110
110
  try {
111
111
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
112
112
  if(getLoginState){
113
113
  resolve(true)
114
114
  }else {
115
115
  this.toLogin(options)
116
116
  reject(false)
117
117
  }
118
118
  }catch (e) {
119
119
  this.toLogin(options)
120
120
  reject(false)
121
121
  }
122
122
  })
123
123
  return this.checkStatusAndLoginPromise
124
124
  }else {
125
125
  return this.checkStatusAndLoginPromise.then(() => {
126
126
  return Promise.resolve(true)
127
127
  }).catch (() => {
128
128
  this.toLogin(options)
129
129
  return Promise.reject(true)
130
130
  })
131
131
  }
132
132
 
133
133
  doCheckLoginStateAndForApiCheck() {
134
134
  if(this.info.loginState){
135
135
  return Promise.resolve(true)
136
136
  }else {
137
137
  return new Promise((resolve, reject) => {
138
138
  if(this.info.isJingGouMiniViewState){
139
139
  const getWqAuthToken = cookie.get("wq_auth_token")
140
140
  if(getWqAuthToken){
141
141
  this.info.loginState = true
142
142
  resolve(true)
143
143
  }else {
144
144
  reject(false)
145
145
  }
146
146
  }else{
147
147
  Taro.request({
148
148
  url: api.isLogin,
149
149
  jsonp:true,
150
150
  timeout: 3000,
151
151
  success: (res) => {
152
152
  const {statusCode,data} = res
153
153
  if (statusCode === 200 && data?.islogin && Number(data.islogin) === 1) {
154
154
  this.info.loginState = true
155
155
  resolve(true);
156
156
  } else {
157
157
  reject(false)
158
158
  }
159
159
  },
160
160
  fail:(err) => {
161
161
  console.log("登录检查异常", err)
162
162
  reject(false)
163
163
  }
164
164
  })
165
165
  }
166
166
  })
167
167
  }
168
168
  }
169
169
 
170
170
  try {
171
171
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
172
172
  if(getLoginState){
173
173
  const { pin } = await this.getLoginCookie();
174
174
  this.info.userInfo = {
175
175
  pin,
176
176
  encodePin: encodeURIComponent(pin),
177
177
  ptkey: '',
178
178
  }
179
179
  resolve(true)
180
180
  }else {
181
181
  reject(false)
182
182
  }
183
183
  }catch (e) {
184
184
  reject(false)
185
185
  }
186
186
  })
187
187
  if(un_area && un_area.length > 0){
188
188
  this.info.pageInfo.address = un_area
189
189
  this.info.pageInfo.un_area = un_area
190
190
  this.info.pageInfo.addressCommaStr = un_area.replace(/_/g, ',')
191
191
  }
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  floorVideInfo: {},
3
2
  public config: object
4
3
  this.config = {}
5
4
  return new Promise((resolve, reject) => {
6
5
  if (typeof jd !== 'undefined' && jd.requestWebCookie) {
7
6
  jd.requestWebCookie({
8
7
  needpin: 1,
9
8
  success: (res) => {
10
9
  console.log(res)
11
10
  const { ticket, pt_pin } = res
12
11
  console.log('requestWebCookie.success', res)
13
12
  this.info.userInfo = {
14
13
  pin: pt_pin,
15
14
  encodePin: encodeURIComponent(pt_pin),
16
15
  ptkey: ticket,
17
16
  }
18
17
  this.miniAppLogInstance &&
19
18
  this.miniAppLogInstance.set({
20
19
  account: pt_pin,
21
20
  })
22
21
  this.info.loginState = true
23
22
  resolve(res)
24
23
  },
25
24
  fail(res) {
26
25
  console.log('requestWebCookie.fail', res)
27
26
  reject(res)
28
27
  },
29
28
  })
30
29
  } else {
31
30
  resolve({
32
31
  pin: '',
33
32
  ptkey: '',
34
33
  mock: true
35
34
  })
36
35
  }
37
36
  })
38
37
  this.checkLoginStatus().then(res => {
39
38
  console.log(
40
39
  'jdLoadCheckStatusAndLogin hasUserLogined.success: ',
41
40
  res,
42
41
  )
43
42
  resolve(res)
44
43
  }).catch(err => {
45
44
  console.warn(
46
45
  'jdLoadCheckStatusAndLogin hasUserLogined.fail: ',
47
46
  err,
48
47
  )
49
48
  this.toLogin().then(res => {
50
49
  resolve(res)
51
50
  }).catch(err => {
52
51
  reject(err)
53
52
  })
54
53
  })
55
54
  return this.checkStatusAndLoginPromise
56
55
  return new Promise((resolve,reject) => {
57
56
  if (typeof jd !== 'undefined' && jd.hasUserLogined) {
58
57
  jd.hasUserLogined({
59
58
  success: (res) => {
60
59
  console.log('hasUserLogined.success: ', res)
61
60
  if (res.status === 1) {
62
61
  this.getLoginCookie()
63
62
  resolve(res)
64
63
  }else {
65
64
  reject(res)
66
65
  }
67
66
  },
68
67
  fail: (res) => {
69
68
  console.warn('hasUserLogined.fail: ', res)
70
69
  reject(res)
71
70
  },
72
71
  })
73
72
  } else {
74
73
  reject(false)
75
74
  }
76
75
  })
76
+ import Taro from '@tarojs/taro'
77
77
  public config: object
78
78
  this.config = {}
79
79
  return new Promise((resolve, reject) => {
80
80
  if (typeof jd !== 'undefined' && jd.requestWebCookie) {
81
81
  jd.requestWebCookie({
82
82
  needpin: 1,
83
83
  success: (res) => {
84
84
  console.log(res)
85
85
  const { ticket, pt_pin } = res
86
86
  console.log('requestWebCookie.success', res)
87
87
  this.info.userInfo = {
88
88
  pin: pt_pin,
89
89
  encodePin: encodeURIComponent(pt_pin),
90
90
  ptkey: ticket,
91
91
  }
92
92
  this.miniAppLogInstance &&
93
93
  this.miniAppLogInstance.set({
94
94
  account: pt_pin,
95
95
  })
96
96
  this.info.loginState = true
97
97
  resolve(res)
98
98
  },
99
99
  fail(res) {
100
100
  console.log('requestWebCookie.fail', res)
101
101
  reject(res)
102
102
  },
103
103
  })
104
104
  } else {
105
105
  resolve({
106
106
  pin: '',
107
107
  ptkey: '',
108
108
  mock: true
109
109
  })
110
110
  }
111
111
  })
112
112
  this.checkLoginStatus().then(res => {
113
113
  console.log(
114
114
  'jdLoadCheckStatusAndLogin hasUserLogined.success: ',
115
115
  res,
116
116
  )
117
117
  resolve(res)
118
118
  }).catch(err => {
119
119
  console.warn(
120
120
  'jdLoadCheckStatusAndLogin hasUserLogined.fail: ',
121
121
  err,
122
122
  )
123
123
  this.toLogin().then(res => {
124
124
  resolve(res)
125
125
  }).catch(err => {
126
126
  reject(err)
127
127
  })
128
128
  })
129
129
  return this.checkStatusAndLoginPromise
130
130
  return new Promise((resolve,reject) => {
131
131
  if (typeof jd !== 'undefined' && jd.hasUserLogined) {
132
132
  jd.hasUserLogined({
133
133
  success: (res) => {
134
134
  console.log('hasUserLogined.success: ', res)
135
135
  if (res.status === 1) {
136
136
  this.getLoginCookie()
137
137
  resolve(res)
138
138
  }else {
139
139
  reject(res)
140
140
  }
141
141
  },
142
142
  fail: (res) => {
143
143
  console.warn('hasUserLogined.fail: ', res)
144
144
  reject(res)
145
145
  },
146
146
  })
147
147
  } else {
148
148
  reject(false)
149
149
  }
150
150
  })
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  floorVideInfo: {},
3
2
  public config: {
4
3
  [key: string]: any
5
4
  }
6
5
  public lazyContainer: CommonInterFace.lazyContainer
7
6
  this.config = {}
8
7
 
9
8
  getLoginCookie(updateKey = 'wxapp') {
10
9
  return new Promise((resolve) => {
11
10
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
12
11
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
13
12
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
14
13
  resolve({
15
14
  wqCookie: this.config.wqCookie,
16
15
  wqCookieStr: this.config.wqCookieStr,
17
16
  })
18
17
  }else {
19
18
  if (isPublishToWxapp) {
20
19
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
21
20
  if (getWxappCookieObj) {
22
21
  const getCookieObj = getWxappCookieObj['_data']
23
22
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
24
23
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
25
24
  this.info.loginState = true
26
25
  this.info.userInfo.wqCookie = wqCookieStr
27
26
  this.info.userInfo.wqVisitkey = visitkey
28
27
  console.log('获取用户完整cookie信息', getCookieObj)
29
28
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
30
29
  console.log('获取微信用户地址信息', getUserAddress)
31
30
  if (getUserAddress) {
32
31
  this.info.pageInfo.address = getUserAddress?.areaId
33
32
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
34
33
  .address
35
34
  ? this.info.pageInfo.address.replace(/_/g, ',')
36
35
  : ''
37
36
  this.info.pageInfo.un_area = this.info.pageInfo.address
38
37
  Taro.eventCenter.trigger(
39
38
  TaroEventType.USER_AREA_UPDATE,
40
39
  this.info.pageInfo.address,
41
40
  )
42
41
  }
43
42
  if(this.miniAppLogInstance){
44
43
  this.miniAppLogInstance.set({
45
44
  account: pin,
46
45
  unionid: wq_unionid,
47
46
  openid: wxapp_openid,
48
47
  })
49
48
  }
50
49
  this.config.wqCookie = wqCookie
51
50
  this.config.wqCookieStr = wqCookieStr
52
51
  this.config.getWqCookieKey = updateKey
53
52
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
54
53
  resolve({
55
54
  wqCookie,
56
55
  wqCookieStr,
57
56
  })
58
57
  }else {
59
58
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
60
59
  resolve({
61
60
  wqCookie: false,
62
61
  wqCookieStr: false,
63
62
  })
64
63
  }
65
64
  }else {
66
65
  resolve({
67
66
  wqCookie: false,
68
67
  wqCookieStr: false,
69
68
  })
70
69
  }
71
70
  }
72
71
  })
73
72
  }
74
73
  return this.getLoginCookie()
74
+ import Taro from '@tarojs/taro'
75
75
  public config: {
76
76
  [key: string]: any
77
77
  }
78
78
  public lazyContainer: CommonInterFace.lazyContainer
79
79
  this.config = {}
80
80
 
81
81
  getLoginCookie(updateKey = 'wxapp') {
82
82
  return new Promise((resolve) => {
83
83
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
84
84
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
85
85
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
86
86
  resolve({
87
87
  wqCookie: this.config.wqCookie,
88
88
  wqCookieStr: this.config.wqCookieStr,
89
89
  })
90
90
  }else {
91
91
  if (isPublishToWxapp) {
92
92
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
93
93
  if (getWxappCookieObj) {
94
94
  const getCookieObj = getWxappCookieObj['_data']
95
95
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
96
96
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
97
97
  this.info.loginState = true
98
98
  this.info.userInfo.wqCookie = wqCookieStr
99
99
  this.info.userInfo.wqVisitkey = visitkey
100
100
  console.log('获取用户完整cookie信息', getCookieObj)
101
101
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
102
102
  console.log('获取微信用户地址信息', getUserAddress)
103
103
  if (getUserAddress) {
104
104
  this.info.pageInfo.address = getUserAddress?.areaId
105
105
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
106
106
  .address
107
107
  ? this.info.pageInfo.address.replace(/_/g, ',')
108
108
  : ''
109
109
  this.info.pageInfo.un_area = this.info.pageInfo.address
110
110
  Taro.eventCenter.trigger(
111
111
  TaroEventType.USER_AREA_UPDATE,
112
112
  this.info.pageInfo.address,
113
113
  )
114
114
  }
115
115
  if(this.miniAppLogInstance){
116
116
  this.miniAppLogInstance.set({
117
117
  account: pin,
118
118
  unionid: wq_unionid,
119
119
  openid: wxapp_openid,
120
120
  })
121
121
  }
122
122
  this.config.wqCookie = wqCookie
123
123
  this.config.wqCookieStr = wqCookieStr
124
124
  this.config.getWqCookieKey = updateKey
125
125
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
126
126
  resolve({
127
127
  wqCookie,
128
128
  wqCookieStr,
129
129
  })
130
130
  }else {
131
131
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
132
132
  resolve({
133
133
  wqCookie: false,
134
134
  wqCookieStr: false,
135
135
  })
136
136
  }
137
137
  }else {
138
138
  resolve({
139
139
  wqCookie: false,
140
140
  wqCookieStr: false,
141
141
  })
142
142
  }
143
143
  }
144
144
  })
145
145
  }
146
146
  return this.getLoginCookie()
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  WXAPP_SUBS_GUIDER
3
2
  floorVideInfo: {},
4
3
  public config: {
5
4
  [key: string]: any
6
5
  }
7
6
  this.config = {}
8
7
  this.wxAppSubsGuider = WXAPP_SUBS_GUIDER
9
8
  console.log('=================>', 'updateBusinessDomainAndApi')
10
9
 
11
10
  setTimeout(() => {
12
11
  console.log("微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
13
12
  this.getLoginCookie(`${Date.now()}`)
14
13
  },500)
15
14
  this.getLoginCookie(`${Date.now()}`)
16
15
  setTimeout(() => {
17
16
  console.log("微信强制登录后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
18
17
  this.getLoginCookie(`${Date.now()}`)
19
18
  },500)
20
19
  return new Promise((resolve) => {
21
20
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
22
21
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
23
22
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
24
23
  resolve({
25
24
  wqCookie: this.config.wqCookie,
26
25
  wqCookieStr: this.config.wqCookieStr,
27
26
  })
28
27
  }else {
29
28
  if (isPublishToWxapp) {
30
29
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
31
30
  if (getWxappCookieObj) {
32
31
  const getCookieObj = getWxappCookieObj['_data']
33
32
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
34
33
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
35
34
  this.info.loginState = true
36
35
  this.info.userInfo.wqCookie = wqCookieStr
37
36
  this.info.userInfo.wqVisitkey = visitkey
38
37
  console.log('获取用户完整cookie信息', getCookieObj)
39
38
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
40
39
  console.log('获取微信用户地址信息', getUserAddress)
41
40
  if (getUserAddress) {
42
41
  this.info.pageInfo.address = getUserAddress?.areaId
43
42
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
44
43
  .address
45
44
  ? this.info.pageInfo.address.replace(/_/g, ',')
46
45
  : ''
47
46
  this.info.pageInfo.un_area = this.info.pageInfo.address
48
47
  Taro.eventCenter.trigger(
49
48
  TaroEventType.USER_AREA_UPDATE,
50
49
  this.info.pageInfo.address,
51
50
  )
52
51
  }
53
52
  if(this.miniAppLogInstance){
54
53
  this.miniAppLogInstance.set({
55
54
  account: pin,
56
55
  unionid: wq_unionid,
57
56
  openid: wxapp_openid,
58
57
  })
59
58
  }
60
59
  this.config.wqCookie = wqCookie
61
60
  this.config.wqCookieStr = wqCookieStr
62
61
  this.config.getWqCookieKey = updateKey
63
62
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
64
63
  resolve({
65
64
  wqCookie,
66
65
  wqCookieStr,
67
66
  })
68
67
  }else {
69
68
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
70
69
  resolve({
71
70
  wqCookie: false,
72
71
  wqCookieStr: false,
73
72
  })
74
73
  }
75
74
  }else {
76
75
  resolve({
77
76
  wqCookie: false,
78
77
  wqCookieStr: false,
79
78
  })
80
79
  }
81
80
  }
82
81
  })
82
+ import Taro from '@tarojs/taro'
83
83
  public config: {
84
84
  [key: string]: any
85
85
  }
86
86
  this.config = {}
87
87
  console.log('=================>', 'updateBusinessDomainAndApi')
88
88
 
89
89
  setTimeout(() => {
90
90
  console.log("微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
91
91
  this.getLoginCookie(`${Date.now()}`)
92
92
  },500)
93
93
  this.getLoginCookie(`${Date.now()}`)
94
94
  setTimeout(() => {
95
95
  console.log("微信强制登录后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
96
96
  this.getLoginCookie(`${Date.now()}`)
97
97
  },500)
98
98
  return new Promise((resolve) => {
99
99
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
100
100
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
101
101
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
102
102
  resolve({
103
103
  wqCookie: this.config.wqCookie,
104
104
  wqCookieStr: this.config.wqCookieStr,
105
105
  })
106
106
  }else {
107
107
  if (isPublishToWxapp) {
108
108
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
109
109
  if (getWxappCookieObj) {
110
110
  const getCookieObj = getWxappCookieObj['_data']
111
111
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
112
112
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
113
113
  this.info.loginState = true
114
114
  this.info.userInfo.wqCookie = wqCookieStr
115
115
  this.info.userInfo.wqVisitkey = visitkey
116
116
  console.log('获取用户完整cookie信息', getCookieObj)
117
117
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
118
118
  console.log('获取微信用户地址信息', getUserAddress)
119
119
  if (getUserAddress) {
120
120
  this.info.pageInfo.address = getUserAddress?.areaId
121
121
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
122
122
  .address
123
123
  ? this.info.pageInfo.address.replace(/_/g, ',')
124
124
  : ''
125
125
  this.info.pageInfo.un_area = this.info.pageInfo.address
126
126
  Taro.eventCenter.trigger(
127
127
  TaroEventType.USER_AREA_UPDATE,
128
128
  this.info.pageInfo.address,
129
129
  )
130
130
  }
131
131
  if(this.miniAppLogInstance){
132
132
  this.miniAppLogInstance.set({
133
133
  account: pin,
134
134
  unionid: wq_unionid,
135
135
  openid: wxapp_openid,
136
136
  })
137
137
  }
138
138
  this.config.wqCookie = wqCookie
139
139
  this.config.wqCookieStr = wqCookieStr
140
140
  this.config.getWqCookieKey = updateKey
141
141
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
142
142
  resolve({
143
143
  wqCookie,
144
144
  wqCookieStr,
145
145
  })
146
146
  }else {
147
147
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
148
148
  resolve({
149
149
  wqCookie: false,
150
150
  wqCookieStr: false,
151
151
  })
152
152
  }
153
153
  }else {
154
154
  resolve({
155
155
  wqCookie: false,
156
156
  wqCookieStr: false,
157
157
  })
158
158
  }
159
159
  }
160
160
  })
@@ -1 +1 @@
1
- import * as WXAPP_LOGIN from '../wxapp/common/login/login.js'
1
+ import * as WXAPP_LOGIN from '../wxapp/common/login/login.js'
@@ -1 +1 @@
1
- import React, { useMemo } from 'react'
2
1
  key: 1,
2
+ import React, { useMemo } from 'react'