xbx #29
@ -10,6 +10,19 @@ export function sendsms(phone: string, type?: number){
|
|||||||
return post('SendSms',{phone, type})
|
return post('SendSms',{phone, type})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名密码登录
|
||||||
|
* @param phone 手机号
|
||||||
|
* @param password 密码
|
||||||
|
*/
|
||||||
|
|
||||||
export function loginpass(phone: string, password: string){
|
export function loginpass(phone: string, password: string){
|
||||||
return post("login",{type: 2,username: phone, password: password})
|
return post("login",{type: 2,username: phone, password: password})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息详情
|
||||||
|
*/
|
||||||
|
export function userinfo(){
|
||||||
|
return get('personalInfo')
|
||||||
|
}
|
@ -117,6 +117,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { userinfo } from '@/api';
|
||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
import { defineComponent, ref } from 'vue';
|
import { defineComponent, ref } from 'vue';
|
||||||
|
|
||||||
@ -181,6 +182,10 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userinfo().then((res)=>{
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
return{
|
return{
|
||||||
list,
|
list,
|
||||||
routeto,
|
routeto,
|
||||||
|
@ -2,8 +2,15 @@ import { createStore } from 'vuex'
|
|||||||
|
|
||||||
export default createStore({
|
export default createStore({
|
||||||
state: {
|
state: {
|
||||||
|
userinfo:{
|
||||||
|
name: "",
|
||||||
|
img: ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
setUserInfo(state, userinfo){
|
||||||
|
state.userinfo = userinfo
|
||||||
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
},
|
},
|
||||||
|
7
src/types/index.d.ts
vendored
7
src/types/index.d.ts
vendored
@ -21,8 +21,9 @@ export interface VideoInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 返回数据
|
// 返回数据
|
||||||
export interface ResData{
|
export interface ResData<T = any>{
|
||||||
code?: number;
|
code?: number;
|
||||||
msg?: string;
|
msg?: string;
|
||||||
data?: any;
|
data?: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user