update frontend

This commit is contained in:
Himit_ZH 2022-01-23 21:51:39 +08:00
parent 69b7dbdbf7
commit 5dc62108ac
1 changed files with 12 additions and 5 deletions

View File

@ -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() {
this.$router.push({ if (!this.isAuthenticated) {
name: 'ContestDetails', myMessage.warning(this.$i18n.t('m.Please_login_first'));
params: { contestID: this.contests[this.index].id }, this.$store.dispatch('changeModalStatus', { visible: true });
}); } else {
this.$router.push({
name: 'ContestDetails',
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>