个人档案修改
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import router from '@/router';
|
||||
import store from '@/store';
|
||||
import { LiveList, LivelistInfo, LoginData, UserInfo, VideoInfo } from '@/types';
|
||||
import { LiveList, LivelistInfo, LoginData, UserInfo } from '@/types';
|
||||
import { saveValue } from '@/utils/common';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { del, get, post, put, setToken } from './base'
|
||||
@@ -40,26 +40,7 @@ export async function userinfo(){
|
||||
router.push("/")
|
||||
return '未登录';
|
||||
}
|
||||
return {
|
||||
head: user.data.img,
|
||||
username: user.data.name,
|
||||
language: user.data.language,
|
||||
currency: user.data.currency,
|
||||
zoneStr: user.data.zoneStr,
|
||||
memberid: user.data.memberid,
|
||||
country: user.data.country,
|
||||
live: user.data.live,
|
||||
mtongue: user.data.mtongue,
|
||||
tlanguage: user.data.tlanguage,
|
||||
willsay: user.data.willsay,
|
||||
interest: user.data.interest,
|
||||
mobile: user.data.mobile,
|
||||
email: user.data.email,
|
||||
birthday: user.data.birthday,
|
||||
video: user.data.video,
|
||||
desc: user.data.desc,
|
||||
money: user.data.money
|
||||
}
|
||||
return user.data;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,11 +105,16 @@ interface VideoList{
|
||||
updated_at: string;
|
||||
statusname: string;
|
||||
}
|
||||
|
||||
export async function getvideolist(): Promise<VideoList[]> {
|
||||
const res = await get<Array<VideoList>>('video')
|
||||
interface VideoListInfo {
|
||||
data: VideoList[];
|
||||
code: number;
|
||||
msg: string;
|
||||
total: number;
|
||||
}
|
||||
export async function getvideolist(data?:any): Promise<VideoListInfo>{
|
||||
const res = await get<Array<VideoList>>('video',data)
|
||||
console.log(res)
|
||||
return res.data
|
||||
return res
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -376,7 +362,7 @@ export async function deleteaccount(data:any) {
|
||||
|
||||
/**
|
||||
*
|
||||
* 交易明细
|
||||
* 交易明细 详情
|
||||
*/
|
||||
interface TransactionInfo{
|
||||
accountid:number,
|
||||
@@ -397,6 +383,28 @@ export async function transactioninfo(data?: any){
|
||||
return res.data
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*/
|
||||
export async function editpassword(data?:any) :Promise<void> {
|
||||
console.log(data,111)
|
||||
const newdata={
|
||||
memberid:0,
|
||||
password:"",
|
||||
topassword:""
|
||||
}
|
||||
newdata.memberid=store.state.userinfo.memberid
|
||||
newdata.password=data.password
|
||||
newdata.topassword=data.topassword
|
||||
console.log(newdata)
|
||||
const res = await post<Liveaddrule>('resetPassword',newdata)
|
||||
if(res.code==0){
|
||||
message.success("修改成功")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
* @param phone 手机号
|
||||
@@ -465,8 +473,30 @@ export async function getlanguages(): Promise<Language[]>{
|
||||
* 修改我的档案
|
||||
*/
|
||||
|
||||
export async function putmember(data: unknown): Promise<Liveaddrule>{
|
||||
return (await put<Liveaddrule>(`member/${store.state.userinfo.memberid}`, data) )
|
||||
// export async function putmember(data: unknown): Promise<Liveaddrule>{
|
||||
|
||||
export async function putmember(data: any): Promise<any>{
|
||||
console.log(data)
|
||||
const newdata={
|
||||
name:data.name,
|
||||
mobile:data.mobile,
|
||||
img:data.img,
|
||||
country:data.countryValue,
|
||||
live:data.live,
|
||||
mtongue:data.mtongue,
|
||||
email:data.email,
|
||||
interest:JSON.stringify(data.interest),
|
||||
willsay:JSON.stringify(data.willsayValue),
|
||||
birthday:data.birthday,
|
||||
zoneid:data.zoneid,
|
||||
currency:data.currencyValue,
|
||||
language:data.languageValue,
|
||||
tlanguage:data.tlanguageValue,
|
||||
video:data.video,
|
||||
desc:data.desc
|
||||
}
|
||||
console.log(newdata)
|
||||
return (await put<Liveaddrule>(`member/${store.state.userinfo.memberid}`, newdata) )
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user