From d7b4e7a9c5db447232028c52d0cc49bb8a28830e Mon Sep 17 00:00:00 2001 From: wenyu441069198 <14186472+wenyu441069198@user.noreply.gitee.com> Date: Thu, 25 Jul 2024 12:32:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E8=AE=B0=E5=BD=95=E6=8B=BF?= =?UTF-8?q?=E7=94=A8=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 ++-- src/views/courseResources/index.vue | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 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/views/courseResources/index.vue b/src/views/courseResources/index.vue index b0614b5..93bd36e 100644 --- a/src/views/courseResources/index.vue +++ b/src/views/courseResources/index.vue @@ -14,6 +14,9 @@ import { LearningRecordsControllerService } from '../../../generated/services/Le import { CourseResourceControllerService } from '../../../generated/services/CourseResourceControllerService' import resourceAdd from './componse/resourceAdd.vue' +import useUserStore from '@/store/modules/user' +import { onMounted } from 'vue' + const total = ref(0) const pptresourceList = ref([]) @@ -77,10 +80,14 @@ const onDeleteResource = async (ids) => { ElMessage({ type: 'success', message: '删除成功' }) getpptresourceList() } - +const userStore = useUserStore() +onMounted(()=>{ + userStore.getUserInfo() +}) const param = ref({ coursesId: '', - userId: '1', + coursesName: '', + userId: userStore.data.id, open: '1', download: '0', content: '', @@ -91,6 +98,7 @@ const param = ref({ const generateRecords = async (rescource) => { param.value.content = rescource.img param.value.coursesId = rescource.id.toString() + param.value.coursesName = rescource.name await LearningRecordsControllerService.saveRecordsUsingPost1(param.value) // console.log(param) }