mix-public 1.1.2 → 1.1.3
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/README.md +2 -1
- package/customMethod/cryptoJS.js +2 -2
- package/customMethod/imageFormat.js +13 -5
- package/customMethod/publicLogic.js +2 -2
- package/main/mixappfunc.js +430 -520
- package/package.json +1 -1
- package/resource/crypto-js.js +1 -0
package/README.md
CHANGED
package/customMethod/cryptoJS.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @Author: Gui
|
|
3
3
|
* @Date: 2023-07-04 11:59:05
|
|
4
4
|
* @LastEditors: guicheng 1625811865@qq.com
|
|
5
|
-
* @LastEditTime: 2026-
|
|
5
|
+
* @LastEditTime: 2026-02-05 15:23:27
|
|
6
6
|
* @Description: kxs files
|
|
7
7
|
* @filePath:
|
|
8
8
|
*/
|
|
9
|
-
import CryptoJS from "crypto-js"
|
|
9
|
+
import CryptoJS from "../resource/crypto-js.js"
|
|
10
10
|
// 加密
|
|
11
11
|
export const mixLocalShakeDownEncrypt = function (message) {
|
|
12
12
|
const keyHex = CryptoJS.enc.Utf8.parse("2024SIG4W1SAVDTSA6OV0VN1G07PS3N5")
|
|
@@ -30,8 +30,8 @@ const dataURLtoBlob = function (base64) {
|
|
|
30
30
|
return new Blob([u8arr], { type: mime });
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
//
|
|
34
|
-
const getImgFile = async (imgData)=> {
|
|
33
|
+
// 获取文件,返回file对象
|
|
34
|
+
const getImgFile = async (imgData, type = "image/png", fileName = "mixImage.png")=> {
|
|
35
35
|
if (typeof imgData === "object") {
|
|
36
36
|
return Promise.resolve(imgData)
|
|
37
37
|
} else {
|
|
@@ -42,10 +42,10 @@ const getImgFile = async (imgData)=> {
|
|
|
42
42
|
xhr.responseType = "blob"
|
|
43
43
|
xhr.onload = async function (e) {
|
|
44
44
|
if (xhr.status == 200) {
|
|
45
|
-
const blob = new Blob([this.response], { type
|
|
45
|
+
const blob = new Blob([this.response], { type })
|
|
46
46
|
// Convert blob to File object
|
|
47
|
-
const file = new File([blob],
|
|
48
|
-
type
|
|
47
|
+
const file = new File([blob], fileName, {
|
|
48
|
+
type,
|
|
49
49
|
lastModified: new Date().getTime(),
|
|
50
50
|
})
|
|
51
51
|
|
|
@@ -172,6 +172,14 @@ export async function formatImage(imgPath, formatConfig){
|
|
|
172
172
|
})
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
export async function formatVideo(imgPath){
|
|
176
|
+
return new Promise((resolve, reject) => {
|
|
177
|
+
getImgFile(imgPath, "video/mp4", "mixVide.mp4").then(async(file)=>{
|
|
178
|
+
resolve(file)
|
|
179
|
+
})
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
|
|
175
183
|
export function scanQrcode(imgPath){
|
|
176
184
|
return new Promise((resolve, reject) => {
|
|
177
185
|
getImgFile(imgPath).then(file=>{
|
|
@@ -62,9 +62,9 @@ export const callMethod = (op) => {
|
|
|
62
62
|
webMethod && webMethod();
|
|
63
63
|
} else {
|
|
64
64
|
if (isAndroid || isHarmony) {
|
|
65
|
-
androidMethod ? androidMethod() : Func[methodName](mixJsonStringify(params));
|
|
65
|
+
androidMethod ? androidMethod(mixJsonStringify(params)) : Func[methodName](mixJsonStringify(params));
|
|
66
66
|
} else if (isIOS) {
|
|
67
|
-
iosMethod ? iosMethod() : window.webkit.messageHandlers[methodName].postMessage(
|
|
67
|
+
iosMethod ? iosMethod(mixJsonStringify(params)) : window.webkit.messageHandlers[methodName].postMessage(
|
|
68
68
|
mixJsonStringify(params)
|
|
69
69
|
);
|
|
70
70
|
}
|