头像自动更新

This commit is contained in:
luyuan 2020-11-12 09:19:44 +08:00
parent 26b815e046
commit d9e0899264
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
4 changed files with 25 additions and 3 deletions

View File

@ -1049,3 +1049,13 @@ export async function getset() {
const res = await get('getset');
return res.data;
}
export async function setheadimg(src: string){
const res = await put(`member/${store.state.userinfo.memberid}`,{img: src});
console.log(res)
}
export async function setusername(src: string){
const res = await put(`member/${store.state.userinfo.memberid}`,{name: src});
console.log(res)
}

View File

@ -300,7 +300,7 @@ export default {
shijirenshu: "Actual number of live broadcast",
shijishichang: "Actual live broadcast duration",
cshipinyaoqiu1: "The video should be no longer than 10 minutes",
cshipinyaoqiu2: "Video size cannot exceed 500MB",
cshipinyaoqiu2: "Video size cannot exceed 500M",
shichangtishi:"",
renshutishi: '',
tixianzhu: "",

View File

@ -300,7 +300,7 @@ export default {
shijirenshu: "实际直播人数",
shijishichang: "实际直播时长",
cshipinyaoqiu1: "视频长度不能超过10分钟",
cshipinyaoqiu2: "视频大小不能超过500mb",
cshipinyaoqiu2: "视频大小不能超过500m",
shichangtishi:"",
renshutishi: '',
tixianzhu:"",

View File

@ -37,6 +37,7 @@
size="small"
v-model:value="userinfo.name"
:placeholder="lan.$t('shuruxinnicheng')"
@pressEnter="setname"
/>
</div>
</div>
@ -525,6 +526,8 @@ import {
interests,
putmember,
sendsms,
setheadimg,
setusername,
} from "@/api/index";
import { message } from "ant-design-vue";
import { useI18n } from "@/utils/i18n";
@ -971,6 +974,7 @@ export default defineComponent({
// picinfo.fileId=res.fileId
// picinfo.url=res.video.url
formData.value.img = res.video.url;
setheadimg(res.video.url);
}
function beforeVideoUpload(file: any){
@ -981,6 +985,13 @@ export default defineComponent({
}
return false;
}
function setname(){
setusername(formData.value.name).then(()=>{
showname.value = true;
})
}
// function selguojia(e: any){
// userinfo.value.countryValue = e;
// console.log(e)
@ -1029,7 +1040,8 @@ export default defineComponent({
lan,
interestslist,
isdisabled,
beforeVideoUpload
beforeVideoUpload,
setname
};
},
});