|
|
@@ -14,16 +14,10 @@
|
|
|
</van-uploader>
|
|
|
</van-cell>
|
|
|
|
|
|
- <!-- <van-cell title="背景图" to="/user/information/setbg" isLink></van-cell> -->
|
|
|
- <!-- <van-cell title="昵称" to="/user/information/setNickname" :value="nickName" isLink/> -->
|
|
|
- <!-- <van-cell title="性别" :value="genderText" @click="showSex = true" isLink/> -->
|
|
|
- <!-- <van-cell title="密码设置" to="/user/information/setPassword" isLink/> -->
|
|
|
- <!-- <van-cell title="手机号" to="/user/information/setMobile" :value="mobile" isLink></van-cell> -->
|
|
|
- <van-cell title="背景图" isLink></van-cell>
|
|
|
- <van-cell title="昵称" :value="nickName" isLink/>
|
|
|
- <van-cell title="性别" isLink/>
|
|
|
- <!-- <van-cell title="密码设置" to="/user/information/setPassword" isLink/> -->
|
|
|
- <van-cell title="手机号" :value="mobile" isLink></van-cell>
|
|
|
+ <van-cell title="昵称" to="/user/information/setNickname" :value="nickName" isLink/>
|
|
|
+ <van-cell title="性别" :value="genderText" @click="showSex = true" isLink/>
|
|
|
+ <van-cell title="密码设置" to="/user/information/setPassword" isLink/>
|
|
|
+ <van-cell title="手机号" to="/user/information/setMobile" :value="mobile" isLink></van-cell>
|
|
|
</van-cell-group>
|
|
|
<van-button class="bottom_btn" @click="loginOut" type="primary" bottomAction>退出登录</van-button>
|
|
|
<van-popup v-model="showSex" position="bottom">
|
|
|
@@ -42,7 +36,7 @@
|
|
|
import { Uploader, Picker, Popup, Button } from 'vant';
|
|
|
import { removeLocalStorage } from '@/utils/local-storage';
|
|
|
import { getLocalStorage } from '@/utils/local-storage';
|
|
|
-import { authLogout } from '@/api/api';
|
|
|
+import { authInfo, authLogout, authProfile } from '@/api/api';
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -56,7 +50,7 @@ export default {
|
|
|
showSex: false,
|
|
|
avatar: '',
|
|
|
nickName: '',
|
|
|
- gender: -1,
|
|
|
+ gender: 0,
|
|
|
mobile: ''
|
|
|
};
|
|
|
},
|
|
|
@@ -77,28 +71,18 @@ export default {
|
|
|
console.log(file);
|
|
|
},
|
|
|
onSexConfirm(value, index) {
|
|
|
-
|
|
|
+ this.showSex = false;
|
|
|
},
|
|
|
getUserInfo() {
|
|
|
- const infoData = getLocalStorage(
|
|
|
- 'nickName',
|
|
|
- 'background_image',
|
|
|
- 'avatar'
|
|
|
- );
|
|
|
- // debugger;
|
|
|
- this.avatar = infoData.avatar;
|
|
|
- this.nickName = infoData.nickName;
|
|
|
- // this.gender = infoData.gender;
|
|
|
- // this.mobile = infoData.mobile;
|
|
|
+ authInfo().then(res => {
|
|
|
+ this.avatar = res.data.data.avatar;
|
|
|
+ this.nickName = res.data.data.nickName;
|
|
|
+ this.gender = res.data.data.gender;
|
|
|
+ this.mobile = res.data.data.mobile;
|
|
|
+ })
|
|
|
},
|
|
|
loginOut() {
|
|
|
authLogout();
|
|
|
- removeLocalStorage(
|
|
|
- 'Authorization',
|
|
|
- 'avatar',
|
|
|
- // 'background_image',
|
|
|
- 'nickName'
|
|
|
- );
|
|
|
this.$router.push({ name: 'home' });
|
|
|
}
|
|
|
},
|