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