Compare commits
No commits in common. "5368538d52dbaffe23d98fee4a4174d3fe62b97b" and "198e5802884d411378255562a34a68d31c931352" have entirely different histories.
5368538d52
...
198e580288
23
src/App.vue
23
src/App.vue
|
@ -89,7 +89,6 @@ import {
|
|||
batchAddOrUpdateFrontInternationalization,
|
||||
getFrontInternationalizationList,
|
||||
} from "@/api/dictionary/dictionary";
|
||||
import { getTrialExtralConfig } from "@/api/trials";
|
||||
import Vue from "vue";
|
||||
import i18n from "./lang";
|
||||
export default {
|
||||
|
@ -106,28 +105,6 @@ export default {
|
|||
mounted() {
|
||||
this.show = process.env.VUE_APP_OSS_PATH === "/test/dist";
|
||||
},
|
||||
watch: {
|
||||
"$route.query": {
|
||||
async handler() {
|
||||
if (
|
||||
this.$route.query.trialId &&
|
||||
this.$route.query.trialId !== this.$store.state.trials.config.trialId
|
||||
) {
|
||||
let res = await getTrialExtralConfig({
|
||||
TrialId: this.$route.query.trialId,
|
||||
});
|
||||
if (res.IsSuccess) {
|
||||
this.$store.dispatch("trials/setConfig", {
|
||||
trialId: this.$route.query.trialId,
|
||||
...res.Result,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeValue(target, attr, e) {
|
||||
this.$set(target, attr, e);
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'nprogress/nprogress.css'
|
|||
import { getToken } from '@/utils/auth'
|
||||
import Vue from 'vue'
|
||||
import { OSSclient } from './utils/oss'
|
||||
import { getTrialExtralConfig } from "@/api/trials"
|
||||
// import getPageTitle from '@/utils/get-page-title'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
@ -22,6 +23,12 @@ router.beforeEach(async (to, from, next) => {
|
|||
Vue.prototype.toPath = to.path
|
||||
Vue.prototype.$path = []
|
||||
if (hasToken) {
|
||||
if (to.query.trialId && to.query.trialId !== store.state.trials.config.trialId) {
|
||||
let res = await getTrialExtralConfig({ TrialId: to.query.trialId });
|
||||
if (res.IsSuccess) {
|
||||
store.dispatch('trials/setConfig', { trialId: to.query.trialId, ...res.Result });
|
||||
}
|
||||
}
|
||||
if (to.path === '/login' || to.path === '/recompose' || to.path === '/email-recompose' || to.path === '/error' || to.path === '/ReviewersResearchForm' || to.path === '/ReviewersResearch') {
|
||||
if (to.path === '/ReviewersResearch') {
|
||||
await this.$store.dispatch('user/logout')
|
||||
|
|
Loading…
Reference in New Issue