lijiaqi 4 months ago
parent fc0d429106
commit be30aa3792
  1. 3
      src/store/modules/user.ts
  2. 14
      src/views/course/basicCourseInformation.vue

@ -103,9 +103,10 @@ const useUserStore = defineStore(
if (result.code === 200) { if (result.code === 200) {
const res = await userIdenService(result.data.id) const res = await userIdenService(result.data.id)
// @ts-expect-error // @ts-expect-error
console.log(res.data, 'res.data')
this.userInfo = res.data this.userInfo = res.data
// console.log(this.userInfo, 'this.userInfo') console.log(this.userInfo, 'this.userInfo')
// @ts-expect-error // @ts-expect-error
this.data = result.data this.data = result.data

@ -20,14 +20,14 @@ const router = useRouter()
// console.log(route) // console.log(route)
// import { client } from '@/utils/alioss.js' // import { client } from '@/utils/alioss.js'
// //
const courseList = ref([]) const courseList = ref()
// //
const teacherList = ref([]) const teacherList = ref()
const getTeacherList = async () => { const getTeacherList = async () => {
const res = await getTeacherListApi() const res = await getTeacherListApi()
console.log(res) console.log(res, 'teacher')
teacherList.value = res.data teacherList.value = res.data
console.log(teacherList.value) console.log(teacherList.value, 'teacherList.value')
} }
const total = ref(0) const total = ref(0)
const params = ref({ const params = ref({
@ -45,14 +45,14 @@ const loading = ref(false)
const getCourseList = async () => { const getCourseList = async () => {
loading.value = true loading.value = true
// console.log(params.value, '11') // console.log(params.value, '11')
if (userStore.userInfo.roleId === 2) { if (userStore.userInfo.roleId[0] === 2) {
params.value.pageSize = 8 params.value.pageSize = 8
} }
const res = await getCourseListApi(params.value) const res = await getCourseListApi(params.value)
courseList.value = res.data.list courseList.value = res.data.list
total.value = res.data.total total.value = res.data.total
console.log(res.data.list) console.log(courseList.value, 'courseList.value')
loading.value = false loading.value = false
// console.log(userStore.userName, '1111') // console.log(userStore.userName, '1111')
} }
@ -171,7 +171,7 @@ const CloseCouresNameChangeEvent = () => {
<div class="btn"> <div class="btn">
<!-- <el-button type="primary" round size="large">全部课程</el-button> <!-- <el-button type="primary" round size="large">全部课程</el-button>
<el-button type="primary" round plain size="large">我的文件夹</el-button> --> <el-button type="primary" round plain size="large">我的文件夹</el-button> -->
<el-form inline v-if="userStore.userInfo.roleId === 1"> <el-form inline v-if="userStore.userInfo.roleId[0] === '1'">
<el-form-item label="课程教师:" class="short-form-item"> <el-form-item label="课程教师:" class="short-form-item">
<el-select v-model="params.teacher"> <el-select v-model="params.teacher">
<el-option <el-option

Loading…
Cancel
Save