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

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 (33) hide show
  1. package/dist/common/const.ts +1 -1
  2. package/dist/common/index.h5.ts +1 -1
  3. package/dist/common/index.jd.ts +1 -1
  4. package/dist/common/index.ts +1 -1
  5. package/dist/common/index.weapp.ts +1 -1
  6. package/dist/common/jssdk.ts +1 -1
  7. package/dist/common/pageType.ts +1 -0
  8. package/dist/common/token/index.h5.ts +1 -1
  9. package/dist/common/token/token.jd.ts +1 -1
  10. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  11. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  12. package/dist/components/base/MobileCommonHeader/index.module.scss +9 -0
  13. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  14. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  15. package/dist/components/base/Price/Double/index.tsx +1 -1
  16. package/dist/components/base/Price/index.tsx +1 -1
  17. package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
  18. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  19. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  20. package/dist/interface/component.ts +1 -1
  21. package/dist/jumpEventReport/const.ts +1 -1
  22. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  23. package/dist/jumpEventReport/web.base.ts +1 -1
  24. package/dist/jumpEventReport/web.jd.ts +1 -1
  25. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  26. package/dist/open/api/environment.ts +1 -1
  27. package/dist/open/api/index.ts +1 -1
  28. package/dist/open/components/index.ts +1 -1
  29. package/dist/service/fetchGateway.ts +1 -1
  30. package/dist/service/http/const.ts +1 -1
  31. package/dist/service/requestServer.ts +1 -1
  32. package/dist/utils/utils.ts +1 -1
  33. package/package.json +1 -1
@@ -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
  floorVideInfo: {},
76
76
  public config: {
77
77
  [key: string]: any
78
78
  }
79
79
  public lazyContainer: CommonInterFace.lazyContainer
80
80
  this.config = {}
81
81
 
82
82
  getLoginCookie(updateKey = 'wxapp') {
83
83
  return new Promise((resolve) => {
84
84
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
85
85
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
86
86
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
87
87
  resolve({
88
88
  wqCookie: this.config.wqCookie,
89
89
  wqCookieStr: this.config.wqCookieStr,
90
90
  })
91
91
  }else {
92
92
  if (isPublishToWxapp) {
93
93
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
94
94
  if (getWxappCookieObj) {
95
95
  const getCookieObj = getWxappCookieObj['_data']
96
96
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
97
97
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
98
98
  this.info.loginState = true
99
99
  this.info.userInfo.wqCookie = wqCookieStr
100
100
  this.info.userInfo.wqVisitkey = visitkey
101
101
  console.log('获取用户完整cookie信息', getCookieObj)
102
102
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
103
103
  console.log('获取微信用户地址信息', getUserAddress)
104
104
  if (getUserAddress) {
105
105
  this.info.pageInfo.address = getUserAddress?.areaId
106
106
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
107
107
  .address
108
108
  ? this.info.pageInfo.address.replace(/_/g, ',')
109
109
  : ''
110
110
  this.info.pageInfo.un_area = this.info.pageInfo.address
111
111
  Taro.eventCenter.trigger(
112
112
  TaroEventType.USER_AREA_UPDATE,
113
113
  this.info.pageInfo.address,
114
114
  )
115
115
  }
116
116
  if(this.miniAppLogInstance){
117
117
  this.miniAppLogInstance.set({
118
118
  account: pin,
119
119
  unionid: wq_unionid,
120
120
  openid: wxapp_openid,
121
121
  })
122
122
  }
123
123
  this.config.wqCookie = wqCookie
124
124
  this.config.wqCookieStr = wqCookieStr
125
125
  this.config.getWqCookieKey = updateKey
126
126
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
127
127
  resolve({
128
128
  wqCookie,
129
129
  wqCookieStr,
130
130
  })
131
131
  }else {
132
132
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
133
133
  resolve({
134
134
  wqCookie: false,
135
135
  wqCookieStr: false,
136
136
  })
137
137
  }
138
138
  }else {
139
139
  resolve({
140
140
  wqCookie: false,
141
141
  wqCookieStr: false,
142
142
  })
143
143
  }
144
144
  }
145
145
  })
146
146
  }
147
147
  return this.getLoginCookie()
148
148
 
149
149
  getAddressCachePromise = () => {
150
150
  return Promise.reject("该方法只在APP内适用")
151
151
  }
@@ -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
  WXAPP_SUBS_GUIDER
84
84
  floorVideInfo: {},
85
85
  public config: {
86
86
  [key: string]: any
87
87
  }
88
88
  this.config = {}
89
89
  this.wxAppSubsGuider = WXAPP_SUBS_GUIDER
90
90
  console.log('=================>', 'updateBusinessDomainAndApi')
91
91
 
92
92
  setTimeout(() => {
93
93
  console.log("微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
94
94
  this.getLoginCookie(`${Date.now()}`)
95
95
  },500)
96
96
  this.getLoginCookie(`${Date.now()}`)
97
97
  setTimeout(() => {
98
98
  console.log("微信强制登录后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
99
99
  this.getLoginCookie(`${Date.now()}`)
100
100
  },500)
101
101
  return new Promise((resolve) => {
102
102
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
103
103
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
104
104
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
105
105
  resolve({
106
106
  wqCookie: this.config.wqCookie,
107
107
  wqCookieStr: this.config.wqCookieStr,
108
108
  })
109
109
  }else {
110
110
  if (isPublishToWxapp) {
111
111
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
112
112
  if (getWxappCookieObj) {
113
113
  const getCookieObj = getWxappCookieObj['_data']
114
114
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
115
115
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
116
116
  this.info.loginState = true
117
117
  this.info.userInfo.wqCookie = wqCookieStr
118
118
  this.info.userInfo.wqVisitkey = visitkey
119
119
  console.log('获取用户完整cookie信息', getCookieObj)
120
120
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
121
121
  console.log('获取微信用户地址信息', getUserAddress)
122
122
  if (getUserAddress) {
123
123
  this.info.pageInfo.address = getUserAddress?.areaId
124
124
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
125
125
  .address
126
126
  ? this.info.pageInfo.address.replace(/_/g, ',')
127
127
  : ''
128
128
  this.info.pageInfo.un_area = this.info.pageInfo.address
129
129
  Taro.eventCenter.trigger(
130
130
  TaroEventType.USER_AREA_UPDATE,
131
131
  this.info.pageInfo.address,
132
132
  )
133
133
  }
134
134
  if(this.miniAppLogInstance){
135
135
  this.miniAppLogInstance.set({
136
136
  account: pin,
137
137
  unionid: wq_unionid,
138
138
  openid: wxapp_openid,
139
139
  })
140
140
  }
141
141
  this.config.wqCookie = wqCookie
142
142
  this.config.wqCookieStr = wqCookieStr
143
143
  this.config.getWqCookieKey = updateKey
144
144
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
145
145
  resolve({
146
146
  wqCookie,
147
147
  wqCookieStr,
148
148
  })
149
149
  }else {
150
150
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
151
151
  resolve({
152
152
  wqCookie: false,
153
153
  wqCookieStr: false,
154
154
  })
155
155
  }
156
156
  }else {
157
157
  resolve({
158
158
  wqCookie: false,
159
159
  wqCookieStr: false,
160
160
  })
161
161
  }
162
162
  }
163
163
  })
164
164
 
165
165
  getAddressCachePromise = () => {
166
166
  return Promise.reject("该方法只在APP内适用")
167
167
  }
@@ -1 +1 @@
1
- import ready from '../utils/ready'
2
1
  return new Promise((resolve, reject) => {
3
2
  ready('jmfe', timeout)
4
3
  .then(() => {
5
4
  registerCode(JSSDK_APP_WEBVIEW_CODE)
6
5
  resolve(window.jmfe)
7
6
  })
8
7
  .catch(() => {
9
8
  console.log('window.jmfe不存在')
10
9
  reject(null)
11
10
  })
12
11
  })
13
12
  if (jmfe) {
14
13
  console.log('registerCode:', code)
15
14
  jmfe.registerCode(code)
16
15
  } else {
17
16
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
18
17
  }
18
+ import ready from '../utils/ready'
19
19
  return new Promise((resolve, reject) => {
20
20
  ready('jmfe', timeout)
21
21
  .then(() => {
22
22
  registerCode(JSSDK_APP_WEBVIEW_CODE)
23
23
  resolve(window['jmfe'])
24
24
  })
25
25
  .catch(() => {
26
26
  console.log('window.jmfe不存在')
27
27
  reject(null)
28
28
  })
29
29
  })
30
30
  if (window['jmfe']) {
31
31
  console.log('registerCode:', code)
32
32
  window['jmfe'].registerCode(code)
33
33
  } else {
34
34
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
35
35
  }
@@ -0,0 +1 @@
1
+ export const getPageType = () => {
2
  return process.env.BUILD_TYPE || ''
1
3
 
2
4
  M_DECORATE = 'm-decorate',
3
5
  M_RENDER_MODULE = 'm-render-module',
4
6
  M_PREVIEW = 'm-preview',
5
7
  M_ISV_PREVIEW = 'm-isv-preview',
6
8
  MARKETING_PREVIEW = 'marketing-preview',
7
9
 
8
10
  APP_VIEW = 'app-view',
9
11
  APP_MEMBER = 'app-member',
10
12
  APP_INTRODUCE = 'app-introduce',
11
13
  APP_PROMOTION = 'app-promotion',
12
14
  APP_CLASSIFY = 'app-classify',
13
15
  APP_PRODUCT = 'app-product',
14
16
 
15
17
 
16
18
  PC_VIEW = 'pc-view',
17
19
  PC_VIEW1 = 'pc-view1',
18
20
  PC_VIEW2 = 'pc-view2',
19
21
  M_VIEW = 'm-view',
20
22
  M_BSC_VIEW = 'm-bsc-view',
21
23
  SALE_VIEW = 'sale-view',
22
24
  VIP_VIEW = 'vip-view',
23
25
  M_SEARCH = 'm-search',
24
26
  M_INTRODUCE = 'm-introduce',
25
27
 
26
28
  MEMBER_SHOPCARD = 'member-shopcard',
27
29
  M_MEMBER = 'm-member',
28
30
  M_MEMBER_SAM_BIND_CARD = 'm-member-sam-bind-card',
29
31
  M_MEMBER_WATSONS_BIND_CARD = 'm-member-watsons-bind-card',
30
32
  M_SAM_CARD = 'm-sam-card',
31
33
  M_SAM_CENTER = 'm-sam-center',
32
34
  M_WATSONS_CARD = 'm-watsons-card',
33
35
 
34
36
  M_LOTTERY = 'm-lottery',
35
37
  M_COUPON = 'm-coupon',
36
38
  M_WARES = 'm-wares',
37
39
  M_FAST_SHOPPING = 'm-fast-shopping',
38
40
  M_SPECIAL_SECKILL = 'm-special-seckill',
39
41
  WEAPP_SHOP = 'weapp-shop',
40
42
  WEAPP_PROMOTION = 'weapp-promotion',
41
43
  M_VIDEOS = 'm-videos',
@@ -1 +1 @@
1
- import { isApp } from '../../utils/jm-common'
2
1
  return new Promise((resolve, reject) => {
3
2
  let platform: string = getPlatform()
4
3
  if (platform === TokenPlatform.TYPE_JDAPP) {
5
4
  ready('jmfe', 3000)
6
5
  .then(() => {
7
6
  console.log('window.jmfe已经存在:', jmfe)
8
7
  import('./token.jd')
9
8
  .then((data) => {
10
9
  console.log('data:', data)
11
10
  resolve(data)
12
11
  })
13
12
  .catch((err) => {
14
13
  reject(err)
15
14
  })
16
15
  })
17
16
  .catch((e) => {
18
17
  console.log('window.jmfe不存在')
19
18
  reject(e)
20
19
  })
21
20
  }
22
21
  else if (platform === TokenPlatform.TYPE_WQ) {
23
22
  import('./token.wxapp')
24
23
  .then((data) => {
25
24
  console.log('data:', data)
26
25
  resolve(data)
27
26
  })
28
27
  .catch((err) => {
29
28
  reject(err)
30
29
  })
31
30
  } else {
32
31
  import('./token')
33
32
  .then((data) => {
34
33
  console.log('data:', data)
35
34
  resolve(data)
36
35
  })
37
36
  .catch((err) => {
38
37
  reject(err)
39
38
  })
40
39
  }
41
40
  })
42
41
  console.log(e);
43
42
  return {}
44
43
  return new Promise((resolve) => {
45
44
  loadTokenPromise
46
45
  .then((proxy: any) => {
47
46
  if (proxy?.isLogin) {
48
47
  proxy?.isLogin().then((data: boolean) => {
49
48
  resolve(data)
50
49
  })
51
50
  } else {
52
51
  resolve(false)
53
52
  }
54
53
  })
55
54
  .catch((err) => {
56
55
  resolve(false)
57
56
  })
58
57
  })
59
58
  return new Promise((resolve) => {
60
59
  loadTokenPromise
61
60
  .then((proxy: any) => {
62
61
  if (proxy?.getIsvToken) {
63
62
  proxy?.getIsvToken().then((data: string) => {
64
63
  resolve(data)
65
64
  })
66
65
  } else {
67
66
  resolve('')
68
67
  }
69
68
  })
70
69
  .catch((err) => {
71
70
  resolve('')
72
71
  })
73
72
  })
74
73
  return new Promise((resolve) => {
75
74
  loadTokenPromise
76
75
  .then((proxy: any) => {
77
76
  if (proxy?.toLogin) {
78
77
  proxy?.toLogin(options)
79
78
  resolve(true)
80
79
  } else {
81
80
  resolve(false)
82
81
  }
83
82
  })
84
83
  .catch((err) => {
85
84
  resolve(false)
86
85
  })
87
86
  })
88
87
  let platform = TokenPlatform.TYPE_M
89
88
  if (isApp('jd')) {
90
89
  platform = TokenPlatform.TYPE_JDAPP
91
90
  }
92
91
  else if (isApp('wx') && isApp('mp')) {
93
92
  platform = TokenPlatform.TYPE_WQ
94
93
  }
95
94
  return platform
96
95
  let platform = getPlatform()
97
96
  let source = platform
98
97
  if (platform === TokenPlatform.TYPE_M || platform === TokenPlatform.TYPE_WQ) {
99
98
  source = TokenPlatform.TYPE_JDAPP
100
99
  }
101
100
  return source
102
101
  return window?.page_data?.pageChannel || ''
102
+ import { isApp } from '../../utils/jm-common'
103
103
  return new Promise((resolve, reject) => {
104
104
  let platform: string = getPlatform()
105
105
  if (platform === TokenPlatform.TYPE_JDAPP) {
106
106
  ready('jmfe', 3000)
107
107
  .then(() => {
108
108
  console.log('window.jmfe已经存在:', window['jmfe'])
109
109
  import('./token.jd')
110
110
  .then((data) => {
111
111
  console.log('data:', data)
112
112
  resolve(data)
113
113
  })
114
114
  .catch((err) => {
115
115
  reject(err)
116
116
  })
117
117
  })
118
118
  .catch((e) => {
119
119
  console.log('window.jmfe不存在')
120
120
  reject(e)
121
121
  })
122
122
  }
123
123
  else if (platform === TokenPlatform.TYPE_WQ) {
124
124
  import('./token.wxapp')
125
125
  .then((data) => {
126
126
  console.log('data:', data)
127
127
  resolve(data)
128
128
  })
129
129
  .catch((err) => {
130
130
  reject(err)
131
131
  })
132
132
  } else {
133
133
  import('./token')
134
134
  .then((data) => {
135
135
  console.log('data:', data)
136
136
  resolve(data)
137
137
  })
138
138
  .catch((err) => {
139
139
  reject(err)
140
140
  })
141
141
  }
142
142
  })
143
143
  console.log(e)
144
144
  return {}
145
145
  return new Promise((resolve) => {
146
146
  loadTokenPromise
147
147
  .then((proxy: any) => {
148
148
  if (proxy?.isLogin) {
149
149
  proxy?.isLogin().then((data: boolean) => {
150
150
  resolve(data)
151
151
  })
152
152
  } else {
153
153
  resolve(false)
154
154
  }
155
155
  })
156
156
  .catch((err) => {
157
157
  resolve(false)
158
158
  })
159
159
  })
160
160
  return new Promise((resolve) => {
161
161
  loadTokenPromise
162
162
  .then((proxy: any) => {
163
163
  if (proxy?.getIsvToken) {
164
164
  proxy?.getIsvToken().then((data: string) => {
165
165
  resolve(data)
166
166
  })
167
167
  } else {
168
168
  resolve('')
169
169
  }
170
170
  })
171
171
  .catch((err) => {
172
172
  resolve('')
173
173
  })
174
174
  })
175
175
  return new Promise((resolve) => {
176
176
  loadTokenPromise
177
177
  .then((proxy: any) => {
178
178
  if (proxy?.toLogin) {
179
179
  proxy?.toLogin(options)
180
180
  resolve(true)
181
181
  } else {
182
182
  resolve(false)
183
183
  }
184
184
  })
185
185
  .catch((err) => {
186
186
  resolve(false)
187
187
  })
188
188
  })
189
189
  let platform = TokenPlatform.TYPE_M
190
190
  if (isApp('jd')) {
191
191
  platform = TokenPlatform.TYPE_JDAPP
192
192
  }
193
193
  else if (isApp('wx') && isApp('mp')) {
194
194
  platform = TokenPlatform.TYPE_WQ
195
195
  }
196
196
  return platform
197
197
  let platform = getPlatform()
198
198
  let source = platform
199
199
  if (platform === TokenPlatform.TYPE_M || platform === TokenPlatform.TYPE_WQ) {
200
200
  source = TokenPlatform.TYPE_JDAPP
201
201
  }
202
202
  return source
203
203
  return window?.page_data?.pageChannel || ''