diff --git a/src/api/v1/i18n.ts b/src/api/v1/i18n.ts index f2bcab1..dc9fb90 100644 --- a/src/api/v1/i18n.ts +++ b/src/api/v1/i18n.ts @@ -26,6 +26,11 @@ export const fetchUpdateI18n = (data: any) => { return http.request>('put', 'i18n/updateI18n', { data }); }; +/** 多语言类型管理---用文件更新多语言 */ +export const updateI18nByFile = (data: any) => { + return http.request>('put', 'i18n/updateI18nByFile', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); +}; + /** 多语言类型管理---删除多语言 */ export const fetchDeleteI18n = (data: any) => { return http.request>('delete', 'i18n/deleteI18n', { data }); diff --git a/src/store/i18n/i18n.ts b/src/store/i18n/i18n.ts index 881409a..7090a46 100644 --- a/src/store/i18n/i18n.ts +++ b/src/store/i18n/i18n.ts @@ -1,9 +1,9 @@ -import { defineStore } from 'pinia'; -import { fetchAddI18n, fetchDeleteI18n, fetchDownloadI18nSetting, fetchGetI18n, fetchGetI18nList, fetchUpdateI18n } from '@/api/v1/i18n'; +import { fetchAddI18n, fetchDeleteI18n, fetchDownloadI18nSetting, fetchGetI18n, fetchGetI18nList, fetchUpdateI18n, updateI18nByFile } from '@/api/v1/i18n'; import { pageSizes } from '@/enums/baseConstant'; -import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; +import { storeMessage } from '@/utils/message'; import { download } from '@/utils/sso'; +import { defineStore } from 'pinia'; export const userI18nStore = defineStore('i18nStore', { persist: true, @@ -71,6 +71,12 @@ export const userI18nStore = defineStore('i18nStore', { return storeMessage(result); }, + /* 用文件更新多语言 */ + async updateI18nByFile(data: any) { + const result = await updateI18nByFile(data); + return storeMessage(result); + }, + /** 更新多语言 */ async updateI18n(data: any) { const result = await fetchUpdateI18n(data); diff --git a/src/views/i18n/i18n-setting/index.vue b/src/views/i18n/i18n-setting/index.vue index c46ae4c..38daf86 100644 --- a/src/views/i18n/i18n-setting/index.vue +++ b/src/views/i18n/i18n-setting/index.vue @@ -1,7 +1,7 @@