refactor: 替换硬编码文本为多语言配置

替换了项目中所有硬编码的提示文案,将其统一迁移到多语言语言包中,包括授权、自定义页面、HTTP请求、分享、客服等模块的提示文本,提升项目的国际化可维护性
This commit is contained in:
2026-06-23 08:36:55 +08:00
parent 6c7f7d4837
commit 750ed2dac7
7 changed files with 123 additions and 53 deletions

View File

@@ -2,6 +2,7 @@ import Config from './config.js'
import Util from './util.js'
import store from '@/store/index.js'
import Platform from './platform.js'
import lang from './lang.js'
const { appType, appTypeName } = Platform.getPlatformInfo();
@@ -9,7 +10,7 @@ export default {
sendRequest(params) {
if (!Config.baseUrl) {
uni.showToast({
title: '未配置请求域名',
title: lang('http.domainNotConfigured'),
'icon': 'none',
duration: 10000
});
@@ -77,7 +78,7 @@ export default {
fail: (res) => {
if (res.errMsg && res.errMsg == 'request:fail url not in domain list') {
uni.showToast({
title: Config.baseUrl + '不在request 合法域名列表中',
title: lang('http.domainNotInList', { domain: Config.baseUrl }),
'icon': 'none',
duration: 10000
});
@@ -88,7 +89,7 @@ export default {
complete: (res) => {
if ((res.errMsg && res.errMsg != "request:ok") || (res.statusCode && [200, 500].indexOf(res.statusCode) == -1)) {
uni.showToast({
title: Config.baseUrl + '请求失败',
title: lang('http.requestFailed', { domain: Config.baseUrl }),
'icon': 'none',
duration: 10000
});
@@ -134,7 +135,7 @@ export default {
fail: (res) => {
if (res.errMsg && res.errMsg == 'request:fail url not in domain list') {
uni.showToast({
title: Config.baseUrl + '不在request 合法域名列表中',
title: lang('http.domainNotInList', { domain: Config.baseUrl }),
'icon': 'none',
duration: 10000
});
@@ -145,7 +146,7 @@ export default {
complete: (res) => {
if ((res.errMsg && res.errMsg != "request:ok") || (res.statusCode && [200, 500].indexOf(res.statusCode) == -1)) {
uni.showToast({
title: Config.baseUrl + '请求失败',
title: lang('http.requestFailed', { domain: Config.baseUrl }),
'icon': 'none',
duration: 10000
});