w-web-perm 1.0.16 → 1.0.17
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/w-web-perm.umd.js +1 -1
- package/docs/WWebPerm.html +1 -1
- package/docs/WWebPerm.mjs.html +1 -1
- package/docs/index.html +1 -1
- package/package.json +1 -1
- package/src/perm.mjs +4 -21
package/dist/w-web-perm.umd.js
CHANGED
package/docs/WWebPerm.html
CHANGED
|
@@ -925,7 +925,7 @@
|
|
|
925
925
|
<br class="clear">
|
|
926
926
|
|
|
927
927
|
<footer>
|
|
928
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Sep 24 2024 16:
|
|
928
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Sep 24 2024 16:52:54 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
929
929
|
</footer>
|
|
930
930
|
|
|
931
931
|
<script>prettyPrint();</script>
|
package/docs/WWebPerm.mjs.html
CHANGED
|
@@ -1160,7 +1160,7 @@ export default WWebPerm
|
|
|
1160
1160
|
<br class="clear">
|
|
1161
1161
|
|
|
1162
1162
|
<footer>
|
|
1163
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Sep 24 2024 16:
|
|
1163
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Sep 24 2024 16:52:54 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
1164
1164
|
</footer>
|
|
1165
1165
|
|
|
1166
1166
|
<script>prettyPrint();</script>
|
package/docs/index.html
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<br class="clear">
|
|
72
72
|
|
|
73
73
|
<footer>
|
|
74
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Sep 24 2024 16:
|
|
74
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Sep 24 2024 16:52:54 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
75
75
|
</footer>
|
|
76
76
|
|
|
77
77
|
<script>prettyPrint();</script>
|
package/package.json
CHANGED
package/src/perm.mjs
CHANGED
|
@@ -2,7 +2,6 @@ import axios from 'axios'
|
|
|
2
2
|
import get from 'lodash-es/get.js'
|
|
3
3
|
import each from 'lodash-es/each.js'
|
|
4
4
|
import isestr from 'wsemi/src/isestr.mjs'
|
|
5
|
-
import isbol from 'wsemi/src/isbol.mjs'
|
|
6
5
|
import isfun from 'wsemi/src/isfun.mjs'
|
|
7
6
|
import genPm from 'wsemi/src/genPm.mjs'
|
|
8
7
|
import pmInvResolve from 'wsemi/src/pmInvResolve.mjs'
|
|
@@ -28,12 +27,6 @@ function perm() {
|
|
|
28
27
|
throw new Error(`url does not include 'userId='`)
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
//useAsync
|
|
32
|
-
let useAsync = get(opt, 'useAsync')
|
|
33
|
-
if (!isbol(useAsync)) {
|
|
34
|
-
useAsync = false
|
|
35
|
-
}
|
|
36
|
-
|
|
37
30
|
//permSuccess
|
|
38
31
|
let permSuccess = get(opt, 'permSuccess')
|
|
39
32
|
|
|
@@ -41,10 +34,7 @@ function perm() {
|
|
|
41
34
|
let permError = get(opt, 'permError')
|
|
42
35
|
|
|
43
36
|
//pm
|
|
44
|
-
let pm =
|
|
45
|
-
if (useAsync) {
|
|
46
|
-
pm = genPm()
|
|
47
|
-
}
|
|
37
|
+
let pm = genPm()
|
|
48
38
|
|
|
49
39
|
//get
|
|
50
40
|
let pms = axios.get(url)
|
|
@@ -56,24 +46,17 @@ function perm() {
|
|
|
56
46
|
if (isfun(permSuccess)) {
|
|
57
47
|
permSuccess(pmd)
|
|
58
48
|
}
|
|
59
|
-
|
|
60
|
-
pm.resolve(kp)
|
|
61
|
-
}
|
|
49
|
+
pm.resolve(pmd)
|
|
62
50
|
})
|
|
63
51
|
.catch((err) => {
|
|
64
52
|
// console.log('perm.getPerm catch', err)
|
|
65
53
|
if (isfun(permError)) {
|
|
66
54
|
permError(err)
|
|
67
55
|
}
|
|
68
|
-
|
|
69
|
-
pm.reject()
|
|
70
|
-
}
|
|
56
|
+
pm.reject(err)
|
|
71
57
|
})
|
|
72
58
|
|
|
73
|
-
|
|
74
|
-
return pm
|
|
75
|
-
}
|
|
76
|
-
return kp
|
|
59
|
+
return pm
|
|
77
60
|
}
|
|
78
61
|
|
|
79
62
|
//user
|