@@ -123,7 +123,6 @@ export default {
123123 if (this .isMine || this .isRootMe || this .isStaffMe ) {
124124 this .username = data .username ;
125125 this .email = data .email ;
126- this .introduction = data .introduction ;
127126 this .isStaff = data .is_staff ;
128127 this .isRoot = data .is_superuser ;
129128 this .isActive = data .is_active ;
@@ -139,13 +138,26 @@ export default {
139138 this .$SegmentMessage .error (this , ' Unkown error' );
140139 }
141140 });
141+ this .$axios
142+ .get (apiurl (' /account/' + this .$route .params .id + ' /introduction' ))
143+ .then (res => {
144+ let data = res .data .res ;
145+ this .introduction = data .introduction ;
146+ })
147+ .catch (err => {
148+ if (err .request .status === 404 ) {
149+ this .$SegmentMessage .error (this , ' User does not exist' );
150+ } else {
151+ this .$SegmentMessage .error (this , ' Unkown error' );
152+ }
153+ this .userLoading = false ;
154+ });
142155 },
143156 submit () {
144157 this .buttonLoading = true ;
145158 this .$axios
146159 .patch (apiurl (' /account/' + this .$route .params .id ), {
147160 username: this .username ,
148- introduction: this .introduction ,
149161 is_staff: this .isStaff ,
150162 is_superuser: this .isRoot ,
151163 is_active: this .isActive ,
@@ -163,6 +175,21 @@ export default {
163175 lang: this .lang
164176 });
165177 }
178+ this .$axios
179+ .patch (apiurl (' /account/' + this .$route .params .id + ' /introduction' ), {
180+ introduction: this .introduction ,
181+ })
182+ .then (() => {
183+ this .buttonLoading = false ;
184+ })
185+ .catch (err => {
186+ if (err .request .status === 404 ) {
187+ this .$SegmentMessage .error (this , ' User does not exist' );
188+ } else {
189+ this .$SegmentMessage .error (this , ' Unkown error' );
190+ }
191+ this .userLoading = false ;
192+ });
166193 })
167194 .catch (err => {
168195 this .buttonLoading = false ;
0 commit comments