提交 a9aa36ed authored 作者: lihuihui's avatar lihuihui

Merge branches 'master' and 'master' of https://gitlab-pro.ezijing.com/ezijing-web/saas-dml

...@@ -15,12 +15,13 @@ router.beforeEach(async (to, from, next) => { ...@@ -15,12 +15,13 @@ router.beforeEach(async (to, from, next) => {
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }
user.isLogin ? next() : next('/401') if (!user.isLogin) {
return next('/401')
return
}
} }
if (!to.query.experiment_id) { if (!to.query.experiment_id) {
to.query.experiment_id = '7025368348925886464' next({ path: to.path, query: { ...to.query, experiment_id: from.query.experiment_id || '7025368348925886464' } })
next({ path: to.path, query: to.query })
} else { } else {
next() next()
} }
......
...@@ -13,10 +13,13 @@ const httpRequest = axios.create({ ...@@ -13,10 +13,13 @@ const httpRequest = axios.create({
// 请求拦截 // 请求拦截
httpRequest.interceptors.request.use( httpRequest.interceptors.request.use(
function (config) { function (config) {
const params = new URLSearchParams(window.location.search)
if (config.method === 'get') if (config.method === 'get')
config.params = Object.assign({}, config.params, { experiment_id: '7025368348925886464' }) config.params = Object.assign({}, config.params, { experiment_id: params.get('experiment_id') })
if (config.method === 'post') config.data = Object.assign({}, config.data, { experiment_id: '7025368348925886464' }) if (config.method === 'post')
config.data = Object.assign({}, config.data, { experiment_id: params.get('experiment_id') })
return config return config
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论