8 changed files with 7482 additions and 72 deletions
@ -1,65 +1,65 @@
@@ -1,65 +1,65 @@
|
||||
{ |
||||
"description": "项目配置文件", |
||||
"miniprogramRoot": "src/", |
||||
"compileType": "miniprogram", |
||||
"setting": { |
||||
"useCompilerPlugins": [ |
||||
"typescript", |
||||
"sass" |
||||
], |
||||
"babelSetting": { |
||||
"ignore": [], |
||||
"disablePlugins": [], |
||||
"outputPath": "" |
||||
}, |
||||
"coverView": false, |
||||
"postcss": false, |
||||
"minified": false, |
||||
"enhance": true, |
||||
"showShadowRootInWxmlPanel": false, |
||||
"packNpmManually": true, |
||||
"packNpmRelationList": [ |
||||
{ |
||||
"packageJsonPath": "package.json", |
||||
"miniprogramNpmDistDir": "./src" |
||||
} |
||||
], |
||||
"ignoreUploadUnusedFiles": true, |
||||
"compileHotReLoad": false, |
||||
"skylineRenderEnable": true, |
||||
"es6": true |
||||
}, |
||||
"simulatorType": "wechat", |
||||
"simulatorPluginLibVersion": {}, |
||||
"condition": {}, |
||||
"srcMiniprogramRoot": "src/", |
||||
"editorSetting": { |
||||
"tabIndent": "insertSpaces", |
||||
"tabSize": 2 |
||||
}, |
||||
"libVersion": "2.32.3", |
||||
"ignore": [], |
||||
"packOptions": { |
||||
"ignore": [ |
||||
{ |
||||
"value": "src/images/*.*", |
||||
"type": "glob" |
||||
}, |
||||
{ |
||||
"value": "src/images/**/*.*", |
||||
"type": "glob" |
||||
}, |
||||
{ |
||||
"value": "src/images/**/**/*.*", |
||||
"type": "glob" |
||||
} |
||||
], |
||||
"include": [ |
||||
{ |
||||
"value": "src/images/tabbar/*.*", |
||||
"type": "glob" |
||||
} |
||||
] |
||||
}, |
||||
"appid": "wxa4a28b299df7d921" |
||||
{ |
||||
"description": "项目配置文件", |
||||
"miniprogramRoot": "src/", |
||||
"compileType": "miniprogram", |
||||
"setting": { |
||||
"useCompilerPlugins": [ |
||||
"typescript", |
||||
"sass" |
||||
], |
||||
"babelSetting": { |
||||
"ignore": [], |
||||
"disablePlugins": [], |
||||
"outputPath": "" |
||||
}, |
||||
"coverView": false, |
||||
"postcss": false, |
||||
"minified": false, |
||||
"enhance": true, |
||||
"showShadowRootInWxmlPanel": false, |
||||
"packNpmManually": true, |
||||
"packNpmRelationList": [ |
||||
{ |
||||
"packageJsonPath": "package.json", |
||||
"miniprogramNpmDistDir": "./src" |
||||
} |
||||
], |
||||
"ignoreUploadUnusedFiles": true, |
||||
"compileHotReLoad": false, |
||||
"skylineRenderEnable": true, |
||||
"es6": true |
||||
}, |
||||
"simulatorType": "wechat", |
||||
"simulatorPluginLibVersion": {}, |
||||
"condition": {}, |
||||
"srcMiniprogramRoot": "src/", |
||||
"editorSetting": { |
||||
"tabIndent": "insertSpaces", |
||||
"tabSize": 2 |
||||
}, |
||||
"libVersion": "2.32.3", |
||||
"ignore": [], |
||||
"packOptions": { |
||||
"ignore": [ |
||||
{ |
||||
"value": "src/images/*.*", |
||||
"type": "glob" |
||||
}, |
||||
{ |
||||
"value": "src/images/**/*.*", |
||||
"type": "glob" |
||||
}, |
||||
{ |
||||
"value": "src/images/**/**/*.*", |
||||
"type": "glob" |
||||
} |
||||
], |
||||
"include": [ |
||||
{ |
||||
"value": "src/images/tabbar/*.*", |
||||
"type": "glob" |
||||
} |
||||
] |
||||
}, |
||||
"appid": "wxbdf6f933281b1eb4" |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
import CryptoJS from 'crypto-js'; |
||||
// 使用密钥长度128的RIJNDAEL算法解码数据,加密模式:ECB
|
||||
|
||||
const key = 'hbsaas1mobile2a6f8'; |
||||
|
||||
// 解密函数
|
||||
export function decryptData(encryptedData) { |
||||
// Step 1: 替换 base64 字符中的 "+" 和 "/" 为 URL 安全的字符
|
||||
encryptedData = encryptedData.replace(/-/g, '+').replace(/_/g, '/'); |
||||
|
||||
// Step 2: 解码 base64 数据
|
||||
const decodedData = CryptoJS.enc.Base64.parse(encryptedData); |
||||
|
||||
// Step 3: 填充 key,确保它的长度为 24 字节(128 位)
|
||||
let paddedKey = key; |
||||
const keyLength = paddedKey.length; |
||||
if (keyLength < 24) { |
||||
paddedKey = paddedKey.padEnd(24, '\0'); // 用零填充至 16 字节
|
||||
} |
||||
|
||||
// Step 4: 使用 AES ECB 模式解密
|
||||
const decryptedData = CryptoJS.AES.decrypt({ ciphertext: decodedData }, CryptoJS.enc.Utf8.parse(paddedKey), { |
||||
mode: CryptoJS.mode.ECB, |
||||
padding: CryptoJS.pad.Pkcs7, // 与 PHP 中的 PKCS5 padding 对应
|
||||
}); |
||||
|
||||
// Step 5: 转换解密结果为明文字符串
|
||||
return decryptedData.toString(CryptoJS.enc.Utf8); |
||||
} |
||||
|
||||
// 示例使用:
|
||||
// const encryptedData = "6QUbssj247RF6oIMf9nqT6F5LoYpAkFENy5wc572gws"; // 从 PHP 获取的加密数据
|
||||
// const decrypted = decryptData(encryptedData, key);
|
||||
// console.log(decrypted); // 输出解密后的数据
|
Loading…
Reference in new issue