9
This commit is contained in:
1125
package-lock.json
generated
1125
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
7
src/lang/en_us.js
Normal file
7
src/lang/en_us.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
// en_us.js文件
|
||||||
|
export default {
|
||||||
|
app: {
|
||||||
|
hello: 'Hello,World!'
|
||||||
|
}
|
||||||
|
}
|
||||||
36
src/lang/index.js
Normal file
36
src/lang/index.js
Normal 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
6
src/lang/zh_cn.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
// zh_cn.js文件
|
||||||
|
export default {
|
||||||
|
app: {
|
||||||
|
hello: '你好,世界!'
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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'),
|
||||||
|
|||||||
Reference in New Issue
Block a user