Skip to content

Commit 6604554

Browse files
authored
Merge pull request #123 from segment-oj/fix-status-resubmit
[fix] normal user status resubmit
2 parents 54e7c7a + b743702 commit 6604554

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/components/status/content.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
</el-select>
1919
</el-card>
2020
<el-card class="item">
21-
<el-button type="primary" @click="submit()" :loading="buttonLoading"
22-
>Resubmit</el-button
23-
>
21+
<el-button v-if="this.can_edit" type="primary" @click="submit()" :loading="buttonLoading">Resubmit</el-button>
2422
<el-button @click="back()">Back</el-button>
2523
</el-card>
2624
<el-card class="item">
@@ -113,6 +111,8 @@ export default {
113111
buttonLoading: false,
114112
smallScreen: screen.width < 700,
115113
langTable: sfconfig.langTable,
114+
is_mine: false,
115+
can_edit: false
116116
};
117117
},
118118
methods: {
@@ -126,6 +126,14 @@ export default {
126126
this.time = data.time;
127127
this.code = data.code;
128128
this.lang_num = String(data.lang);
129+
130+
if (data.owner == String(this.$store.state.user.userid)) {
131+
this.is_mine = true;
132+
}
133+
if (this.$store.state.user.isStaff || this.is_mine) {
134+
this.can_edit = true;
135+
}
136+
129137
this.$axios
130138
.get(apiurl('/problem/' + String(this.pid)))
131139
.then((title) => {

0 commit comments

Comments
 (0)