提交 68317205 编写于 作者: 芊里

用户信息丢失

上级 81133883
......@@ -110,9 +110,6 @@
// #endif
},
methods: {
...mapMutations({
logout: 'user/logout'
}),
toSettings() {
uni.navigateTo({
url: "/pages/ucenter/settings/settings"
......@@ -130,20 +127,8 @@
console.log(await callCheckVersion());
checkUpdate()
},
goLogin() {
if (!this.login) {
console.log('点击前往登录');
uni.navigateTo({
url: '/uni_modules/uni-login-page/pages/index/index'
});
} else {
console.log('点击编辑信息');
uni.navigateTo({
url: './edit/edit'
})
}
},
tapGrid(index) {
tapGrid(index) {
console.log(this.userInfo);
uni.showToast({
title: '你点击了,第' + (index + 1) + '',
icon: 'none'
......
<template>
<view class="uni-container">
<uni-forms ref="form" :value="formData" :rules="rules" validate-trigger="submit" err-show-type="toast">
<uni-list-item>
<template v-slot:body>
<uni-forms-item name="avatar">
<template>
<view class="avatar-box">
<image class="avatar-img" :src="formData.avatar || '/static/uni-center/logo.png'" @click="chooseImg" mode="aspectFill"></image>
</view>
</template>
</uni-list-item>
</uni-forms-item>
<uni-forms-item name="gender" label="性别" required>
<uni-data-checkbox v-model="formData.gender" :localdata="formOptions.gender_localdata" />
</uni-forms-item>
......@@ -29,7 +29,8 @@
validator
} from '../../js_sdk/validator/uni-id-users.js';
import {
mapMutations
mapMutations,
mapGetters
} from 'vuex';
const db = uniCloud.database();
const dbCollectionName = 'uni-id-users';
......@@ -71,10 +72,14 @@
...getValidator(["avatar", "gender", "nickname"])
}
}
},
computed:{
...mapGetters({
userInfo:'user/info'
})
},
onLoad(e) {
let id = "60795c140983f8000192f235";
id = uni.getStorageSync('uni_id_uid');
let id = uni.getStorageSync('uni_id_uid') || this.userInfo._id;
this.formDataId = id
this.getDetail(id)
},
......@@ -138,7 +143,6 @@
title: '修改成功'
})
this.setUserInfo(value);
// this.getOpenerEventChannel().emit('refreshData')
setTimeout(() => uni.navigateBack(), 500)
}).catch((err) => {
uni.showModal({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册