|
@@ -113,64 +113,53 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
var that = this
|
|
var that = this
|
|
- uni.showModal({
|
|
|
|
- content: "您确定要更改图像?",
|
|
|
|
- showCancel: true,
|
|
|
|
- confirmText: '确定',
|
|
|
|
- success: function(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- that.deptListurl.avatarUrl = that.identityUrl
|
|
|
|
- that.deptListurl.id = that.userInfo.id
|
|
|
|
- that.$api.doRequest('post', '/commonUser/editUserInfo', that.deptListurl).then(
|
|
|
|
- res => {
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '修改成功!',
|
|
|
|
- icon: 'success',
|
|
|
|
- duration: 2000,
|
|
|
|
- success() {
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- that.userInfo.avatarUrl = that.identityUrl
|
|
|
|
- var _student = uni.getStorageSync('userInfo');
|
|
|
|
- _student.avatarUrl = that.identityUrl;
|
|
|
|
- uni.setStorageSync('userInfo', _student);
|
|
|
|
- var name = 'userInfo';
|
|
|
|
- var value = _student;
|
|
|
|
- that.$store.commit('$uStore', {
|
|
|
|
- name,
|
|
|
|
- value
|
|
|
|
- });
|
|
|
|
- // this.$api.msg('修改成功2!')
|
|
|
|
- uni.navigateBack({
|
|
|
|
- delta:1
|
|
|
|
- })
|
|
|
|
- },2000)
|
|
|
|
- }
|
|
|
|
|
|
+ that.deptListurl.avatarUrl = that.identityUrl
|
|
|
|
+ that.deptListurl.id = that.userInfo.id
|
|
|
|
+ that.$api.doRequest('post', '/commonUser/editUserInfo', that.deptListurl).then(
|
|
|
|
+ res => {
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '修改成功!',
|
|
|
|
+ icon: 'success',
|
|
|
|
+ duration: 2000,
|
|
|
|
+ success() {
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ that.userInfo.avatarUrl = that.identityUrl
|
|
|
|
+ var _student = uni.getStorageSync('userInfo');
|
|
|
|
+ _student.avatarUrl = that.identityUrl;
|
|
|
|
+ uni.setStorageSync('userInfo', _student);
|
|
|
|
+ var name = 'userInfo';
|
|
|
|
+ var value = _student;
|
|
|
|
+ that.$store.commit('$uStore', {
|
|
|
|
+ name,
|
|
|
|
+ value
|
|
|
|
+ });
|
|
|
|
+ // this.$api.msg('修改成功2!')
|
|
|
|
+ uni.navigateBack({
|
|
|
|
+ delta:1
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ },2000)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- .catch(res => {
|
|
|
|
- if(res.data.errmsg){
|
|
|
|
- uni.showToast({
|
|
|
|
- title: res.data.errmsg,
|
|
|
|
- icon: 'none',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- uni.showToast({
|
|
|
|
- title: "系统异常,请联系管理员",
|
|
|
|
- icon: 'none',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- } else if (res.cancel) {
|
|
|
|
- // console.log('用户点击取消');
|
|
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ if(res.data.errmsg){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.data.errmsg,
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- },
|
|
|
|
- })
|
|
|
|
|
|
+ else{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "系统异常,请联系管理员",
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|