This commit is contained in:
星河下的稻草人
2024-03-06 20:59:01 +08:00
parent 755f0cd208
commit c595061dc8
6 changed files with 1057 additions and 125 deletions

1125
package-lock.json generated

File diff suppressed because it is too large Load Diff

7
src/lang/en_us.js Normal file
View File

@@ -0,0 +1,7 @@
// en_us.js文件
export default {
app: {
hello: 'HelloWorld!'
}
}

36
src/lang/index.js Normal file
View File

@@ -0,0 +1,36 @@
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import {Locale} from 'vant'
import enUS from 'vant/lib/locale/lang/en-US'
import zhCN from 'vant/lib/locale/lang/zh-CN'
import enLocale from './en_us'
import zhLocale from './zh_cn'
Vue.use(VueI18n)
const messages = {
en: {
...enUS,
...enLocale
},
zh: {
...zhCN,
...zhLocale
}
}
const i18n = new VueI18n({
locale: 'zh', // 设置默认语言
messages: messages // 设置资源文件对象
})
// 更新vant组件库本身的语言变化支持国际化
function vantLocales (lang) {
if (lang === 'en') {
Locale.use(lang, enUS)
} else if (lang === 'zh') {
Locale.use(lang, zhCN)
}
}
export {i18n, vantLocales}

6
src/lang/zh_cn.js Normal file
View File

@@ -0,0 +1,6 @@
// zh_cn.js文件
export default {
app: {
hello: '你好,世界!'
}
}

View File

@@ -138,8 +138,9 @@ const transform: AxiosTransform = {
if(config.url && config.url.endsWith("domain.txt")){ if(config.url && config.url.endsWith("domain.txt")){
return config return config
}else if(domain && domain.length > 0){ }else if(domain && domain.length > 0){
let domainUrl = domain[Math.floor((Math.random()*domain.length))]; // let domainUrl = domain[Math.floor((Math.random()*domain.length))];
config.url = domainUrl + config.url; // config.url = domainUrl + config.url;
// config.url = domainUrl + config.url;
}else if(apiUrl && isString(apiUrl)){ }else if(apiUrl && isString(apiUrl)){
config.url = `${apiUrl}${config.url}`; config.url = `${apiUrl}${config.url}`;
} }

View File

@@ -38,7 +38,8 @@ export default defineConfig({
port: 9528, port: 9528,
proxy: { proxy: {
'/api': { '/api': {
target: 'http://localhost:8887', target: ' http://dk.qiqizl.com',
// target: 'http://localhost:8887',
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
rewrite: (path) => path.replace(new RegExp(`^/api`), '/api'), rewrite: (path) => path.replace(new RegExp(`^/api`), '/api'),