bug调试

uat_us
wangxiaoshuang 2024-07-16 11:17:25 +08:00
parent 38ce7c1f56
commit 4a659fdde4
2 changed files with 23 additions and 7 deletions

View File

@ -89,6 +89,7 @@ import {
batchAddOrUpdateFrontInternationalization,
getFrontInternationalizationList,
} from "@/api/dictionary/dictionary";
import { getTrialExtralConfig } from "@/api/trials";
import Vue from "vue";
import i18n from "./lang";
export default {
@ -105,6 +106,28 @@ 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);

View File

@ -6,7 +6,6 @@ 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 })
@ -23,12 +22,6 @@ 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')