Merge pull request 'xbx' (#115) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/115
This commit is contained in:
luyuan 2020-11-03 16:57:45 +08:00
commit 206db77c8c
5 changed files with 31 additions and 16 deletions

View File

@ -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
} }

View File

@ -20,8 +20,8 @@
<div style="overflow: hidden;"> <div style="overflow: hidden;">
<div class="item" :class="{'selbottom': selnum == list.length - 1}"></div> <div class="item" :class="{'selbottom': selnum == list.length - 1}"></div>
</div> </div>
<div class="item loginout"> <div class="item loginout" @click="logout">
<div class="route" @click="logout"> <div class="route">
<img src="../static/images/tuichu.png" alt="" class="icon"> <img src="../static/images/tuichu.png" alt="" class="icon">
<div class="title"> <div class="title">
{{lan.$t('tuichu')}} {{lan.$t('tuichu')}}
@ -210,6 +210,7 @@ export default defineComponent({
} }
function logout(): void{ function logout(): void{
console.log("退出")
store.commit("login", false) store.commit("login", false)
saveValue("token", ""); saveValue("token", "");
setToken(); setToken();

View File

@ -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)
editsystemsetting({language:e}) if(store.state.islogin){
editsystemsetting({language:e})
}else {
setLanvuage(e)
}
lan.locale.value = e lan.locale.value = e
} }
function toindex(){ function toindex(){
router.push("/") router.push("/")

View File

@ -146,7 +146,7 @@
<a-select-option <a-select-option
v-for="(item, index) in willsay" v-for="(item, index) in willsay"
:key="index" :key="index"
:value="item.languageid" :value="item.value"
> >
{{ item.name }} {{ item.name }}
</a-select-option> </a-select-option>
@ -224,6 +224,7 @@ import {
checksmscode, checksmscode,
getquhaolist, getquhaolist,
getwillsay, getwillsay,
interests,
register, register,
sendsms, sendsms,
} from "@/api"; } from "@/api";
@ -262,7 +263,7 @@ export default defineComponent({
name: "中国", name: "中国",
}, },
]); ]);
getwillsay().then((res) => { interests().then((res) => {
willsay.value = res; willsay.value = res;
}); });
onMounted(async () => { onMounted(async () => {
@ -482,7 +483,7 @@ export default defineComponent({
position: relative; position: relative;
z-index: 999; z-index: 999;
} }
.getcode { ::v-deep(.getcode) {
font-size: 15px; font-size: 15px;
color: #08ae98; color: #08ae98;
width: 313px; width: 313px;
@ -490,6 +491,9 @@ export default defineComponent({
line-height: 30px; line-height: 30px;
cursor: pointer; cursor: pointer;
} }
::v-deep(.ant-select-selection){
background-color: unset;
}
.orginfo { .orginfo {
margin-top: 178px; margin-top: 178px;
} }

View File

@ -47,7 +47,7 @@
<div class="label">{{ lan.$t("laiziguojia") }}</div> <div class="label">{{ lan.$t("laiziguojia") }}</div>
<a-select <a-select
v-model:value="userinfo.country" v-model:value="userinfo.country"
style="width: 171px" style="width: 1.71rem"
size="small" size="small"
ref="select" ref="select"
show-search show-search
@ -76,7 +76,7 @@
<div class="label">{{ lan.$t("jiaoshou") }}</div> <div class="label">{{ lan.$t("jiaoshou") }}</div>
<a-select <a-select
v-model:value="userinfo.tlanguageValue" v-model:value="userinfo.tlanguageValue"
style="width: 171px" style="width: 1.71rem"
size="small" size="small"
show-search show-search
ref="select" ref="select"
@ -104,7 +104,7 @@
> >
<a-select <a-select
v-model:value="lang.name" v-model:value="lang.name"
style="width: 171px" style="width: 1.71rem"
size="small" size="small"
ref="select" ref="select"
show-search show-search
@ -155,7 +155,7 @@
<div class="label">{{ lan.$t("muyu") }}</div> <div class="label">{{ lan.$t("muyu") }}</div>
<!-- <a-select <!-- <a-select
v-model:value="userinfo.mtongue" v-model:value="userinfo.mtongue"
style="width: 171px" style="width: 1.71rem"
size="small" size="small"
ref="select" ref="select"
:getPopupContainer="triggerNode => triggerNode.parentNode" :getPopupContainer="triggerNode => triggerNode.parentNode"
@ -252,7 +252,7 @@
<div class="label">{{ lan.$t("shiqu") }}</div> <div class="label">{{ lan.$t("shiqu") }}</div>
<a-select <a-select
v-model:value="userinfo.zoneStr" v-model:value="userinfo.zoneStr"
style="width: 171px" style="width: 1.71rem"
size="small" size="small"
ref="select" ref="select"
show-search show-search
@ -272,7 +272,7 @@
<div class="input-box currency-box"> <div class="input-box currency-box">
<div class="label">{{ lan.$t("huobi") }}</div> <div class="label">{{ lan.$t("huobi") }}</div>
<a-select <a-select
style="width: 171px" style="width: 1.71rem"
size="small" size="small"
ref="select" ref="select"
:getPopupContainer=" :getPopupContainer="
@ -294,7 +294,7 @@
<div class="label">{{ lan.$t("yuyan") }}</div> <div class="label">{{ lan.$t("yuyan") }}</div>
<a-select <a-select
v-model:value="userinfo.languageValue" v-model:value="userinfo.languageValue"
style="width: 171px" style="width: 1.71rem"
size="small" size="small"
ref="select" ref="select"
:getPopupContainer=" :getPopupContainer="
@ -1063,7 +1063,7 @@ export default defineComponent({
align-self: flex-start; align-self: flex-start;
} }
.ant-input { .ant-input {
width: 171px; width: 1.71rem;
padding: 6px 11px; padding: 6px 11px;
border-radius: 3px; border-radius: 3px;
border: 1px solid #dcdfe0; border: 1px solid #dcdfe0;
@ -1119,7 +1119,7 @@ export default defineComponent({
} }
.video-lang { .video-lang {
.upload-image { .upload-image {
width: 171px; width: 1.71rem;
height: 96px; height: 96px;
border: 1px solid #dcdfe0; border: 1px solid #dcdfe0;
border-radius: 3px; border-radius: 3px;