mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
refactor(utils): 简化数据加密函数实现
- 移除不必要的变量赋值 - 直接返回加密结果 - 保持错误处理逻辑不变
This commit is contained in:
@@ -5,8 +5,7 @@ import pkg from '../../package.json'
|
||||
export const encryptData = (data: any): string => {
|
||||
try {
|
||||
const jsonStr = JSON.stringify(data)
|
||||
const encrypted = CryptoJS.AES.encrypt(jsonStr, pkg.name).toString()
|
||||
return encrypted
|
||||
return CryptoJS.AES.encrypt(jsonStr, pkg.name).toString()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user