Skip to content

Commit a0cfd32

Browse files
committed
change api
Signed-off-by: zhangtianli2006 <49156174+zhangtianli2006@users.noreply.github.com>
1 parent 65e7001 commit a0cfd32

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/components/problem/content.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,22 @@ export default {
142142
.get(apiurl('/problem/' + String(this.$route.params.id)))
143143
.then(res => {
144144
let data = res.data.res;
145+
console.log(data);
145146
this.title = data.title;
146147
this.pid = data.pid;
147148
this.allowHTML = data.allow_html;
148-
this.description = data.description;
149149
this.memery = data.memory_limit / 1000;
150150
this.time = data.time_limit;
151151
this.hidden = !data.enabled;
152152
this.timeAdd = timeFormat(data.date_added);
153153
this.tags = data.tags;
154154
this.render_tags();
155155
this.problemLoading = false;
156+
this.$axios
157+
.get(apiurl('/problem/' + String(this.$route.params.id) + '/description'))
158+
.then(detail => {
159+
this.description = detail.data.res.description;
160+
});
156161
})
157162
.catch(err => {
158163
if(err.request.status === 404) {

src/components/problem/edit.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,16 @@ export default {
131131
.then(res => {
132132
let data = res.data.res;
133133
this.title = data.title;
134-
this.mdContent = data.description;
135134
this.memery = data.memory_limit / 1000;
136135
this.time = data.time_limit;
137136
this.disable = !data.enabled;
138137
this.html = data.allow_html;
139138
this.contentLoading = false;
139+
this.$axios
140+
.get(apiurl('/problem/' + String(this.$route.params.id) + '/description'))
141+
.then(detail => {
142+
this.mdContent = detail.data.res.description;
143+
});
140144
})
141145
.catch(err => {
142146
if (err.request.status === 404) {

0 commit comments

Comments
 (0)