@conecli/cone-render 0.8.20-shop.67 → 0.8.20-shop.69

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.
@@ -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
  pin: cookie.get('pin') || ''
10
9
  })
11
10
  if(!this.checkStatusAndLoginPromise){
12
11
  this.checkStatusAndLoginPromise = new Promise(async (resolve, reject) => {
13
12
  try {
14
13
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
15
14
  if(getLoginState){
16
15
  resolve(true)
17
16
  }else {
18
17
  this.toLogin(options)
19
18
  reject(false)
20
19
  }
21
20
  }catch (e) {
22
21
  this.toLogin(options)
23
22
  reject(false)
24
23
  }
25
24
  })
26
25
  return this.checkStatusAndLoginPromise
27
26
  }else {
28
27
  return this.checkStatusAndLoginPromise.then(() => {
29
28
  return Promise.resolve(true)
30
29
  }).catch (() => {
31
30
  this.toLogin(options)
32
31
  return Promise.reject(true)
33
32
  })
34
33
  }
35
34
 
36
35
  doCheckLoginStateAndForApiCheck() {
37
36
  if(this.info.loginState){
38
37
  return Promise.resolve(true)
39
38
  }else {
40
39
  return new Promise((resolve, reject) => {
41
40
  if(this.info.isJingGouMiniViewState){
42
41
  const getWqAuthToken = cookie.get("wq_auth_token")
43
42
  if(getWqAuthToken){
44
43
  this.info.loginState = true
45
44
  resolve(true)
46
45
  }else {
47
46
  reject(false)
48
47
  }
49
48
  }else{
50
49
  Taro.request({
51
50
  url: api.isLogin,
52
51
  jsonp:true,
53
52
  timeout: 3000,
54
53
  success: (res) => {
55
54
  const {statusCode,data} = res
56
55
  if (statusCode === 200 && data?.islogin && Number(data.islogin) === 1) {
57
56
  this.info.loginState = true
58
57
  resolve(true);
59
58
  } else {
60
59
  reject(false)
61
60
  }
62
61
  },
63
62
  fail:(err) => {
64
63
  console.log("登录检查异常", err)
65
64
  reject(false)
66
65
  }
67
66
  })
68
67
  }
69
68
  })
70
69
  }
71
70
  }
72
71
 
73
72
  try {
74
73
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
75
74
  if(getLoginState){
76
75
  const { pin } = await this.getLoginCookie();
77
76
  this.info.userInfo = {
78
77
  pin,
79
78
  encodePin: encodeURIComponent(pin),
80
79
  ptkey: '',
81
80
  }
82
81
  resolve(true)
83
82
  }else {
84
83
  reject(false)
85
84
  }
86
85
  }catch (e) {
87
86
  reject(false)
88
87
  }
89
88
  })
90
89
  if(un_area && un_area.length > 0){
91
90
  this.info.pageInfo.address = un_area
92
91
  this.info.pageInfo.un_area = un_area
93
92
  this.info.pageInfo.addressCommaStr = un_area.replace(/_/g, ',')
94
93
  }
94
+ import Taro from '@tarojs/taro'
95
95
  urlCookie
96
96
  public config: {
97
97
  [key: string]: any
98
98
  }
99
99
  public lazyContainer: CommonInterFace.lazyContainer
100
100
  this.config = {}
101
101
  ...info,
102
102
  let getFullUrl = loginUrl + '?' + serialize(params)
103
103
  if(isPc) {
104
104
  getFullUrl = getFullUrl.replace(/returnurl/,'ReturnUrl')
105
105
  }
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
  const changeArea = un_area && un_area.length > 0 ? un_area : (ipLoc_djd ? ipLoc_djd : '')
188
188
  if(changeArea){
189
189
  this.info.pageInfo.address = changeArea
190
190
  this.info.pageInfo.un_area = changeArea
191
191
  this.info.pageInfo.addressCommaStr = changeArea.replace(/_/g, ',')
192
192
  }
@@ -1 +1 @@
1
- import React, { useMemo } from 'react'
2
1
  renderRealTime: 1,
2
+ import React, { useMemo } from 'react'
3
3
  key: 1,
@@ -1 +1 @@
1
- import React, { useCallback } from 'react'
2
1
  {floorData?.showCommonFloorHead === false ? null : isRealTimeRender ? (
3
2
  <CommonFloorHead dataDefines={dataDefines} floorData={floorData} renderRealTime={ Date.now()} />
4
3
  ) : (
5
4
  <CommonFloorHead dataDefines={dataDefines} floorData={floorData} />
6
5
  )}
7
6
  isRealTimeRender: false,
7
+ import React, { useCallback } from 'react'
8
8
  const getRenderRealTimeKeyObj = isRealTimeRender ? {
9
9
  key: Date.now()
10
10
  } : {}
11
11
  {floorData?.showCommonFloorHead === false ? null : <CommonFloorHead dataDefines={dataDefines} floorData={floorData} {...getRenderRealTimeKeyObj} />}
12
12
  ...getRenderRealTimeKeyObj
13
13
  isRealTimeRender: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.20-shop.67",
3
+ "version": "0.8.20-shop.69",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"