8 changed files with 7482 additions and 72 deletions
@ -1,65 +1,65 @@ |
|||||||
{ |
{ |
||||||
"description": "项目配置文件", |
"description": "项目配置文件", |
||||||
"miniprogramRoot": "src/", |
"miniprogramRoot": "src/", |
||||||
"compileType": "miniprogram", |
"compileType": "miniprogram", |
||||||
"setting": { |
"setting": { |
||||||
"useCompilerPlugins": [ |
"useCompilerPlugins": [ |
||||||
"typescript", |
"typescript", |
||||||
"sass" |
"sass" |
||||||
], |
], |
||||||
"babelSetting": { |
"babelSetting": { |
||||||
"ignore": [], |
"ignore": [], |
||||||
"disablePlugins": [], |
"disablePlugins": [], |
||||||
"outputPath": "" |
"outputPath": "" |
||||||
}, |
}, |
||||||
"coverView": false, |
"coverView": false, |
||||||
"postcss": false, |
"postcss": false, |
||||||
"minified": false, |
"minified": false, |
||||||
"enhance": true, |
"enhance": true, |
||||||
"showShadowRootInWxmlPanel": false, |
"showShadowRootInWxmlPanel": false, |
||||||
"packNpmManually": true, |
"packNpmManually": true, |
||||||
"packNpmRelationList": [ |
"packNpmRelationList": [ |
||||||
{ |
{ |
||||||
"packageJsonPath": "package.json", |
"packageJsonPath": "package.json", |
||||||
"miniprogramNpmDistDir": "./src" |
"miniprogramNpmDistDir": "./src" |
||||||
} |
} |
||||||
], |
], |
||||||
"ignoreUploadUnusedFiles": true, |
"ignoreUploadUnusedFiles": true, |
||||||
"compileHotReLoad": false, |
"compileHotReLoad": false, |
||||||
"skylineRenderEnable": true, |
"skylineRenderEnable": true, |
||||||
"es6": true |
"es6": true |
||||||
}, |
}, |
||||||
"simulatorType": "wechat", |
"simulatorType": "wechat", |
||||||
"simulatorPluginLibVersion": {}, |
"simulatorPluginLibVersion": {}, |
||||||
"condition": {}, |
"condition": {}, |
||||||
"srcMiniprogramRoot": "src/", |
"srcMiniprogramRoot": "src/", |
||||||
"editorSetting": { |
"editorSetting": { |
||||||
"tabIndent": "insertSpaces", |
"tabIndent": "insertSpaces", |
||||||
"tabSize": 2 |
"tabSize": 2 |
||||||
}, |
}, |
||||||
"libVersion": "2.32.3", |
"libVersion": "2.32.3", |
||||||
"ignore": [], |
"ignore": [], |
||||||
"packOptions": { |
"packOptions": { |
||||||
"ignore": [ |
"ignore": [ |
||||||
{ |
{ |
||||||
"value": "src/images/*.*", |
"value": "src/images/*.*", |
||||||
"type": "glob" |
"type": "glob" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"value": "src/images/**/*.*", |
"value": "src/images/**/*.*", |
||||||
"type": "glob" |
"type": "glob" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"value": "src/images/**/**/*.*", |
"value": "src/images/**/**/*.*", |
||||||
"type": "glob" |
"type": "glob" |
||||||
} |
} |
||||||
], |
], |
||||||
"include": [ |
"include": [ |
||||||
{ |
{ |
||||||
"value": "src/images/tabbar/*.*", |
"value": "src/images/tabbar/*.*", |
||||||
"type": "glob" |
"type": "glob" |
||||||
} |
} |
||||||
] |
] |
||||||
}, |
}, |
||||||
"appid": "wxa4a28b299df7d921" |
"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 @@ |
|||||||
|
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