forked from github/dataease
Merge branch 'main' of github.com:dataease/dataease into main
This commit is contained in:
commit
c078c7b64a
@ -4,13 +4,13 @@
|
||||
<svg-icon class-name="international-icon" icon-class="language" />
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :disabled="language==='zh'" command="zh">
|
||||
<el-dropdown-item :disabled="language==='zh_CN'" command="zh_CN">
|
||||
简体
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="language==='tw'" command="tw">
|
||||
<el-dropdown-item :disabled="language==='zh_TW'" command="zh_TW">
|
||||
繁体
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="language==='en'" command="en">
|
||||
<el-dropdown-item :disabled="language==='en_US'" command="en_US">
|
||||
English
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item :disabled="language==='es'" command="es">
|
||||
|
@ -4,13 +4,11 @@ import Cookies from 'js-cookie'
|
||||
import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
|
||||
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang
|
||||
import elementTWLocale from 'element-ui/lib/locale/lang/zh-TW'// element-ui lang
|
||||
import elementEsLocale from 'element-ui/lib/locale/lang/es'// element-ui lang
|
||||
import elementJaLocale from 'element-ui/lib/locale/lang/ja'// element-ui lang
|
||||
|
||||
import enLocale from './en'
|
||||
import zhLocale from './zh'
|
||||
import twLocale from './tw'
|
||||
import esLocale from './es'
|
||||
import jaLocale from './ja'
|
||||
|
||||
import fuZh from 'fit2cloud-ui/src/locale/lang/zh-CN' // 加载fit2cloud的内容
|
||||
|
||||
import fuEn from 'fit2cloud-ui/src/locale/lang/en_US' // 加载fit2cloud的内容
|
||||
@ -18,27 +16,19 @@ import fuEn from 'fit2cloud-ui/src/locale/lang/en_US' // 加载fit2cloud的内
|
||||
Vue.use(VueI18n)
|
||||
|
||||
const messages = {
|
||||
en: {
|
||||
en_US: {
|
||||
...enLocale,
|
||||
...elementEnLocale,
|
||||
...fuEn
|
||||
},
|
||||
zh: {
|
||||
zh_CN: {
|
||||
...zhLocale,
|
||||
...elementZhLocale,
|
||||
...fuZh
|
||||
},
|
||||
tw: {
|
||||
zh_TW: {
|
||||
...twLocale,
|
||||
...elementTWLocale
|
||||
},
|
||||
es: {
|
||||
...esLocale,
|
||||
...elementEsLocale
|
||||
},
|
||||
ja: {
|
||||
...jaLocale,
|
||||
...elementJaLocale
|
||||
}
|
||||
}
|
||||
export function getLanguage() {
|
||||
@ -53,7 +43,7 @@ export function getLanguage() {
|
||||
return locale
|
||||
}
|
||||
}
|
||||
return 'zh'
|
||||
return 'zh_CN'
|
||||
}
|
||||
const i18n = new VueI18n({
|
||||
// set locale
|
||||
|
@ -4,6 +4,7 @@ import { resetRouter } from '@/router'
|
||||
import { format } from '@/utils/formatUi'
|
||||
import { getLanguage } from '@/lang/index'
|
||||
import Cookies from 'js-cookie'
|
||||
import router from '@/router'
|
||||
const getDefaultState = () => {
|
||||
return {
|
||||
token: getToken(),
|
||||
@ -101,6 +102,9 @@ const actions = {
|
||||
commit('SET_PERMISSIONS', permissions)
|
||||
|
||||
commit('SET_LANGUAGE', language)
|
||||
|
||||
// axios.defaults.headers.common['Accept-Language'] = language || 'zh_CN'
|
||||
// document.querySelector('html').setAttribute('lang', language || 'zh_CN')
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
@ -155,6 +159,7 @@ const actions = {
|
||||
setLanguage({ commit }, language) {
|
||||
languageApi(language).then(() => {
|
||||
commit('SET_LANGUAGE', language)
|
||||
router.go(0)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,10 @@ service.interceptors.request.use(
|
||||
if ((linkToken = getLinkToken()) !== null) {
|
||||
config.headers[LinkTokenKey] = linkToken
|
||||
}
|
||||
|
||||
if (store.getters.language) {
|
||||
config.headers['Accept-Language'] = store.getters.language
|
||||
}
|
||||
// 增加loading
|
||||
|
||||
config.loading && tryShowLoading(store.getters.currentPath)
|
||||
|
@ -32,8 +32,8 @@
|
||||
<div v-if="valid" class="auth-root-class">
|
||||
<span slot="footer">
|
||||
|
||||
<el-button v-if="!form.enablePwd" v-clipboard:copy="form.uri" v-clipboard:success="onCopy" v-clipboard:error="onError" type="primary">复制链接</el-button>
|
||||
<el-button v-if="form.enablePwd" v-clipboard:copy="form.uri + ' 密码: '+ form.pwd" v-clipboard:success="onCopy" v-clipboard:error="onError" type="primary">复制链接及密码</el-button>
|
||||
<el-button v-if="!form.enablePwd" v-clipboard:copy="form.uri" v-clipboard:success="onCopy" v-clipboard:error="onError" size="mini" type="primary">复制链接</el-button>
|
||||
<el-button v-if="form.enablePwd" v-clipboard:copy="form.uri + ' 密码: '+ form.pwd" v-clipboard:success="onCopy" v-clipboard:error="onError" size="mini" type="primary">复制链接及密码</el-button>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
@ -14,8 +14,8 @@
|
||||
</el-tabs>
|
||||
<div class="auth-root-class">
|
||||
<span slot="footer">
|
||||
<el-button @click="cancel">{{ $t('commons.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="save">{{ $t('commons.confirm') }}</el-button>
|
||||
<el-button size="mini" @click="cancel">{{ $t('commons.cancel') }}</el-button>
|
||||
<el-button type="primary" size="mini" @click="save">{{ $t('commons.confirm') }}</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -362,6 +362,10 @@ export default {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.ms-main-container {
|
||||
height: calc(100vh - 91px);
|
||||
}
|
||||
|
||||
.de-header {
|
||||
height: 35px !important;
|
||||
border-bottom: 1px solid #E6E6E6;
|
||||
|
Loading…
Reference in New Issue
Block a user