xbx #29

Merged
theluyuan merged 5 commits from xbx into master 2020-10-10 06:08:46 +00:00
4 changed files with 29 additions and 3 deletions
Showing only changes of commit 8bf7b662d5 - Show all commits

View File

@ -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')
}

View File

@ -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,

View File

@ -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: {
}, },

View File

@ -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;
} }