mali-applet-ui 1.1.33 → 1.1.35
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/index.js +2 -6
- package/lib/components/ml-tree-box/ml-tree-box.vue +1 -0
- package/package.json +1 -2
- package/types/index.d.ts +0 -3
- package/utils/applet.js +4 -3
- package/base64/base64.js +0 -126
- package/types/base64/index.d.ts +0 -6
package/index.js
CHANGED
|
@@ -6,8 +6,6 @@ import MaliStorage from './storage'
|
|
|
6
6
|
import MaliI18n from './i18n/i18n'
|
|
7
7
|
import MaliUtils from './utils'
|
|
8
8
|
|
|
9
|
-
import Base64 from './base64/base64'
|
|
10
|
-
|
|
11
9
|
export function install (Vue) {
|
|
12
10
|
Vue.prototype.$t = MaliI18n.t
|
|
13
11
|
}
|
|
@@ -20,8 +18,7 @@ const MaliUI = {
|
|
|
20
18
|
MaliModal,
|
|
21
19
|
MaliLoading,
|
|
22
20
|
MaliStorage,
|
|
23
|
-
MaliI18n
|
|
24
|
-
Base64
|
|
21
|
+
MaliI18n
|
|
25
22
|
}
|
|
26
23
|
|
|
27
24
|
export {
|
|
@@ -30,8 +27,7 @@ export {
|
|
|
30
27
|
MaliModal,
|
|
31
28
|
MaliLoading,
|
|
32
29
|
MaliStorage,
|
|
33
|
-
MaliI18n
|
|
34
|
-
Base64
|
|
30
|
+
MaliI18n
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
export default MaliUI
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { MaliModal } from './modal'
|
|
|
6
6
|
import { MaliToast } from './toast'
|
|
7
7
|
import { MaliLoading } from './loading'
|
|
8
8
|
import { MaliI18n, MlI18nCore } from './i18n'
|
|
9
|
-
import { Base64, Base64Core } from './base64'
|
|
10
9
|
|
|
11
10
|
export const MaliUI: {
|
|
12
11
|
version: string
|
|
@@ -18,7 +17,6 @@ export const MaliUI: {
|
|
|
18
17
|
MaliLoading: typeof MaliLoading
|
|
19
18
|
MaliI18n: MlI18nCore
|
|
20
19
|
MaliStorage: MlStorageCore
|
|
21
|
-
Base64: Base64Core
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
export {
|
|
@@ -28,7 +26,6 @@ export {
|
|
|
28
26
|
MaliLoading,
|
|
29
27
|
MaliI18n,
|
|
30
28
|
MaliStorage,
|
|
31
|
-
Base64
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
export default MaliUI
|
package/utils/applet.js
CHANGED
|
@@ -23,14 +23,14 @@ export function checkForUpdate () {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* 当前运行环境
|
|
27
27
|
*/
|
|
28
28
|
export function getPlatformEnv () {
|
|
29
29
|
const sysRes = uni.getSystemInfoSync()
|
|
30
30
|
const hostName = sysRes.hostName
|
|
31
31
|
const platform = {
|
|
32
|
-
//
|
|
33
|
-
|
|
32
|
+
// 浏览器
|
|
33
|
+
isWeb: false,
|
|
34
34
|
// 微信
|
|
35
35
|
isWXMP: false,
|
|
36
36
|
// 企业微信
|
|
@@ -42,6 +42,7 @@ export function getPlatformEnv () {
|
|
|
42
42
|
}
|
|
43
43
|
if (/web/.test(sysRes.uniPlatform)) {
|
|
44
44
|
platform.isH5 = true
|
|
45
|
+
platform.isWeb = true
|
|
45
46
|
} else {
|
|
46
47
|
if (/WeChat/i.test(hostName)) {
|
|
47
48
|
platform.isWXMP = true
|
package/base64/base64.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
const Base64 = {
|
|
4
|
-
|
|
5
|
-
// private property
|
|
6
|
-
_keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
|
|
7
|
-
|
|
8
|
-
// public method for encoding
|
|
9
|
-
encode (input) {
|
|
10
|
-
let output = ''
|
|
11
|
-
let chr1, chr2, chr3, enc1, enc2, enc3, enc4
|
|
12
|
-
let i = 0
|
|
13
|
-
|
|
14
|
-
input = Base64._utf8_encode(input)
|
|
15
|
-
|
|
16
|
-
while (i < input.length) {
|
|
17
|
-
chr1 = input.charCodeAt(i++)
|
|
18
|
-
chr2 = input.charCodeAt(i++)
|
|
19
|
-
chr3 = input.charCodeAt(i++)
|
|
20
|
-
|
|
21
|
-
enc1 = chr1 >> 2
|
|
22
|
-
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)
|
|
23
|
-
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)
|
|
24
|
-
enc4 = chr3 & 63
|
|
25
|
-
|
|
26
|
-
if (isNaN(chr2)) {
|
|
27
|
-
enc3 = enc4 = 64
|
|
28
|
-
} else if (isNaN(chr3)) {
|
|
29
|
-
enc4 = 64
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
output = output +
|
|
33
|
-
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
|
|
34
|
-
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return output
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
// public method for decoding
|
|
41
|
-
decode (input) {
|
|
42
|
-
let output = ''
|
|
43
|
-
let chr1, chr2, chr3
|
|
44
|
-
let enc1, enc2, enc3, enc4
|
|
45
|
-
let i = 0
|
|
46
|
-
|
|
47
|
-
input = input.replace(/[^A-Za-z0-9+/=]/g, '')
|
|
48
|
-
|
|
49
|
-
while (i < input.length) {
|
|
50
|
-
enc1 = this._keyStr.indexOf(input.charAt(i++))
|
|
51
|
-
enc2 = this._keyStr.indexOf(input.charAt(i++))
|
|
52
|
-
enc3 = this._keyStr.indexOf(input.charAt(i++))
|
|
53
|
-
enc4 = this._keyStr.indexOf(input.charAt(i++))
|
|
54
|
-
|
|
55
|
-
chr1 = (enc1 << 2) | (enc2 >> 4)
|
|
56
|
-
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2)
|
|
57
|
-
chr3 = ((enc3 & 3) << 6) | enc4
|
|
58
|
-
|
|
59
|
-
output = output + String.fromCharCode(chr1)
|
|
60
|
-
|
|
61
|
-
if (enc3 != 64) {
|
|
62
|
-
output = output + String.fromCharCode(chr2)
|
|
63
|
-
}
|
|
64
|
-
if (enc4 != 64) {
|
|
65
|
-
output = output + String.fromCharCode(chr3)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
output = Base64._utf8_decode(output)
|
|
70
|
-
|
|
71
|
-
return output
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
// private method for UTF-8 encoding
|
|
75
|
-
_utf8_encode (string) {
|
|
76
|
-
string = string.replace(/\r\n/g, '\n')
|
|
77
|
-
let utftext = ''
|
|
78
|
-
|
|
79
|
-
for (let n = 0; n < string.length; n++) {
|
|
80
|
-
const c = string.charCodeAt(n)
|
|
81
|
-
|
|
82
|
-
if (c < 128) {
|
|
83
|
-
utftext += String.fromCharCode(c)
|
|
84
|
-
} else if ((c > 127) && (c < 2048)) {
|
|
85
|
-
utftext += String.fromCharCode((c >> 6) | 192)
|
|
86
|
-
utftext += String.fromCharCode((c & 63) | 128)
|
|
87
|
-
} else {
|
|
88
|
-
utftext += String.fromCharCode((c >> 12) | 224)
|
|
89
|
-
utftext += String.fromCharCode(((c >> 6) & 63) | 128)
|
|
90
|
-
utftext += String.fromCharCode((c & 63) | 128)
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return utftext
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
// private method for UTF-8 decoding
|
|
98
|
-
_utf8_decode (utftext) {
|
|
99
|
-
let c1, c2, c3
|
|
100
|
-
let string = ''
|
|
101
|
-
let i = 0
|
|
102
|
-
let c = c1 = c2 = 0
|
|
103
|
-
|
|
104
|
-
while (i < utftext.length) {
|
|
105
|
-
c = utftext.charCodeAt(i)
|
|
106
|
-
|
|
107
|
-
if (c < 128) {
|
|
108
|
-
string += String.fromCharCode(c)
|
|
109
|
-
i++
|
|
110
|
-
} else if ((c > 191) && (c < 224)) {
|
|
111
|
-
c2 = utftext.charCodeAt(i + 1)
|
|
112
|
-
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63))
|
|
113
|
-
i += 2
|
|
114
|
-
} else {
|
|
115
|
-
c2 = utftext.charCodeAt(i + 1)
|
|
116
|
-
c3 = utftext.charCodeAt(i + 2)
|
|
117
|
-
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63))
|
|
118
|
-
i += 3
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return string
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export default Base64
|