3131 </el-row >
3232 </el-card >
3333 <el-card class =" item" >
34- <el-button type =" primary" @click =" submit" :loading = " buttonLoading " >Submit</el-button >
34+ <el-button type =" primary" @click =" submit" >Submit</el-button >
3535 <el-button @click =" back();" >Back</el-button >
3636 <ConfirmDelete
3737 buttonName =" Delete"
9393 </el-row >
9494 </el-card >
9595 <el-card v-loading =" contentLoading" class =" item" >
96- <div slot =" header" class =" clearfix" ><i class =" el-icon-document" /> Content</div >
96+ <div slot =" header" class =" clearfix" >
97+ <i class =" el-icon-document" />
98+ Content
99+ </div >
97100 <MarkdownEditor v-model =" mdContent" />
98101 </el-card >
99102 </div >
@@ -111,7 +114,6 @@ export default {
111114 title: ' ' ,
112115 mdContent: ' Loading...' ,
113116 contentLoading: true ,
114- buttonLoading: false ,
115117 time: ' Unknown' ,
116118 memery: ' Unknown' ,
117119 disable: false ,
@@ -137,15 +139,19 @@ export default {
137139 this .contentLoading = false ;
138140 })
139141 .catch (err => {
140- this .$SegmentMessage .error (this , ' Problem loading error' );
141- console .log (err);
142+ if (err .request .status === 404 ) {
143+ this .$SegmentMessage .error (this , ' Problem not found' );
144+ } else if (err .request .status === 403 ) {
145+ this .$SegmentMessage .error (this , ' Permission denied' );
146+ } else {
147+ this .$SegmentMessage .error (this , ' Unkown error' );
148+ }
142149 });
143150 },
144151 back () {
145152 this .$router .push (' /problem/' + this .$route .params .id );
146153 },
147154 submit () {
148- this .buttonLoading = true ;
149155 this .$axios
150156 .patch (apiurl (' /problem/' + this .$route .params .id ), {
151157 title: this .title ,
@@ -156,7 +162,6 @@ export default {
156162 enabled: ! this .disable
157163 })
158164 .then (() => {
159- this .buttonLoading = false ;
160165 this .$SegmentMessage .success (this , ' Your changes have been submitted' );
161166 })
162167 .catch (err => {
@@ -167,7 +172,6 @@ export default {
167172 } else {
168173 this .$SegmentMessage .error (this , ' Unkown error' );
169174 }
170- this .buttonLoading = false ;
171175 });
172176 },
173177 delete () {
0 commit comments