update frontend
This commit is contained in:
parent
69b7dbdbf7
commit
5dc62108ac
|
@ -215,9 +215,10 @@
|
||||||
import time from '@/common/time';
|
import time from '@/common/time';
|
||||||
import api from '@/common/api';
|
import api from '@/common/api';
|
||||||
import { CONTEST_STATUS_REVERSE } from '@/common/constants';
|
import { CONTEST_STATUS_REVERSE } from '@/common/constants';
|
||||||
import { mapState } from 'vuex';
|
import { mapState, mapGetters } from 'vuex';
|
||||||
import { addCodeBtn } from '@/common/codeblock';
|
import { addCodeBtn } from '@/common/codeblock';
|
||||||
import Avatar from 'vue-avatar';
|
import Avatar from 'vue-avatar';
|
||||||
|
import myMessage from '@/common/message';
|
||||||
const Announcements = () => import('@/components/oj/common/Announcements.vue');
|
const Announcements = () => import('@/components/oj/common/Announcements.vue');
|
||||||
export default {
|
export default {
|
||||||
name: 'home',
|
name: 'home',
|
||||||
|
@ -313,10 +314,15 @@ export default {
|
||||||
this.index = newIndex;
|
this.index = newIndex;
|
||||||
},
|
},
|
||||||
goContest() {
|
goContest() {
|
||||||
|
if (!this.isAuthenticated) {
|
||||||
|
myMessage.warning(this.$i18n.t('m.Please_login_first'));
|
||||||
|
this.$store.dispatch('changeModalStatus', { visible: true });
|
||||||
|
} else {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'ContestDetails',
|
name: 'ContestDetails',
|
||||||
params: { contestID: this.contests[this.index].id },
|
params: { contestID: this.contests[this.index].id },
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
goOtherOJContest(event) {
|
goOtherOJContest(event) {
|
||||||
window.open(event.row.url);
|
window.open(event.row.url);
|
||||||
|
@ -341,6 +347,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['websiteConfig']),
|
...mapState(['websiteConfig']),
|
||||||
|
...mapGetters(['isAuthenticated']),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue