提交 ac9af6f3 authored 作者: zyx's avatar zyx

简单修改打开方式,可能被拦截,先打开新页面,然后再location跳转

上级 66a76fbb
...@@ -102,6 +102,9 @@ export default class API { ...@@ -102,6 +102,9 @@ export default class API {
* @param {[object]} res 返回数据 * @param {[object]} res 返回数据
*/ */
_reqSuccess(res) { _reqSuccess(res) {
if (/util\/kaosx/gi.test(res.config.url)) {
console.log(res.data)
}
const { data } = res const { data } = res
/* 带 code 参数,新接口模型 */ /* 带 code 参数,新接口模型 */
if (data.code !== undefined) { if (data.code !== undefined) {
......
...@@ -86,9 +86,12 @@ export default { ...@@ -86,9 +86,12 @@ export default {
}).then(res => { }).then(res => {
loading.close() loading.close()
if (res.msg === 'success') { if (res.msg === 'success') {
window.open(res.url) // window.open(res.url)
/* 先打开新界面,再location刷新页面 */
const tw = window.open('_blank')
tw.location = res.url
this.dialogVisible = false this.dialogVisible = false
this.$router.go(0) // this.$router.go(0)
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论