Browse Source

开启前端加密,修改报错信息

dev
zhouhaibin 3 months ago
parent
commit
43fd28452e
  1. 1
      .env.development
  2. 4
      src/api/system/user/index.ts
  3. 2
      src/locales/setupI18n.ts

1
.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公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对

4
src/api/system/user/index.ts

@ -74,7 +74,9 @@ export function userAdd(data: any) {
}
export function userUpdate(data: any) {
return defHttp.putWithMsg<void>({ url: Api.root, data });
return defHttp.putWithMsg<void>({ url: Api.root, data },{
encrypt: true,
},);
}
export function userStatusChange(data: any) {

2
src/locales/setupI18n.ts

@ -13,7 +13,7 @@ export let i18n: ReturnType<typeof createI18n>;
async function createI18nOptions(): Promise<I18nOptions> {
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);

Loading…
Cancel
Save