From 1cabf329d362818f9354fdf9d78e563ab1e9b366 Mon Sep 17 00:00:00 2001 From: coolxitech Date: Sat, 13 Dec 2025 16:59:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor(utils):=20=E7=AE=80=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8A=A0=E5=AF=86=E5=87=BD=E6=95=B0=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除不必要的变量赋值 - 直接返回加密结果 - 保持错误处理逻辑不变 --- src/utils/crypto.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/crypto.ts b/src/utils/crypto.ts index cd38ad8..b35c8a5 100644 --- a/src/utils/crypto.ts +++ b/src/utils/crypto.ts @@ -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) }