From 3b2fe69a6f11e5fc7799979f539ed72a37a4402b Mon Sep 17 00:00:00 2001 From: lijiaqi <1205620597@qq.com> Date: Thu, 25 Jul 2024 10:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=BF=E4=B8=8A=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E4=B8=BA=E6=9C=AC=E5=9C=B0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/api/courseChaptersApi.ts | 17 +- src/utils/request.ts | 44 +- src/views/course/CourseObjectives.vue | 66 ++- src/views/course/CourseObjectives111.vue | 59 +-- src/views/course/basicCourseInformation.vue | 5 +- src/views/course/components/courseEdit.vue | 12 +- src/views/course/courseDetails.vue | 443 ++++++++++++++------ 8 files changed, 427 insertions(+), 223 deletions(-) diff --git a/.env.development b/.env.development index 269e196..600aee7 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ # 变量必须以 VITE_ 为前缀才能暴露给外部读取 NODE_ENV = 'development' VITE_APP_TITLE = '无糖运营平台' -# VITE_APP_BASE_API = 'http://127.0.0.1:8008' -VITE_APP_BASE_API = 'http://39.106.16.162:8080' +VITE_APP_BASE_API = 'http://127.0.0.1:8080' +# VITE_APP_BASE_API = 'http://39.106.16.162:8080' diff --git a/src/api/courseChaptersApi.ts b/src/api/courseChaptersApi.ts index 8f4f708..666b7ca 100644 --- a/src/api/courseChaptersApi.ts +++ b/src/api/courseChaptersApi.ts @@ -96,20 +96,7 @@ export const deleteCourse = (params: any) => { // 获取详情 export const getCourseInfo = (params: any) => { return request({ - // <<<<<<< HEAD - url: '/objective_contents/' + params.id, - method: 'get', - // // params - // ======= - // <<<<<<< HEAD - // url: '/api/objective_contents/' + params.id, - // method: 'get', - // params, - // ======= - // url: '/objective_contents/' + params.id, - // method: "get", - // // params - // >>>>>>> 1a620e19de970965f426e07348b1dbc4be900eaf - // >>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a + url: '/api/objective_contents/' + params.id, + // method: 'get', }) } diff --git a/src/utils/request.ts b/src/utils/request.ts index 33c5882..214b86b 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -21,28 +21,28 @@ request.interceptors.response.use( }, (error) => { //处理网络错误 - let msg = '' - const status = error.response.status - switch (status) { - case 401: - msg = 'token过期' - break - case 403: - msg = '无权访问' - break - case 404: - msg = '请求地址错误' - break - case 500: - msg = '服务器出现问题' - break - default: - msg = '无网络' - } - ElMessage({ - type: 'error', - message: msg, - }) + // let msg = '' + // const status = error.response.status + // switch (status) { + // case 401: + // msg = 'token过期' + // break + // case 403: + // msg = '无权访问' + // break + // case 404: + // msg = '请求地址错误' + // break + // case 500: + // msg = '服务器出现问题' + // break + // default: + // msg = '出错了' + // } + // ElMessage({ + // type: 'error', + // message: msg, + // }) return Promise.reject(error) }, ) diff --git a/src/views/course/CourseObjectives.vue b/src/views/course/CourseObjectives.vue index 7d831a3..b463672 100644 --- a/src/views/course/CourseObjectives.vue +++ b/src/views/course/CourseObjectives.vue @@ -46,8 +46,9 @@ const addBook = (id) => { flog.value = false // updateDisabledStatus() } -const text = ref('我是后台获取的值') +const text = ref('') const textChange = (val) => { + text.value = val console.log(text.value) } // 弹窗 @@ -161,7 +162,7 @@ const data = ref({}) const courseId = ref(0) onMounted(async () => { if (!Object.keys(route.query).length) { - return router.push('/curriculumCenter/CourseObjectives') + return router.push('/curriculumCenter/basicCourseInformation') } courseId.value = route.query.id console.log(courseId.value) @@ -333,13 +334,13 @@ onMounted(async () => {