默认语言
This commit is contained in:
parent
817a67b1ca
commit
dd08807e8e
@ -80,11 +80,15 @@ const put: Get = async function (url: string, data?: unknown){
|
||||
function setToken(){
|
||||
axios.defaults.headers.common['Authorization'] = "Bearer " + getValue("token");
|
||||
}
|
||||
function setLanvuage(yuyan: string){
|
||||
axios.defaults.headers.common['Language'] = yuyan;
|
||||
}
|
||||
|
||||
export {
|
||||
get,
|
||||
post,
|
||||
del,
|
||||
put,
|
||||
setToken
|
||||
setToken,
|
||||
setLanvuage
|
||||
}
|
@ -208,6 +208,7 @@ import { computed, defineComponent, onMounted, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import axios from 'axios'
|
||||
import { useI18n } from '@/utils/i18n';
|
||||
import { setLanvuage } from '@/api/base';
|
||||
|
||||
export default defineComponent({
|
||||
props:{
|
||||
@ -318,8 +319,13 @@ export default defineComponent({
|
||||
}
|
||||
function setlanguage(e?: any){
|
||||
console.log(e)
|
||||
editsystemsetting({language:e})
|
||||
if(store.state.islogin){
|
||||
editsystemsetting({language:e})
|
||||
}else {
|
||||
setLanvuage(e)
|
||||
}
|
||||
lan.locale.value = e
|
||||
|
||||
}
|
||||
function toindex(){
|
||||
router.push("/")
|
||||
|
Loading…
Reference in New Issue
Block a user