From 43fd28452e29ba95a13f72c6cdf5b5a900d6c42b Mon Sep 17 00:00:00 2001 From: zhouhaibin Date: Fri, 28 Jun 2024 16:10:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=89=8D=E7=AB=AF=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=8A=A5=E9=94=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 1 + src/api/system/user/index.ts | 4 +++- src/locales/setupI18n.ts | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env.development b/.env.development index 12912cd..9b5fc16 100644 --- a/.env.development +++ b/.env.development @@ -6,6 +6,7 @@ VITE_GLOB_API_URL=/basic-api # 全局加密开关(即开启了加解密功能才会生效 不是全部接口加密 需要和后端对应) VITE_GLOB_ENABLE_ENCRYPT=true +# VITE_APP_ENCRYPT=true # RSA公钥 请求加密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对 VITE_GLOB_RSA_PUBLIC_KEY=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ== # RSA私钥 响应解密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对 diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 0ec23d5..7eb46e2 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -74,7 +74,9 @@ export function userAdd(data: any) { } export function userUpdate(data: any) { - return defHttp.putWithMsg({ url: Api.root, data }); + return defHttp.putWithMsg({ url: Api.root, data },{ + encrypt: true, + },); } export function userStatusChange(data: any) { diff --git a/src/locales/setupI18n.ts b/src/locales/setupI18n.ts index 80f9c6c..ae6d71e 100644 --- a/src/locales/setupI18n.ts +++ b/src/locales/setupI18n.ts @@ -13,7 +13,7 @@ export let i18n: ReturnType; async function createI18nOptions(): Promise { const localeStore = useLocaleStoreWithOut(); const locale = localeStore.getLocale; - const defaultLocal = await import(`./lang/${locale}.ts`); + const defaultLocal = await import(`./lang/${locale}`); const message = defaultLocal.default?.message ?? {}; setHtmlPageLang(locale);