Explorar o código

退出登录以及课程小节接口

丸子 hai 9 meses
pai
achega
ea563b3a22

+ 2 - 2
.env

@@ -2,8 +2,8 @@
 VITE_APP_TITLE=AI课程网
 
 # 请求路径
-VITE_BASE_URL='http://59.110.91.129/admin-api'
-#VITE_BASE_URL='http://192.168.110.8:8080/admin-api'
+# VITE_BASE_URL='http://59.110.91.129/admin-api'
+VITE_BASE_URL='http://192.168.110.8:8080/admin-api'
 
 # 默认账户密码
 VITE_APP_DEFAULT_LOGIN_TENANT = 博雅智算

+ 1 - 1
src/api/class.js

@@ -20,7 +20,7 @@ export function ClassOutline (id) {
 // 根据类型id获取课程列表
 export function ClassType (typeId) {
   return axios({
-    url: 'bjdxWeb/course/getCourseByTypeld?typeId=' + typeId ,
+    url: 'bjdxWeb/course/getCourseByTypeId?typeId=' + typeId ,
     method: 'get'
   })
 }

BIN=BIN
src/assets/icon/logout.png


+ 71 - 27
src/components/HomePage.vue

@@ -7,11 +7,17 @@
           <!-- 下拉菜单 -->
           <el-dropdown v-model="selectedGrade">
             <el-button type="primary">
-              {{ selectedGrade }}<el-icon class="el-icon--right"><ArrowDown /></el-icon>
+              {{ selectedGrade
+              }}<el-icon class="el-icon--right"><ArrowDown /></el-icon>
             </el-button>
             <template #dropdown>
               <el-dropdown-menu class="dropdown-menu">
-                <el-dropdown-item v-for="item in classData" :key="item.id" :value="item.ctType">{{ item.ctType }}</el-dropdown-item>
+                <el-dropdown-item
+                  v-for="item in classData"
+                  :key="item.id"
+                  :value="item.ctType"
+                  >{{ item.ctType }}</el-dropdown-item
+                >
                 <!-- <el-dropdown-item>小学高年级</el-dropdown-item> -->
               </el-dropdown-menu>
             </template>
@@ -42,6 +48,16 @@
             >AI艺术课</el-button
           >
         </div>
+        <!-- 退出登录 -->
+        <div class="logout-box">
+          <el-button round class="logout-box-btn" @click="LogoutClick()">
+            <img
+              :src="logoutIcon"
+              alt="Logout"
+            />
+            退出登录
+          </el-button>
+        </div>
       </div>
     </div>
     <div class="box-2">
@@ -78,23 +94,38 @@
 </template>
 
 <script setup>
-import { ref,onMounted,watch } from 'vue'
+import { ref, onMounted, watch } from 'vue'
 import { useRouter } from 'vue-router'
 import { ClassList } from '@/api/class.js'
 import { ArrowDown, ArrowRightBold } from '@element-plus/icons-vue'
 import { Search, ArrowLeftBold } from '@element-plus/icons-vue'
-// 默认选中 AI 通识课
-const selectedButton = ref('AI通识课')
 
+// 导入图片
+import intelligenceImg from '@/assets/images/intelligence.png'
+import roomImg from '@/assets/images/room.png'
+import testImg from '@/assets/images/test.png'
+import studyImg from '@/assets/images/study.png'
+
+
+// 退出图标
+import logoutIcon from '@/assets/icon/logout.png'
 // 获取当前路由对象
 const router = useRouter()
+// 退出
+const LogoutClick = () => {
+   // 清空 token 和登录状态
+  localStorage.removeItem('token'); 
+  localStorage.removeItem('isLoggedIn'); 
+  localStorage.removeItem('maxCourseSections'); 
+  router.push({ path: '/login' })
+}
+
+// 默认选中 AI 通识课
+const selectedButton = ref('AI通识课')
+
+
 // 添加图片路径
-const indexImages = ref([
-  './src/assets/images/intelligence.png',
-  './src/assets/images/room.png',
-  './src/assets/images/test.png',
-  './src/assets/images/study.png'
-])
+const indexImages = ref([intelligenceImg, roomImg, testImg, studyImg])
 // AI初体验
 const goToAIGeneralCourse = title => {
   router.push({ path: '/ai-general-course', query: { title } })
@@ -104,46 +135,41 @@ const goToAILab = () => {
   router.push({ path: '/ai-laboratory' })
 }
 
-
 // 添加下拉菜单选中项
 const selectedGrade = ref('')
 // 获取年级
 const classData = ref([])
 const fetchCtTypes = async () => {
   try {
-    const response = await ClassList();
+    const response = await ClassList()
     if (response.code === 0) {
-      classData.value = response.data;
+      classData.value = response.data
       // 获取到数据,将第一个选项的值作为默认选中值
       if (classData.value.length > 0) {
-        selectedGrade.value = classData.value[0].ctType;
+        selectedGrade.value = classData.value[0].ctType
       }
     }
-    console.log(classData.value,selectedGrade.value);
   } catch (error) {
-    console.error('获取 ctType 数据失败:', error);
+    console.error('获取 ctType 数据失败:', error)
   }
 }
 
 // 添加 watch 监听 selectedGrade 的变化
-watch(selectedGrade, (newValue) => {
+watch(selectedGrade, newValue => {
   // 根据 id 切换高年级或低年级
-  const selectedItem = classData.value.find(item => item.ctType === newValue);
+  const selectedItem = classData.value.find(item => item.ctType === newValue)
   if (selectedItem) {
     if (selectedItem.id === 3) {
-      selectedGrade.value = '小学高年级';
-      console.log(selectedGrade.value);
+      selectedGrade.value = '小学高年级'
     } else if (selectedItem.id === 1) {
-      selectedGrade.value = '小学低年级';
-      console.log(selectedGrade.value);
+      selectedGrade.value = '小学低年级'
     }
   }
-});
+})
 
 onMounted(() => {
-  fetchCtTypes();
-});
-
+  fetchCtTypes()
+})
 </script>
 
 <style scoped lang="scss">
@@ -152,6 +178,23 @@ onMounted(() => {
 @function rpx($px) {
   @return math.div($px, 750) * 100vw;
 }
+.logout-box {
+  position: fixed;
+  margin-left: rpx(370);
+}
+.logout-box-btn{
+   width: rpx(65); // 使用 rpx 函数设置按钮宽度
+  height: rpx(15); // 使用 rpx 函数设置按钮高度
+  margin: rpx(10) rpx(10) 0 0; // 使用 rpx 函数设置外边距
+  background-color: transparent;
+  color: white;
+  border: none; // 移除默认边框
+  font-size: rpx(7); // 使用 rpx 函数设置字体大小
+  outline: none; // 移除默认的外边框
+}
+.logout-box-btn img {
+  width: rpx(10);
+}
 .home-container {
   position: fixed;
   top: 0;
@@ -267,6 +310,7 @@ onMounted(() => {
 .right-box {
   flex: 1;
   position: relative; // 添加相对定位;
+  margin-right: rpx(25);
 }
 .top-right-box {
   position: absolute; // 添加绝对定位

+ 8 - 1
src/utils/request.js

@@ -18,7 +18,6 @@ const request = axios.create({
   // 它可以通过设置一个 `baseURL` 便于为 axios 实例的方法传递相对 URL
   // baseURL: isDev ? 'http://121.89.205.189:3000/admin' : 'http://121.89.205.189:3000/admin',
   baseURL: BASE_URL,
-
   // baseURL: '/api',
   // `timeout` 指定请求超时的毫秒数。
   // 如果请求时间超过 `timeout` 的值,则请求会被中断
@@ -63,6 +62,14 @@ export default function ajax (config) {
   switch (method.toUpperCase()) {
     case 'GET':
       //  get  请求
+      if (headers['content-type'] == 'application/x-www-form-url-encoded') {
+        //  如果提交的是表单数据我们需要格式化数据
+        const obj = new URLSearchParams()
+        for (const key in data) {
+          obj.append(key, data[key])
+        }
+        return request.post(url, obj, { headers })
+      }
       // get 请求的参数我们需要放在 params 中
       return request.get(url, { params: data })
     case 'POST':

+ 230 - 210
src/views/AIDevelop.vue

@@ -222,7 +222,6 @@
 <script setup>
 import { ref, onMounted } from 'vue'
 import { useRouter } from 'vue-router'
-import { ClassType } from '@/api/class.js'
 import {
   ArrowDown,
   ArrowRightBold,
@@ -241,21 +240,21 @@ import {
 import { Search, ArrowLeftBold } from '@element-plus/icons-vue'
 import { valueEquals } from 'element-plus'
 // 引入视频
-import video1 from '@/assets/02video/01video.mp4'
-import video2 from '@/assets/02video/02video.mp4'
-import video3 from '@/assets/02video/03video.mp4'
-import video4 from '@/assets/02video/04video.mp4'
-import video5 from '@/assets/02video/05video.mp4'
-import video6 from '@/assets/02video/06video.mp4'
-import video7 from '@/assets/02video/07video.mp4'
-import video8 from '@/assets/02video/08video.mp4'
-import video9 from '@/assets/02video/09video.mp4'
-import video10 from '@/assets/02video/10video.mp4'
-import video11 from '@/assets/02video/11video.mp4'
-import video12 from '@/assets/02video/12video.mp4'
-import video13 from '@/assets/02video/13video.mp4'
-import video14 from '@/assets/02video/14video.mp4'
-import video15 from '@/assets/02video/15video.mp4'
+// import video1 from '@/assets/02video/01video.mp4'
+// import video2 from '@/assets/02video/02video.mp4'
+// import video3 from '@/assets/02video/03video.mp4'
+// import video4 from '@/assets/02video/04video.mp4'
+// import video5 from '@/assets/02video/05video.mp4'
+// import video6 from '@/assets/02video/06video.mp4'
+// import video7 from '@/assets/02video/07video.mp4'
+// import video8 from '@/assets/02video/08video.mp4'
+// import video9 from '@/assets/02video/09video.mp4'
+// import video10 from '@/assets/02video/10video.mp4'
+// import video11 from '@/assets/02video/11video.mp4'
+// import video12 from '@/assets/02video/12video.mp4'
+// import video13 from '@/assets/02video/13video.mp4'
+// import video14 from '@/assets/02video/14video.mp4'
+// import video15 from '@/assets/02video/15video.mp4'
 import {ClassType} from "@/api/class.js";
 
 const router = useRouter() // 获取当前路由对象
@@ -271,33 +270,28 @@ const toggleDrawer = () => {
 }
 
 // 定义映射
-const videoMap = {
-  '1-1': video1,
-  '1-2': video2,
-  '1-3': video3,
-  '1-4': video4,
-  '1-5': video5,
-  '1-6': video6,
-  '1-7': video7,
-  '1-8': video8,
-  '1-9': video9,
-  '1-10': video10,
-  '1-11': video11,
-  '1-12': video12,
-  '1-13': video13,
-  '1-14': video14,
-  '1-15': video15
-}
-// 定义视频源
-const videoSrc = ref(video1)
+// const videoMap = {
+//   '1-1': video1,
+//   '1-2': video2,
+//   '1-3': video3,
+//   '1-4': video4,
+//   '1-5': video5,
+//   '1-6': video6,
+//   '1-7': video7,
+//   '1-8': video8,
+//   '1-9': video9,
+//   '1-10': video10,
+//   '1-11': video11,
+//   '1-12': video12,
+//   '1-13': video13,
+//   '1-14': video14,
+//   '1-15': video15
+// }
+
+
 
-const courseList = ref([])
 
 
-// // 获取课程列表
-// ClassType().then(res=>{
-//   console.log(res);
-// })
 
 // 返回上一页
 const goBack = () => {
@@ -305,32 +299,57 @@ const goBack = () => {
 }
 // 渲染页面标题
 const boxIconTitle = ref('')
-
-// 教学大纲id
+// 课程数据
+const courseList = ref([])
+// 菜单数据
+const menuItems = ref([])
+// 定义视频源
+const videoSrc = ref('')
+// 新增视频路径映射
+const videoPathMap = ref({})
 
 onMounted(async () => {
   const typeId = router.currentRoute.value.query.typeId
-  console.log(typeId,"----")
+  console.log(typeId, "----")
   if (typeId) {
-    //取课程数据
-    // await ClassType(typeId).then(res => {
-    //   courseList.value = res.data
-    //   console.log("课程数据:",courseList.value)
-    // })
+    try {
+      // 取课程数据并添加错误处理
+      const res = await ClassType(typeId)
+      courseList.value = res.data
+      console.log("课程数据:", courseList.value)
+
+       // 构建视频路径映射
+      videoPathMap.value = courseList.value.reduce((map, item, index) => {
+        const idx = `1-${index + 1}`
+        if (item.courseVideoPath) {
+          map[idx] = item.courseVideoPath
+        }
+        return map
+      }, {})
+
+      // 初始化第一个视频源和标题
+      if (courseList.value.length > 0 && courseList.value[0].courseVideoPath) {
+        videoSrc.value = courseList.value[0].courseVideoPath
+        currentIndex.value = '1-1'
+        smallTitle.value = courseList.value[0].courseName
+      }
 
+      // 将接口数据中的 courseName 转换为菜单格式
+      menuItems.value = courseList.value.map((item, index) => {
+        const idx = `1-${index + 1}`
+        return {
+          index: idx,
+          title: item.courseName
+        }
+      })
+    } catch (error) {
+      console.error("获取课程数据失败:", error)
+    }
   }
   const title = router.currentRoute.value.query.typeName
   if (title) {
     boxIconTitle.value = String(title)
   }
-  if (id) {
-    outlineId.value = id // 接收并存储id参数
-  }
-  console.log(outlineId.value);
-  // 获取课程列表
-  ClassType({ typeId: outlineId.value }).then(res => {
-    console.log(res);
-  })
 })
 
 // 菜单打开和关闭的处理函数
@@ -338,29 +357,29 @@ const handleOpen = () => {}
 const handleClose = () => {}
 
 // 动态渲染树型结构
-const menuItems = ref([
-  { index: '1-1', title: '课前回顾' },
-  { index: '1-2', title: '课程引入' },
-  {
-    index: '1',
-    title: '知识讲解',
-    children: [
-      { index: '1-3', title: '图灵测试' },
-      { index: '1-4', title: '课堂提问' },
-      { index: '1-5', title: '达特茅斯会议' },
-      { index: '1-6', title: '课堂选择' },
-      { index: '1-7', title: '聊天机器人' },
-      { index: '1-8', title: '专家系统' },
-      { index: '1-9', title: '课堂互动' },
-      { index: '1-10', title: '互联网快速发展' },
-      { index: '1-11', title: '黄金时代' },
-      { index: '1-12', title: '课堂提问' },
-      { index: '1-13', title: '大模型时代' }
-    ]
-  },
-  { index: '1-14', title: '趣味实操' },
-  { index: '1-15', title: '课程总结' }
-])
+// const menuItems = ref([
+//   { index: '1-1', title: '课前回顾' },
+//   { index: '1-2', title: '课程引入' },
+//   {
+//     index: '1',
+//     title: '知识讲解',
+//     children: [
+//       { index: '1-3', title: '图灵测试' },
+//       { index: '1-4', title: '课堂提问' },
+//       { index: '1-5', title: '达特茅斯会议' },
+//       { index: '1-6', title: '课堂选择' },
+//       { index: '1-7', title: '聊天机器人' },
+//       { index: '1-8', title: '专家系统' },
+//       { index: '1-9', title: '课堂互动' },
+//       { index: '1-10', title: '互联网快速发展' },
+//       { index: '1-11', title: '黄金时代' },
+//       { index: '1-12', title: '课堂提问' },
+//       { index: '1-13', title: '大模型时代' }
+//     ]
+//   },
+//   { index: '1-14', title: '趣味实操' },
+//   { index: '1-15', title: '课程总结' }
+// ])
 
 // 当前播放的索引
 const currentIndex = ref('1-1')
@@ -386,9 +405,9 @@ const handleSelect = index => {
   if (title) {
     smallTitle.value = title
   }
-  // 根据索引切换视频
-  if (videoMap[index]) {
-    videoSrc.value = videoMap[index]
+  // 根据索引切换视频,使用新的 videoPathMap
+  if (videoPathMap.value[index]) {
+    videoSrc.value = videoPathMap.value[index]
     currentIndex.value = index
   }
 }
@@ -428,6 +447,7 @@ const playNextVideo = () => {
   userMessage = ref('')
   messageHistory = ref([])
 }
+
 // 切换视频
 // 播放上一个视频
 const playPreviousVideo = () => {
@@ -473,134 +493,134 @@ let userMessage = ref('')
 let messageHistory = ref([])
 
 // 定义每个视频对应的暂停时间和问题
-const videoPauseTimes = {
-  [video2]: {
-    pauseTimes: [30],
-    questions: [
-      {
-        title: '视频当中发生了什么事情呢?',
-        options: [],
-        aiQuestion: '视频当中发生了什么事情呢',
-        aiAnswer:
-          '让我来告诉你吧:泡泡怪篡改了Ai历史数据,导致Ai系统发生崩溃,所以要修正Ai历史抓到泡泡怪!'
-      }
-    ]
-  },
-  [video3]: {
-    pauseTimes: [49],
-    questions: [
-      {
-        title: '同学们,大家了解图灵测试了吗?',
-        options: [],
-        aiQuestion: '视频当中发生了什么事情呢',
-        aiAnswer:
-          '让我来告诉你吧:泡泡怪篡改了Ai历史数据,导致Ai系统发生崩溃,所以要修正Ai历史抓到泡泡怪!'
-      }
-    ]
-  },
-  [video4]: {
-    pauseTimes: [2],
-    questions: [
-      {
-        title: '你觉得deepseek、豆包等大模型可以通过图灵测试吗?为什么?',
-        options: [],
-        aiQuestion: '你觉得deepseek、豆包等大模型可以通过图灵测试吗?为什么?',
-        aiAnswer:
-          '大模型已缩短与图灵测试的标志距离,尤其在表面对话层面,但因缺乏深层次理解、逻辑一致性与真实认知,仍无法在严格测试中稳定通过。'
-      }
-    ]
-  },
-  [video5]: {
-    pauseTimes: [49],
-    questions: []
-  },
-  [video6]: {
-    pauseTimes: [5]
-  },
-  [video7]: {
-    pauseTimes: [64.5, 91],
-    questions: [
-      {
-        title: '如果你是聊天机器人,你会怎么回答用户呢?',
-        options: [],
-        aiQuestion: '',
-        aiAnswer: ''
-      },
-      {
-        title:
-          '当我们和聊天机器人对话的内容被人类所查看并回答时,隐私信息是否泄露?',
-        options: [],
-        aiQuestion:
-          '当我们和聊天机器人对话的内容被人类所查看并回答时,隐私信息是否泄露?',
-        aiAnswer:
-          '与聊天机器人的对话被人类查看时,隐私泄露风险客\n' +
-          '观存在,尤其是人类介入或安全漏洞场景下。建议优先选择支持本地'
-      }
-    ]
-  },
-  [video8]: {
-    pauseTimes: [72],
-    questions: [
-      {
-        title: '如果你身体不舒服时找这样的专家检查,那么它开的药你敢喝吗?',
-        options: [],
-        aiQuestion:
-          '如果你身体不舒服时找这样的专家检查,那么它开的药你敢喝吗?',
-        aiAnswer: '这题没给答案,你自己去查吧!'
-      }
-    ]
-  },
-  [video9]: {
-    pauseTimes: [2],
-    questions: [
-      {
-        title: '在生活中,有哪些正在使用的专家系统呢?',
-        options: [],
-        aiQuestion: '在生活中,有哪些正在使用的专家系统呢?',
-        aiAnswer:
-          '在医疗健康领域有复杂疾病协同决策和Ai医生分身与诊断辅助;在水利交通领域的水利厅专家库系统用于项目验收和抢险督查'
-      }
-    ]
-  },
-  [video11]: {
-    pauseTimes: [1, 90, 176],
-    questions: [
-      {
-        title: '怎么会有爆炸声?泡泡怪在这里吗?',
-        options: [],
-        aiQuestion: '',
-        aiAnswer: ''
-      },
-      {
-        title: '同学们喜欢下围棋吗?',
-        options: [],
-        aiQuestion: '',
-        aiAnswer: ''
-      },
-      {
-        title: '为什么AlphaGo要在围棋上攻克真人冠军呢?',
-        options: [],
-        aiQuestion: '为什么AlphaGo要在围棋上攻克真人冠军呢?',
-        aiAnswer:
-          '围棋是人类智力游戏的巅峰,拥有天文数字级的可能性,每颗棋子价值由全局态势动态决定,所以当前一手可能百步之后才显现价值。AlphaGo战胜人类顶尖选手,它证明了Ai不仅能处理规则明确的事物,更能攻克依赖直觉、策略的“人类专属领域”'
-      }
-    ]
-  },
-  [video12]: {
-    pauseTimes: [1]
-  },
-  [video13]: {
-    pauseTimes: [62],
-    questions: [
-      {
-        title: '我们一起来感受一下大模型吧!',
-        options: [],
-        aiQuestion: '',
-        aiAnswer: ''
-      }
-    ]
-  }
-}
+ const videoPauseTimes = {
+   [video2]: {
+     pauseTimes: [30],
+     questions: [
+       {
+         title: '视频当中发生了什么事情呢?',
+         options: [],
+         aiQuestion: '视频当中发生了什么事情呢',
+         aiAnswer:
+           '让我来告诉你吧:泡泡怪篡改了Ai历史数据,导致Ai系统发生崩溃,所以要修正Ai历史抓到泡泡怪!'
+       }
+     ]
+   },
+   [video3]: {
+     pauseTimes: [49],
+     questions: [
+       {
+         title: '同学们,大家了解图灵测试了吗?',
+         options: [],
+         aiQuestion: '视频当中发生了什么事情呢',
+         aiAnswer:
+           '让我来告诉你吧:泡泡怪篡改了Ai历史数据,导致Ai系统发生崩溃,所以要修正Ai历史抓到泡泡怪!'
+       }
+     ]
+   },
+   [video4]: {
+     pauseTimes: [2],
+     questions: [
+       {
+         title: '你觉得deepseek、豆包等大模型可以通过图灵测试吗?为什么?',
+         options: [],
+         aiQuestion: '你觉得deepseek、豆包等大模型可以通过图灵测试吗?为什么?',
+         aiAnswer:
+           '大模型已缩短与图灵测试的标志距离,尤其在表面对话层面,但因缺乏深层次理解、逻辑一致性与真实认知,仍无法在严格测试中稳定通过。'
+       }
+     ]
+   },
+   [video5]: {
+     pauseTimes: [49],
+     questions: []
+   },
+   [video6]: {
+     pauseTimes: [5]
+   },
+   [video7]: {
+     pauseTimes: [64.5, 91],
+     questions: [
+       {
+         title: '如果你是聊天机器人,你会怎么回答用户呢?',
+         options: [],
+         aiQuestion: '',
+         aiAnswer: ''
+       },
+       {
+         title:
+           '当我们和聊天机器人对话的内容被人类所查看并回答时,隐私信息是否泄露?',
+         options: [],
+         aiQuestion:
+           '当我们和聊天机器人对话的内容被人类所查看并回答时,隐私信息是否泄露?',
+         aiAnswer:
+           '与聊天机器人的对话被人类查看时,隐私泄露风险客\n' +
+           '观存在,尤其是人类介入或安全漏洞场景下。建议优先选择支持本地'
+       }
+     ]
+   },
+   [video8]: {
+     pauseTimes: [72],
+     questions: [
+       {
+         title: '如果你身体不舒服时找这样的专家检查,那么它开的药你敢喝吗?',
+         options: [],
+         aiQuestion:
+           '如果你身体不舒服时找这样的专家检查,那么它开的药你敢喝吗?',
+         aiAnswer: '这题没给答案,你自己去查吧!'
+       }
+     ]
+   },
+   [video9]: {
+     pauseTimes: [2],
+     questions: [
+       {
+         title: '在生活中,有哪些正在使用的专家系统呢?',
+         options: [],
+         aiQuestion: '在生活中,有哪些正在使用的专家系统呢?',
+         aiAnswer:
+           '在医疗健康领域有复杂疾病协同决策和Ai医生分身与诊断辅助;在水利交通领域的水利厅专家库系统用于项目验收和抢险督查'
+       }
+     ]
+   },
+   [video11]: {
+     pauseTimes: [1, 90, 176],
+     questions: [
+       {
+         title: '怎么会有爆炸声?泡泡怪在这里吗?',
+         options: [],
+         aiQuestion: '',
+         aiAnswer: ''
+       },
+       {
+         title: '同学们喜欢下围棋吗?',
+         options: [],
+         aiQuestion: '',
+         aiAnswer: ''
+       },
+       {
+         title: '为什么AlphaGo要在围棋上攻克真人冠军呢?',
+         options: [],
+         aiQuestion: '为什么AlphaGo要在围棋上攻克真人冠军呢?',
+         aiAnswer:
+           '围棋是人类智力游戏的巅峰,拥有天文数字级的可能性,每颗棋子价值由全局态势动态决定,所以当前一手可能百步之后才显现价值。AlphaGo战胜人类顶尖选手,它证明了Ai不仅能处理规则明确的事物,更能攻克依赖直觉、策略的“人类专属领域”'
+       }
+     ]
+   },
+   [video12]: {
+     pauseTimes: [1]
+   },
+   [video13]: {
+     pauseTimes: [62],
+     questions: [
+       {
+         title: '我们一起来感受一下大模型吧!',
+         options: [],
+         aiQuestion: '',
+         aiAnswer: ''
+       }
+     ]
+   }
+ }
 
 // 处理视频时间更新事件
 const handleTimeUpdate = () => {

+ 4 - 2
src/views/AIGeneralCourse.vue

@@ -111,7 +111,7 @@
 
 <script setup>
 import { ref, onMounted, computed, watch } from 'vue'
-import { useRouter } from 'vue-router'
+
 import { ClassList, ClassOutline } from '@/api/class.js'
 // 添加 Element Plus 组件引入
 // import { ElDrawer, ElMenu, ElMenuItem, ElRow, ElCol } from 'element-plus'
@@ -125,6 +125,8 @@ import {
 } from '@element-plus/icons-vue'
 import { Search, ArrowLeftBold } from '@element-plus/icons-vue'
 
+import { useRouter } from 'vue-router'
+const router = useRouter() // 获取当前路由对象
 
 
 // 添加下拉菜单选中项
@@ -191,7 +193,7 @@ const toggleDrawer = () => {
   drawerVisible.value = !drawerVisible.value
 }
 
-const router = useRouter() // 获取当前路由对象
+
 
 // 搜索框
 const SearchInput = ref('')

+ 2 - 2
src/views/AILaboratory.vue

@@ -77,7 +77,7 @@ import {
   ChatLineRound,
   Picture,
   MagicStick,
-  Avatar
+  User
 } from '@element-plus/icons-vue'
 const router = useRouter()
 
@@ -148,7 +148,7 @@ const groupList = ref([
     title: '智能绘画'
   },
   {
-    icon: Avatar,
+    icon: User,
     title: '数字人老师'
   }
 ])

+ 2 - 2
src/views/AIPainting.vue

@@ -189,7 +189,7 @@ import {
   Picture,
   MagicStick,
   Tickets,
-  Avatar
+  User
 } from '@element-plus/icons-vue'
 // 返回上一页
 const goBack = () => {
@@ -234,7 +234,7 @@ const groupList = ref([
     title: '智能绘画'
   },
   {
-    icon: Avatar,
+    icon: User,
     title: '数字人老师'
   }
 ])

+ 2 - 2
src/views/AIQuestions.vue

@@ -103,7 +103,7 @@ import {
   Expand,
   Picture,
   Tickets,
-  Avatar
+  User
 } from '@element-plus/icons-vue'
 
 // 添加抽屉显示状态
@@ -116,7 +116,7 @@ const toggleDrawer = () => {
 const groupList = ref([
   { icon: ChatLineRound, title: '智能问答' },
   { icon: MagicStick, title: '智能绘画' },
-  { icon: Avatar, title: '数字人老师' }
+  { icon: User, title: '数字人老师' }
 ])
 // 跳转智能问答
 const navigateToAI = group => {

+ 8 - 3
src/views/Login.vue

@@ -112,9 +112,7 @@ const handleLogin = async params => {
         const loginDataLoginForm = { ...loginData.value.loginForm }
         // 构建包含 headers 的请求参数
         const res = await login(
-          {
-            'Tenant-Id': tenantId.value
-          },
+          { 'Tenant-Id': tenantId.value },
           loginDataLoginForm
         )
         console.log('登录响应:', res) // 添加日志输出
@@ -131,6 +129,13 @@ const handleLogin = async params => {
           if (loginData.value.loginForm.rememberMe) {
             localStorage.setItem('isLoggedIn', 'true')
             localStorage.setItem('token', res.data.token)
+            
+            // 根据账号类型设置可查看的课程小节数
+            if (loginData.value.loginForm.username === 'aiTest') {
+              localStorage.setItem('maxCourseSections', '5')
+            } else if (loginData.value.loginForm.username === 'aiAdmin') {
+              localStorage.setItem('maxCourseSections', 'all')
+            }
           }
 
           loading.value = ElLoading.service({

+ 0 - 1
vite.config.js

@@ -9,7 +9,6 @@ import legacy from '@vitejs/plugin-legacy'
 export default defineConfig(({ mode }) => {
   // 加载对应模式的环境变量
   const env = loadEnv(mode, process.cwd())
-
   return {
     plugins: [
       legacy({