官网跳转期刊

This commit is contained in:
2024-10-14 11:08:17 +08:00
parent f343547181
commit bb55ac555b

View File

@@ -6,18 +6,49 @@
<script>
export default {
data(){
data() {
return {
journal:this.$route.query.journal,
journal: this.$route.query.journal,
abbr: this.$route.query.abbr
};
},
created() {
this.$api.post('api/Article/getJournalByAlias',{alias:this.journal})
.then(res=>{
localStorage.setItem('ms_journal_alias',res.journal_id);
async created() {
var journal_id;
var journal_id_abbr;
if (this.abbr) {
journal_id_abbr = await this.getJournalByAbbr();
}
if (this.journal) {
journal_id = await this.getJournalByAlias();
}
setTimeout(() => {
if (journal_id_abbr) {
localStorage.setItem('ms_journal_alias', journal_id_abbr);
} else if (journal_id) {
localStorage.setItem('ms_journal_alias', journal_id);
}
this.$router.push('/');
});
}, 1000);
},
methods: {
async getJournalByAlias() {
var data;
await this.$api.post('api/Article/getJournalByAlias', { alias: this.journal }).then((res) => {
data = res.journal_id;
});
return data;
},
async getJournalByAbbr() {
var data;
await this.$api.post('api/Article/getJournalByAbbr', { abbr: this.abbr }).then((res) => {
// localStorage.setItem('ms_journal_alias', res.journal_id);
data = res.data.detail ? res.data.detail.journal_id : null;
});
return data;
}
}
}
</script>
};
</script>