From 0a845649839ed1d5c23f5810142e396ea08f510b Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期四, 08 九月 2022 16:56:40 +0800 Subject: [PATCH] lct --- src/components/uploaderFile/index.vue | 4 ++-- .env.development | 6 +++--- src/utils/request.ts | 9 +++++++-- src/router/index.ts | 1 - 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.env.development b/.env.development index d739dab..ee719e1 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ # 本地环境 ENV = 'development' -VITE_API_URL = 'http://192.168.0.35:8008' +#VITE_API_URL = 'http://192.168.0.35:8008' #李宇飞接口地址 #VITE_API_URL = 'http://192.168.0.50:8008' @@ -22,10 +22,10 @@ #VITE_API_URL_OUT = 'http://121.239.169.27:16006/safeplatform-out' #线上正式环境外包接口地址 -#VITE_API_URL = 'http://192.168.0.52:8011/safeplatform' +VITE_API_URL = 'http://192.168.0.52:8011/safeplatform' #本地预发接口地址 -#VITE_API_URL_OUT = 'http://192.168.0.52:8011/safeplatform-out' +VITE_API_URL_OUT = 'http://192.168.0.52:8011/safeplatform-out' #本地外包预发接口地址 diff --git a/src/components/uploaderFile/index.vue b/src/components/uploaderFile/index.vue index 95b947d..b4b4189 100644 --- a/src/components/uploaderFile/index.vue +++ b/src/components/uploaderFile/index.vue @@ -65,7 +65,7 @@ goalManagementApi() .searchFile(uploadFile.name) .then((res) => { - window.open(res.data, "_blank"); + window.open(res.config.url, "_blank"); }) dialogImageUrl.value = uploadFile.url!; // dialogVisible.value = true; @@ -180,4 +180,4 @@ .upload-demo{ width: 100%; } -</style> \ No newline at end of file +</style> diff --git a/src/router/index.ts b/src/router/index.ts index b49ba96..16008c7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -66,7 +66,6 @@ // 路由加载前 router.beforeEach(async (to, from, next) => { - debugger if (to.path === '/intelligentLine') { next(); } else { diff --git a/src/utils/request.ts b/src/utils/request.ts index 0c09f3b..e2cdd90 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -34,11 +34,16 @@ service.defaults.transformResponse = [ function (data) { - try { + try { // 正常同通过return JSON.parse(data)对数据进行转换 // 但是转化完成的数据可能超出安全数据长度 // 因此我们定制使用第三包来转化 - return JSONbig.parse(data); + // if(data.indexOf('http://') === -1){ + // return data + // }else{ + return JSONbig.parse(data); + // } + } catch (err) { console.log(err); // 转换失败返回一个空对象 -- Gitblit v1.9.2