From f85fc8a926e2dc093d95cbfc2e871f98dddbfe4b Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Tue, 3 Nov 2020 17:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=93=B6=E8=A1=8C=E5=8D=A1?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 2 ++ src/utils/i18n.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index bde7e35..9e94f61 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -287,6 +287,7 @@ export async function accountadd(data?: any) { const res = await post('wallect',data); if(res.code==0){ message.success("新增成功") + router.push("/mine/wallet") } console.log(res) @@ -394,6 +395,7 @@ export async function deleteaccount(data: any) { const res = await del('wallect/' + data); if(res.code==0){ message.success("删除成功") + router.push("/mine/wallet") } console.log(res) diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index a2e7ad4..71d4cde 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -22,9 +22,9 @@ const createI18n = (config: Config) => ({ }); const i18nSymbol = Symbol(); - +let i18n: any; export function provideI18n(i18nConfig: Config) { - const i18n = createI18n(i18nConfig); + i18n = createI18n(i18nConfig); provide(i18nSymbol, i18n); return i18n; } @@ -33,5 +33,9 @@ export function useI18n() { const i18n = inject(i18nSymbol); if (!i18n) throw new Error("No i18n provided!!!"); + return i18n; +} + +export function geti18n(){ return i18n; } \ No newline at end of file