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 { service } from './service'
import { config } from './config' import { config } from './config'
import { useCache } from '@/hooks/web/useCache'
const { default_headers } = config const { default_headers } = config
const { wsCache } = useCache()
console.log('lang='+wsCache.get('lang'));
const language = wsCache.get('lang')
const request = (option: any) => { const request = (option: any) => {
const { url, method, params, data, headersType, responseType, ...config } = option const { url, method, params, data, headersType, responseType, ...config } = option
return service({ return service({
@ -14,7 +17,8 @@ const request = (option: any) => {
...config, ...config,
responseType: responseType, responseType: responseType,
headers: { 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: '简体中文' name: '简体中文'
}, },
{ {
lang: 'en', lang: 'en-US',
name: 'English' name: 'English'
} }
] ]

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

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

Loading…
Cancel
Save