Browse Source

en改成EN-US

master
zhangli 1 year ago
parent
commit
d2fe479daa
  1. 8
      src/config/axios/index.ts
  2. 0
      src/locales/en-US.ts
  3. 2
      src/store/modules/locale.ts
  4. 2
      src/views/Login/components/LoginForm.vue

8
src/config/axios/index.ts

@ -1,9 +1,12 @@
import { service } from './service'
import { config } from './config'
import { useCache } from '@/hooks/web/useCache'
const { default_headers } = config
const { wsCache } = useCache()
console.log('lang='+wsCache.get('lang'));
const language = wsCache.get('lang')
const request = (option: any) => {
const { url, method, params, data, headersType, responseType, ...config } = option
return service({
@ -14,7 +17,8 @@ const request = (option: any) => {
...config,
responseType: responseType,
headers: {
'Content-Type': headersType || default_headers
'Content-Type': headersType || default_headers,
'language': language
}
})
}

0
src/locales/en.ts → src/locales/en-US.ts

2
src/store/modules/locale.ts

@ -30,7 +30,7 @@ export const useLocaleStore = defineStore('locales', {
name: '简体中文'
},
{
lang: 'en',
lang: 'en-US',
name: 'English'
}
]

2
src/views/Login/components/LoginForm.vue

@ -188,6 +188,7 @@ const handleLogin = async (params) => {
}
const res = await LoginApi.login(loginData.loginForm)
if (!res) {
getCode()
return
}
loading.value = ElLoading.service({
@ -212,6 +213,7 @@ const handleLogin = async (params) => {
push({ path: redirect.value || permissionStore.addRouters[0].path })
}
} finally {
getCode()
loginLoading.value = false
loading.value.close()
}

Loading…
Cancel
Save