Преглед изворни кода

Merge branch 'master' of http://git.izouma.com/xiongzhu/raex_front

panhui пре 3 година
родитељ
комит
ca702abd0b
1 измењених фајлова са 22 додато и 16 уклоњено
  1. 22 16
      src/views/account/Setting.vue

+ 22 - 16
src/views/account/Setting.vue

@@ -431,14 +431,17 @@ export default {
                     ...this.info,
                     pic: img
                 };
-                this.$http.post('/userDetail/save', data, { body: 'json' }).then(() => {
-                    this.$toast.clear();
-                    this.$toast.success('更新成功');
-                    this.getInformation();
-                });
-                this.updateUser({ avatar: img, useCollectionPic: false }).then(res => {
-                    this.$toast.clear();
-                });
+                this.updateUser({ avatar: img, useCollectionPic: false })
+                    .then(res => {
+                        this.$http.post('/userDetail/save', data, { body: 'json' }).then(() => {
+                            this.$toast.clear();
+                            this.$toast.success('更新成功');
+                            this.getInformation();
+                        });
+                    })
+                    .catch(e => {
+                        this.$toast(e.error);
+                    });
             });
         },
         afterRead2(e) {
@@ -452,14 +455,17 @@ export default {
                     ...this.info,
                     bgpic: img
                 };
-                this.$http.post('/userDetail/save', data, { body: 'json' }).then(() => {
-                    this.$toast.clear();
-                    this.$toast.success('更新成功');
-                    this.getInformation();
-                });
-                this.updateUser({ bg: img }).then(res => {
-                    this.$toast.clear();
-                });
+                this.updateUser({ bg: img })
+                    .then(res => {
+                        this.$http.post('/userDetail/save', data, { body: 'json' }).then(() => {
+                            this.$toast.clear();
+                            this.$toast.success('更新成功');
+                            this.getInformation();
+                        });
+                    })
+                    .catch(e => {
+                        this.$toast(e.error);
+                    });
             });
         },
         showConsoleEve() {