学习记录拿用户id

develoop
wenyu441069198 4 months ago
parent f13728da3c
commit d7b4e7a9c5
  1. 4
      .env.development
  2. 12
      src/views/courseResources/index.vue

@ -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'

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

Loading…
Cancel
Save