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) }