陈龙 2 місяців тому
батько
коміт
23f687547e

+ 36 - 0
src/Auman.PieceWage.UniApp/utils/base64.js

@@ -0,0 +1,36 @@
+/**
+ * Base64加解码类
+ */
+class Base64 {
+    /**
+     * Base64编码
+     * @param {string} plaintext 明文
+     * @returns 密文
+     */
+    encode(plaintext) {
+        let res = '';
+
+        // 浏览器兼容
+        if (typeof btoa === 'function' && typeof unescape === 'function') {
+            res = btoa(unescape(encodeURIComponent(plaintext)));
+        }
+
+        return res;
+    }
+
+    /**
+     * Base64解码
+     * @param {string} cipherText 密文
+     * @returns 明文
+     */
+    decode(cipherText) {
+        let res = '';
+
+        // 浏览器兼容
+        if (typeof btoa === 'function' && typeof escape === 'function') {
+            res = decodeURIComponent(escape(atob(cipherText)));
+        }
+        return res;
+    }
+}
+export default new Base64();

Різницю між файлами не показано, бо вона завелика
+ 89 - 0
src/Auman.PieceWage.UniApp/utils/oldbase64.js


Деякі файли не було показано, через те що забагато файлів було змінено