From 7b72e4279812a83f52a39b94335ff733da793e62 Mon Sep 17 00:00:00 2001 From: daihh Date: Tue, 28 Mar 2023 16:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0http=E4=B8=8Ehttps=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E4=BC=98=E5=8C=96Aajx=E7=9A=84?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ajax.js | 2 +- src/components/FileUpload/index.vue | 5 ++ src/components/Study/manager.vue | 2 +- src/utils/xajax.js | 2 +- src/views/StudyIndex.vue | 130 +++++++--------------------- src/views/course/ManageList.vue | 2 +- src/views/study/Courses.vue | 2 +- src/views/study/TaskList.vue | 40 +-------- 8 files changed, 40 insertions(+), 145 deletions(-) diff --git a/src/api/ajax.js b/src/api/ajax.js index c189b101..60face68 100644 --- a/src/api/ajax.js +++ b/src/api/ajax.js @@ -30,7 +30,7 @@ const formRequest=axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 // baseURL: process.env.VUE_APP_CESOURCE_BASE_API, //超时 - timeout: 10000, + timeout: 60000, }) //发送json对象的拦截器 formRequest.interceptors.request.use(config => { diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index 6cd3b36f..29ee8638 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -111,6 +111,11 @@ export default { } }; }, + mounted() { + //计算是http还是https + let urlPre=window.location.protocol; + this.uploadFileUrl=urlPre+this.uploadFileUrl.substring(this.uploadFileUrl.indexOf(':')+1); + }, computed: { // 是否显示提示 showTip() { diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 71e99cf8..a3f05a9d 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -115,7 +115,7 @@ diff --git a/src/utils/xajax.js b/src/utils/xajax.js index 8698061c..38dc3f7a 100644 --- a/src/utils/xajax.js +++ b/src/utils/xajax.js @@ -29,7 +29,7 @@ const jsonRequest=axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: process.env.VUE_APP_BASE_API, //超时 - timeout: 10000, + timeout: 60000, }); //发送json对象的拦截器 jsonRequest.interceptors.request.use(config => { diff --git a/src/views/StudyIndex.vue b/src/views/StudyIndex.vue index 7ad520f0..ae929839 100644 --- a/src/views/StudyIndex.vue +++ b/src/views/StudyIndex.vue @@ -1,87 +1,15 @@