@conecli/cone-render 0.8.36 → 0.9.1-isv2.0

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