@conecli/cone-render 0.8.23 → 0.8.25-beta.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.
- package/dist/api/index.ts +1 -1
- package/dist/common/token/const.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -0
- package/dist/common/token/index.ts +1 -0
- package/dist/common/token/token.jd.ts +1 -0
- package/dist/common/token/token.ts +1 -0
- package/dist/common/token/token.wxapp.ts +1 -0
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/moduleUtil.ts +1 -1
- package/package.json +1 -1
package/dist/api/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { isApp } from '../../utils/jm-common'
|
|
2
|
return new Promise((resolve, reject) => {
|
|
1
3
|
let platform: string = getPlatform()
|
|
2
4
|
console.log('isSDKM:', window?.page_data?.isSDKM)
|
|
3
5
|
if (platform === TokenPlatform.TYPE_JDAPP) {
|
|
4
6
|
import('./token.jd')
|
|
5
7
|
.then((data) => {
|
|
6
8
|
console.log('data:', data)
|
|
7
9
|
resolve(data)
|
|
8
10
|
})
|
|
9
11
|
.catch((err) => {
|
|
10
12
|
reject(err)
|
|
11
13
|
})
|
|
12
14
|
}
|
|
13
15
|
else if (platform === TokenPlatform.TYPE_WQ) {
|
|
14
16
|
import('./token.wxapp')
|
|
15
17
|
.then((data) => {
|
|
16
18
|
console.log('data:', data)
|
|
17
19
|
resolve(data)
|
|
18
20
|
})
|
|
19
21
|
.catch((err) => {
|
|
20
22
|
reject(err)
|
|
21
23
|
})
|
|
22
24
|
} else {
|
|
23
25
|
import('./token')
|
|
24
26
|
.then((data) => {
|
|
25
27
|
console.log('data:', data)
|
|
26
28
|
resolve(data)
|
|
27
29
|
})
|
|
28
30
|
.catch((err) => {
|
|
29
31
|
reject(err)
|
|
30
32
|
})
|
|
31
33
|
}
|
|
32
34
|
})
|
|
33
35
|
return new Promise((resolve) => {
|
|
34
36
|
loadTokenPromise.then((proxy: any) => {
|
|
35
37
|
if (proxy?.isLogin) {
|
|
36
38
|
proxy?.isLogin().then((data: boolean) => {
|
|
37
39
|
resolve(data)
|
|
38
40
|
})
|
|
39
41
|
} else {
|
|
40
42
|
resolve(false)
|
|
41
43
|
}
|
|
42
44
|
})
|
|
43
45
|
})
|
|
44
46
|
return new Promise((resolve) => {
|
|
45
47
|
loadTokenPromise.then((proxy: any) => {
|
|
46
48
|
if (proxy?.getIsvToken) {
|
|
47
49
|
proxy?.getIsvToken().then((data: string) => {
|
|
48
50
|
resolve(data)
|
|
49
51
|
})
|
|
50
52
|
} else {
|
|
51
53
|
resolve('')
|
|
52
54
|
}
|
|
53
55
|
})
|
|
54
56
|
})
|
|
55
57
|
return new Promise((resolve) => {
|
|
56
58
|
loadTokenPromise.then((proxy: any) => {
|
|
57
59
|
if (proxy?.toLogin) {
|
|
58
60
|
proxy?.toLogin(options)
|
|
59
61
|
resolve(true)
|
|
60
62
|
} else {
|
|
61
63
|
resolve(false)
|
|
62
64
|
}
|
|
63
65
|
})
|
|
64
66
|
})
|
|
65
67
|
let platform = TokenPlatform.TYPE_M
|
|
66
68
|
if (isApp('jd')) {
|
|
67
69
|
platform = TokenPlatform.TYPE_JDAPP
|
|
68
70
|
}
|
|
69
71
|
else if ((isApp('wx') && isApp('mp')) || window?.page_data?.isSDKM) {
|
|
70
72
|
platform = TokenPlatform.TYPE_WQ
|
|
71
73
|
}
|
|
72
74
|
return platform
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { TokenPlatform } from './const'
|
|
2
|
return new Promise((resolve) => {
|
|
1
3
|
console.log('isLogin暂未实现')
|
|
2
4
|
resolve(false)
|
|
3
5
|
})
|
|
4
6
|
return new Promise((resolve) => {
|
|
5
7
|
console.log('getIsvToken暂未实现')
|
|
6
8
|
resolve('')
|
|
7
9
|
})
|
|
8
10
|
return new Promise((resolve) => {
|
|
9
11
|
console.log('toLogin暂未实现')
|
|
10
12
|
resolve(false)
|
|
11
13
|
})
|
|
12
14
|
let platform = TokenPlatform.TYPE_OTHER
|
|
13
15
|
return platform
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log('load token.jd')
|
|
2
|
return new Promise((resolve) => {
|
|
1
3
|
if (jmfe) {
|
|
2
4
|
jmfe.isJDAppLogin().then(({ data }) => {
|
|
3
5
|
if (data === '1') {
|
|
4
6
|
resolve(true)
|
|
5
7
|
} else if (data === '0') {
|
|
6
8
|
resolve(false)
|
|
7
9
|
}
|
|
8
10
|
})
|
|
9
11
|
} else {
|
|
10
12
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
11
13
|
resolve(false)
|
|
12
14
|
}
|
|
13
15
|
})
|
|
14
16
|
return requestIsvToken(window.location.href)
|
|
15
17
|
if (jmfe) {
|
|
16
18
|
jmfe.toLogin(options)
|
|
17
19
|
} else {
|
|
18
20
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
19
21
|
}
|
|
20
22
|
return new Promise((resolve) => {
|
|
21
23
|
console.log('requestIsvToken:', url)
|
|
22
24
|
if (jmfe) {
|
|
23
25
|
jmfe.requestIsvToken(url).then(({ status, data, msg }) => {
|
|
24
26
|
if (status === '0') {
|
|
25
27
|
resolve(data || '')
|
|
26
28
|
} else {
|
|
27
29
|
resolve('')
|
|
28
30
|
}
|
|
29
31
|
})
|
|
30
32
|
} else {
|
|
31
33
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
32
34
|
resolve('')
|
|
33
35
|
}
|
|
34
36
|
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import cookie from '../../utils/jm-cookie'
|
|
2
|
return new Promise((resolve) => {
|
|
1
3
|
const token = cookie.get('wq_auth_token')
|
|
2
4
|
resolve(!!token)
|
|
3
5
|
})
|
|
4
6
|
return new Promise((resolve) => {
|
|
5
7
|
const token = cookie.get('wq_auth_token') || ''
|
|
6
8
|
resolve(token)
|
|
7
9
|
})
|
|
8
10
|
const returnurl = options?.returnurl || window.location.href
|
|
9
11
|
pinTokenRedirect(WXAPP_BIZ_KEY, returnurl)
|
|
10
12
|
const url = `
|
|
11
13
|
${domain.wq}/pinbind/pintokenredirect?biz=${biz}&url=${encodeURIComponent(
|
|
12
14
|
targetUrl,
|
|
13
15
|
)}`
|
|
14
16
|
console.log('pinTokenRedirect:', url)
|
|
15
17
|
window.location.href = url
|