@conecli/cone-render 0.8.38 → 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 (61) 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/jssdk.ts +1 -0
  8. package/dist/common/pageType.ts +1 -0
  9. package/dist/common/token/index.h5.ts +1 -1
  10. package/dist/common/token/token.jd.ts +1 -1
  11. package/dist/common/wxappApi.ts +1 -1
  12. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  13. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  14. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  15. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  16. package/dist/components/base/MobileCommonHeader/index.module.scss +9 -0
  17. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  18. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  19. package/dist/components/base/Price/Double/index.tsx +1 -1
  20. package/dist/components/base/Price/index.tsx +1 -1
  21. package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
  22. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  23. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  24. package/dist/components/floorItem.tsx +1 -1
  25. package/dist/components/isv/Floor/index.tsx +1 -1
  26. package/dist/components/remoteFloorItem.tsx +1 -1
  27. package/dist/interface/common.ts +1 -1
  28. package/dist/interface/component.ts +1 -1
  29. package/dist/interface/jumpEventReport.ts +1 -1
  30. package/dist/interface/service.ts +1 -1
  31. package/dist/jumpEventReport/base.ts +1 -1
  32. package/dist/jumpEventReport/const.ts +1 -1
  33. package/dist/jumpEventReport/index.h5.ts +1 -1
  34. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  35. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  36. package/dist/jumpEventReport/web.base.ts +1 -1
  37. package/dist/jumpEventReport/web.jd.ts +1 -1
  38. package/dist/jumpEventReport/web.pc.ts +1 -0
  39. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  40. package/dist/open/api/environment.ts +1 -1
  41. package/dist/open/api/index.ts +1 -1
  42. package/dist/open/components/index.ts +1 -1
  43. package/dist/service/fetchGateway.ts +1 -1
  44. package/dist/service/http/const.ts +1 -1
  45. package/dist/service/requestServer.ts +1 -1
  46. package/dist/utils/h5Utils.ts +1 -1
  47. package/dist/utils/index.h5.ts +1 -1
  48. package/dist/utils/index.ts +1 -1
  49. package/dist/utils/index.weapp.ts +1 -1
  50. package/dist/utils/utils.ts +1 -1
  51. package/dist/wxapp/api/helper.js +1 -0
  52. package/dist/wxapp/components/launch-app/index.js +1 -0
  53. package/dist/wxapp/components/launch-app/index.json +5 -0
  54. package/dist/wxapp/components/launch-app/index.wxml +0 -0
  55. package/dist/wxapp/components/launch-app/index.wxss +0 -0
  56. package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
  57. package/dist/wxapp/components/subscribe-guider/index.js +1 -0
  58. package/dist/wxapp/components/subscribe-guider/index.json +5 -0
  59. package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
  60. package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
  61. package/package.json +1 -1
@@ -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()
147
147
 
148
148
  getAddressCachePromise = () => {
149
149
  return Promise.reject("该方法只在APP内适用")
150
150
  }
@@ -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
  })
161
161
 
162
162
  getAddressCachePromise = () => {
163
163
  return Promise.reject("该方法只在APP内适用")
164
164
  }
@@ -0,0 +1 @@
1
+ import ready from '../utils/ready'
2
  return new Promise((resolve, reject) => {
1
3
  ready('jmfe', timeout)
2
4
  .then(() => {
3
5
  registerCode(JSSDK_APP_WEBVIEW_CODE)
4
6
  resolve(window['jmfe'])
5
7
  })
6
8
  .catch(() => {
7
9
  console.log('window.jmfe不存在')
8
10
  reject(null)
9
11
  })
10
12
  })
11
13
  if (window['jmfe']) {
12
14
  console.log('registerCode:', code)
13
15
  window['jmfe'].registerCode(code)
14
16
  } else {
15
17
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
16
18
  }
@@ -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 || ''
@@ -1 +1 @@
1
- console.log('load token.jd')
2
1
  return new Promise((resolve) => {
3
2
  if (jmfe) {
4
3
  jmfe.isJDAppLogin().then(({ data }) => {
5
4
  if (data === '1') {
6
5
  resolve(true)
7
6
  } else if (data === '0') {
8
7
  resolve(false)
9
8
  }
10
9
  })
11
10
  } else {
12
11
  console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
13
12
  resolve(false)
14
13
  }
15
14
  })
16
15
  return requestIsvToken(window.location.href)
17
16
  if (jmfe) {
18
17
  jmfe.toLogin(options)
19
18
  } else {
20
19
  console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
21
20
  }
22
21
  if (jmfe) {
23
22
  console.log('registerCode:', code)
24
23
  jmfe.registerCode(code)
25
24
  } else {
26
25
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
27
26
  }
28
27
  return new Promise((resolve) => {
29
28
  console.log('requestIsvToken:', url)
30
29
  if (jmfe) {
31
30
  jmfe
32
31
  .requestIsvToken(url)
33
32
  .then((result: any) => {
34
33
  console.log('requestIsvToken result:' + JSON.stringify(result))
35
34
  const { status, data, msg } = result
36
35
  if (status === '0') {
37
36
  resolve(data || '')
38
37
  } else {
39
38
  resolve('')
40
39
  }
41
40
  })
42
41
  .catch((e: any) => {
43
42
  console.log('requestIsvToken error:' + JSON.stringify(e))
44
43
  resolve('')
45
44
  })
46
45
  } else {
47
46
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
48
47
  resolve('')
49
48
  }
50
49
  })
50
+ console.log('load token.jd')
51
51
  return new Promise((resolve) => {
52
52
  if (window['jmfe']) {
53
53
  window['jmfe'].isJDAppLogin().then(({ data }) => {
54
54
  if (data === '1') {
55
55
  resolve(true)
56
56
  } else if (data === '0') {
57
57
  resolve(false)
58
58
  }
59
59
  })
60
60
  } else {
61
61
  console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
62
62
  resolve(false)
63
63
  }
64
64
  })
65
65
  return requestIsvToken(window.location.href)
66
66
  if (window['jmfe']) {
67
67
  window['jmfe'].toLogin(options)
68
68
  } else {
69
69
  console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
70
70
  }
71
71
  if (window['jmfe']) {
72
72
  console.log('registerCode:', code)
73
73
  window['jmfe'].registerCode(code)
74
74
  } else {
75
75
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
76
76
  }
77
77
  return new Promise((resolve) => {
78
78
  console.log('requestIsvToken:', url)
79
79
  if (window['jmfe']) {
80
80
  window['jmfe']
81
81
  .requestIsvToken(url)
82
82
  .then((result: any) => {
83
83
  console.log('requestIsvToken result:' + JSON.stringify(result))
84
84
  const { status, data, msg } = result
85
85
  if (status === '0') {
86
86
  resolve(data || '')
87
87
  } else {
88
88
  resolve('')
89
89
  }
90
90
  })
91
91
  .catch((e: any) => {
92
92
  console.log('requestIsvToken error:' + JSON.stringify(e))
93
93
  resolve('')
94
94
  })
95
95
  } else {
96
96
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
97
97
  resolve('')
98
98
  }
99
99
  })
@@ -1 +1 @@
1
- import * as WXAPP_LOGIN from '../wxapp/common/login/login.js'
1
+ import * as WXAPP_LOGIN from '../wxapp/common/login/login.js'