手机号登录

This commit is contained in:
asd
2020-10-22 09:12:24 +08:00
parent 20e9a56e03
commit f0fde71145
5 changed files with 162 additions and 22 deletions

View File

@@ -12,8 +12,15 @@ import { del, get, post, put, setToken } from './base'
* @param password 密码
*/
export async function loginpass(phone: string, password: string){
const res = await post<LoginData>("login",{type: 2,username: phone, password: password});
export async function loginpass(phone: string, password: string,type?:number,smscode?:string){
let newdata={}
if(type==1){
newdata={type:type?type:2,username: phone, smscode: smscode}
}else{
newdata={type:type?type:2,username: phone, password: password}
}
const res = await post<LoginData>("login",newdata);
console.log(res.code)
if(res.code == 1){
message.error(res.msg)
@@ -576,6 +583,16 @@ export async function checkuser(data?:any){
}
}
/**
* 获取区号列表
*/
export async function getquhaolist() {
const res=await get("phonecodes")
// console.log(res)
return res.data
}
/**
* 发送验证码
* @param phone 手机号
@@ -746,7 +763,20 @@ export async function cancellive(id: number, status: number){
}
}
/**
* 修改手机号
*/
export async function changetel(e:string) {
const res = await put(`member/${store.state.userinfo.memberid}`,{mobile:e});
console.log(res)
if(res.code == 0){
message.success("修改成功")
return true;
}else{
message.error(res.msg);
return false;
}
}
/**