|
@@ -28,7 +28,7 @@
|
|
...mapState(['hasLogin', 'userInfo'])
|
|
...mapState(['hasLogin', 'userInfo'])
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
|
|
+
|
|
commit() {
|
|
commit() {
|
|
if (this.nickname == null || this.nickname == "") {
|
|
if (this.nickname == null || this.nickname == "") {
|
|
this.$api.msg('请输入昵称!')
|
|
this.$api.msg('请输入昵称!')
|
|
@@ -47,15 +47,24 @@
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
that.deptListurl.userName = that.nickname
|
|
that.deptListurl.userName = that.nickname
|
|
that.deptListurl.id = that.userInfo.id
|
|
that.deptListurl.id = that.userInfo.id
|
|
- that.$api.doRequest('post', '/commonUser/editUserInfo', that.deptListurl).then(res => {
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
- // this.$api.msg('修改成功!')
|
|
|
|
- var _student = uni.getStorageSync('userInfo');
|
|
|
|
- _student.userName = that.nickname;
|
|
|
|
- uni.setStorageSync('userInfo', _student);
|
|
|
|
- uni.navigateBack()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ that.$api.doRequest('post', '/commonUser/editUserInfo', that.deptListurl).then(
|
|
|
|
+ res => {
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '修改成功!',
|
|
|
|
+ icon: 'success',
|
|
|
|
+ duration: 2000,
|
|
|
|
+ success() {
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ var _student = uni.getStorageSync('userInfo');
|
|
|
|
+ _student.userName = that.nickname;
|
|
|
|
+ uni.setStorageSync('userInfo', _student);
|
|
|
|
+ uni.navigateBack()
|
|
|
|
+ },2000)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
.catch(res => {
|
|
.catch(res => {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: res.errmsg,
|
|
title: res.errmsg,
|
|
@@ -63,15 +72,15 @@
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
} else if (res.cancel) {
|
|
} else if (res.cancel) {
|
|
// console.log('用户点击取消');
|
|
// console.log('用户点击取消');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
})
|
|
})
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|