@conecli/cone-render 0.8.20-shop.179 → 0.8.20-shop.183
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
|
-
console.log('load token.jd')
|
|
2
1
|
return new Promise(resolve => {
|
|
3
2
|
if (window['jmfe']) {
|
|
4
3
|
window['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 (window['jmfe']) {
|
|
18
17
|
window['jmfe'].toLogin(options)
|
|
19
18
|
} else {
|
|
20
19
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
21
20
|
}
|
|
22
21
|
if (window['jmfe']) {
|
|
23
22
|
console.log('registerCode:', code)
|
|
24
23
|
window['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 (window['jmfe']) {
|
|
31
30
|
window['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
|
+
import {isJdAndHarmonyDevice} from '../../utils/h5Utils'
|
|
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
|
const plugin = 'JDHybridLoginPlugin';
|
|
78
78
|
const action = 'requestIsvToken';
|
|
79
79
|
const params = {url};
|
|
80
80
|
return jmfe.callNative(plugin, action, params)
|
|
81
81
|
return new Promise(resolve => {
|
|
82
82
|
console.log('requestIsvToken:', url)
|
|
83
83
|
if (window['jmfe']) {
|
|
84
84
|
(isJdAndHarmonyDevice? requestIsvTokenHarmony(url): window['jmfe'].requestIsvToken(url))
|
|
85
85
|
.then((result: any) => {
|
|
86
86
|
console.log('requestIsvToken result:' + JSON.stringify(result))
|
|
87
87
|
const { status, data, msg } = result
|
|
88
88
|
if (status === '0') {
|
|
89
89
|
resolve(data || '')
|
|
90
90
|
} else {
|
|
91
91
|
resolve('')
|
|
92
92
|
}
|
|
93
93
|
})
|
|
94
94
|
.catch((e: any) => {
|
|
95
95
|
console.log('requestIsvToken error:' + JSON.stringify(e))
|
|
96
96
|
resolve('')
|
|
97
97
|
})
|
|
98
98
|
} else {
|
|
99
99
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
100
100
|
resolve('')
|
|
101
101
|
}
|
|
102
102
|
})
|