Commit 8ee18287 authored by hanfeng zhang's avatar hanfeng zhang

321

parent 42937986
import {Service} from './Service'
import {LoginDto} from '@/types/Dto'
import { token } from '@/util/userInfoUtils'
export class UserService extends Service {
router = {
sendCode:{ path:'/verificationCode/send/sms', dataType:'application/x-www-form-urlencoded'},
login:{ path:'/user/login'},
isRegisterd:{ path:'/user/isRegister', dataType:'application/x-www-form-urlencoded'},
isPwdSet:{ path:'/user/isSetPassword', dataType:'application/x-www-form-urlencoded'},
userInfo:{ path:'/user/detail',dataType:'application/x-www-form-urlencoded'}
}
constructor(){
super()
}
private getAuth(){
return 'Bearer '+ token.getToken()
}
/**
* 获取验证码
* @param phone
......@@ -50,6 +55,14 @@ export class UserService extends Service {
return await this.service.get(`${this.router.isPwdSet.path}/${account}`)
}
async getUserInfo(){
return await this.service.get(this.router.userInfo.path,{
headers:{
Authorization: this.getAuth(),
"Content-Type": this.router.userInfo.dataType
}
})
}
}
......
......@@ -2,8 +2,7 @@
<Layout-Child>
<div class='w-11/12 mx-auto mt-6'>
<div class='collection-list'>
<div v-if="collectionList.length>1">
<div v-if="collectionList.length>0">
<app-collectionCard :colletionData='i' v-for="i in collectionList" :key="i.id" class='mt-3' @click.native="goDetail(i.id)"></app-collectionCard>
</div>
<div v-else class="mt-12">
......
......@@ -28,7 +28,7 @@ export default Vue.extend({
},
methods:{
toggleDialog(){
this.$dialog.alert({
this.$dialog.confirm({
message: '确定要退出登录吗',
}).then(()=>{
localStorage.clear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment