From c635d78b479510ebe2556a420948effcd30a0731 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期六, 21 十二月 2024 18:40:43 +0800 Subject: [PATCH] 新建德森项目分支 --- zy-asrs-admin/src/utils/localeUtils.js | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/zy-asrs-admin/src/utils/localeUtils.js b/zy-asrs-admin/src/utils/localeUtils.js index fd4236c..f9d2882 100644 --- a/zy-asrs-admin/src/utils/localeUtils.js +++ b/zy-asrs-admin/src/utils/localeUtils.js @@ -1,21 +1,21 @@ -import { globalState } from '../config.js' -import { post } from '@/utils/request.js' - -export const formatMessage = (id, defaultMessage) => { - const message = globalState.localeData; - if(message == null) { - return defaultMessage; - } - if(message[id] == null || message[id] == undefined) { - return defaultMessage; - } - return message[id]; -} - -export const loadData = async (locale) => { - let resp = await post('/api/language/json',{ - locale: locale - }) - let result = resp.data; - globalState.localeData = result.data; +import { globalState } from '../config.js' +import { post } from '@/utils/request.js' + +export const formatMessage = (id, defaultMessage) => { + const message = globalState.localeData; + if(message == null) { + return defaultMessage; + } + if(message[id] == null || message[id] == undefined) { + return defaultMessage; + } + return message[id]; +} + +export const loadData = async (locale) => { + let resp = await post('/api/language/json',{ + locale: locale + }) + let result = resp.data; + globalState.localeData = result.data; } \ No newline at end of file -- Gitblit v1.9.1