From 41009afeec9295266e8c773eee4983d244eeab31 Mon Sep 17 00:00:00 2001 From: asd <374367073@qq.com> Date: Fri, 16 Oct 2020 19:12:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=A1=A3=E6=A1=88=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 86 ++++++++++++++++++++++----------- src/components/Menu.vue | 2 +- src/store/index.ts | 21 ++++---- src/views/mine/Archives.vue | 56 ++++++++++++--------- src/views/regime/Subscriber.vue | 7 ++- src/views/regime/Video.vue | 28 +++++++---- 6 files changed, 129 insertions(+), 71 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 52aeb32..ab70a8f 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -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 { - const res = await get>('video') +interface VideoListInfo { + data: VideoList[]; + code: number; + msg: string; + total: number; +} +export async function getvideolist(data?:any): Promise{ + const res = await get>('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 { + 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('resetPassword',newdata) + if(res.code==0){ + message.success("修改成功") + } +} + + + /** * 发送验证码 * @param phone 手机号 @@ -465,8 +473,30 @@ export async function getlanguages(): Promise{ * 修改我的档案 */ -export async function putmember(data: unknown): Promise{ - return (await put(`member/${store.state.userinfo.memberid}`, data) ) +// export async function putmember(data: unknown): Promise{ + +export async function putmember(data: any): Promise{ + 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(`member/${store.state.userinfo.memberid}`, newdata) ) } diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 1a22d07..d05431b 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -2,7 +2,7 @@
- +
@@ -162,7 +162,7 @@