Browse Source

增加 酷乐秀机构版

黄琪勇 6 months ago
parent
commit
2d012be2fc

+ 1 - 0
.env

@@ -4,4 +4,5 @@ VUE_APP_TITLE="乐教通"
 #安全证书
 VUE_APP_MAC_GYM_SECUREANTH="https://oss.dayaedu.com/https-ssl/gym/安全证书.p12"  #密码  dayaedu.com
 VUE_APP_MAC_GYT_SECUREANTH="https://oss.dayaedu.com/https-ssl/gyt/安全证书.p12"  #密码  lexiaoya.cn
+VUE_APP_MAC_KLX_SECUREANTH="https://oss.dayaedu.com/https-ssl/klx/安全证书.p12"  #密码  colexiu.com
 VUE_APP_WIN_SECUREANTH="https://oss.dayaedu.com/https-ssl/安全证书.pfx"

+ 4 - 0
.env.devProd

@@ -4,6 +4,7 @@ NODE_ENV = production
 VUE_APP_URL = "https://dev.resource.colexiu.com/cbs-app"
 VUE_APP_URL_GYM = "https://dev.gym.lexiaoya.cn"
 VUE_APP_URL_GYT = "https://dev.lexiaoya.cn"
+VUE_APP_URL_KLX = "https://dev.colexiu.com"
 
 # 标注画板地址
 VUE_APP_WHITEBOARD = "https://test.lexiaoya.cn/whiteboard-noCollab"
@@ -13,3 +14,6 @@ VUE_APP_TEACH_GYT = "https://test.lexiaoya.cn/orchestra-music-score/"
 
 #管乐迷 云教练
 VUE_APP_TEACH_GYM ="https://test.gym.lexiaoya.cn/accompany-web/"
+
+#酷乐秀 云教练
+VUE_APP_TEACH_KLX ="https://test.colexiu.com/accompany/"

+ 4 - 0
.env.development

@@ -3,6 +3,7 @@
 VUE_APP_URL = "https://dev.resource.colexiu.com/cbs-app"
 VUE_APP_URL_GYM = "/gym"
 VUE_APP_URL_GYT = "/gyt"
+VUE_APP_URL_KLX = "/klx"
 
 # 标注画板地址
 VUE_APP_WHITEBOARD = "https://test.lexiaoya.cn/whiteboard-noCollab"
@@ -12,3 +13,6 @@ VUE_APP_TEACH_GYT = "https://test.lexiaoya.cn/orchestra-music-score/"
 
 #管乐迷 云教练
 VUE_APP_TEACH_GYM ="https://test.gym.lexiaoya.cn/accompany-web/"
+
+#酷乐秀 云教练
+VUE_APP_TEACH_KLX ="https://test.colexiu.com/accompany/"

+ 4 - 0
.env.production

@@ -3,6 +3,7 @@
 VUE_APP_URL = "https://mec.colexiu.com/cbs-app"
 VUE_APP_URL_GYM = "https://gym.lexiaoya.cn"
 VUE_APP_URL_GYT = "https://online.lexiaoya.cn"
+VUE_APP_URL_KLX = "https://online.colexiu.com"
 
 # 标注画板地址
 VUE_APP_WHITEBOARD = "https://online.lexiaoya.cn/whiteboard-noCollab"
@@ -12,3 +13,6 @@ VUE_APP_TEACH_GYT = "https://online.lexiaoya.cn/orchestra-music-score/"
 
 #管乐迷 云教练
 VUE_APP_TEACH_GYM ="https://gym.lexiaoya.cn/accompany-web/"
+
+#酷乐秀 云教练
+VUE_APP_TEACH_KLX ="https://online.colexiu.com/accompany/"

+ 4 - 0
.env.staging

@@ -4,6 +4,7 @@ NODE_ENV = production
 VUE_APP_URL = "https://test.resource.colexiu.com/cbs-app"
 VUE_APP_URL_GYM = "https://test.gym.lexiaoya.cn"
 VUE_APP_URL_GYT = "https://test.lexiaoya.cn"
+VUE_APP_URL_KLX = "https://test.colexiu.com"
 
 # 标注画板地址
 VUE_APP_WHITEBOARD = "https://test.lexiaoya.cn/whiteboard-noCollab"
@@ -13,3 +14,6 @@ VUE_APP_TEACH_GYT = "https://test.lexiaoya.cn/orchestra-music-score/"
 
 #管乐迷 云教练
 VUE_APP_TEACH_GYM ="https://test.gym.lexiaoya.cn/accompany-web/"
+
+#酷乐秀 云教练
+VUE_APP_TEACH_KLX ="https://test.colexiu.com/accompany/"

+ 7 - 1
src/api/ApiInstance.ts

@@ -1,6 +1,6 @@
 import Http from "@/libs/axios"
 import { getToken } from "@/libs/auth"
-import { URL_API, URL_API_GYM, URL_API_GYT } from "@/config"
+import { URL_API, URL_API_GYM, URL_API_GYT, URL_API_KLX } from "@/config"
 
 /** axios实例 */
 
@@ -23,3 +23,9 @@ export const httpAxios_gyt = new Http(URL_API_GYT, {
    tokenName: "Authorization",
    getTokenFun: getToken
 })
+
+/* 酷乐秀 */
+export const httpAxios_klx = new Http(URL_API_KLX, {
+   tokenName: "Authorization",
+   getTokenFun: getToken
+})

+ 53 - 1
src/api/cloudTextbooks.api.ts

@@ -1,4 +1,4 @@
-import { httpAxios_gym, httpAxios_gyt } from "@/api/ApiInstance"
+import { httpAxios_gym, httpAxios_gyt, httpAxios_klx } from "@/api/ApiInstance"
 
 /** 管乐迷 */
 
@@ -69,3 +69,55 @@ export const getLessonCoursewareDetail_gyt = (id: string) => {
       url: "/api-teacher/lessonCoursewareDetail/detail/" + id
    })
 }
+
+/**
+ * 酷乐秀
+ */
+
+// 专辑列表
+export const getuyAlbumInfo_klx = () => {
+   return httpAxios_klx.axioseRquest({
+      method: "get",
+      url: "/api-teacher/tenantGroupAlbum/buyAlbumInfo"
+   })
+}
+
+// 乐器列表
+export const queryPageSubject_klx = () => {
+   return httpAxios_klx.axioseRquest({
+      method: "get",
+      url: "/api-tenant/open/subject/queryPage?page=1&rows=9999&queryType=list"
+   })
+}
+
+//获取课程列表
+export const queryLessonCourseware_klx = (type: string, albumId: string, abortController: AbortController) => {
+   return httpAxios_klx.axioseRquest({
+      signal: abortController.signal,
+      method: "post",
+      url: "/api-teacher/tenantAlbumMusic/page",
+      data: {
+         subjectType: "COURSEWARE",
+         albumId: albumId,
+         page: 1,
+         rows: 9999,
+         subjectId: type
+      }
+   })
+}
+
+// 课程详情列表
+export const getLessonCoursewareCourseList_klx = (id: string) => {
+   return httpAxios_klx.axioseRquest({
+      method: "get",
+      url: "/api-teacher/tenantAlbumMusic/getLessonCoursewareCourseList/" + id
+   })
+}
+
+// 课程详情 播放用
+export const getLessonCourseDetail_klx = (id: string) => {
+   return httpAxios_klx.axioseRquest({
+      method: "get",
+      url: "/api-teacher/tenantAlbumMusic/getLessonCourseDetail/" + id
+   })
+}

+ 27 - 1
src/api/user.api.ts

@@ -1,4 +1,4 @@
-import { httpAxios, httpAxiosNoNprogress, httpAxios_gym, httpAxios_gyt } from "@/api/ApiInstance"
+import { httpAxios, httpAxiosNoNprogress, httpAxios_gym, httpAxios_gyt, httpAxios_klx } from "@/api/ApiInstance"
 
 /** 获取二维码 */
 export const createQrcodeApi = (uuid?: string) => {
@@ -78,3 +78,29 @@ export const mutualTLSQuery_gyt = () => {
       url: "/api-teacher/open/mutualTLS/query?isLogin=true" // 后面跟参数来区分是不是登录511
    })
 }
+
+/** 酷乐秀 */
+
+// 获取用户信息
+export const getUserInfo_klx = () => {
+   return httpAxios_klx.axioseRquest({
+      method: "get",
+      url: "/api-teacher/teacher/queryUserInfo"
+   })
+}
+
+// 退出登录
+export const logout_klx = () => {
+   return httpAxios_klx.axioseRquest({
+      method: "get",
+      url: "/api-auth/exit"
+   })
+}
+
+// 安全证书
+export const mutualTLSQuery_klx = () => {
+   return httpAxios_klx.axioseRquest({
+      method: "get",
+      url: "/api-auth/open/mutualTLS/query?isLogin=true" // 后面跟参数来区分是不是登录511
+   })
+}

+ 3 - 0
src/config/index.ts

@@ -1,6 +1,7 @@
 export const URL_API = process.env.VUE_APP_URL as string
 export const URL_API_GYT = process.env.VUE_APP_URL_GYT as string
 export const URL_API_GYM = process.env.VUE_APP_URL_GYM as string
+export const URL_API_KLX = process.env.VUE_APP_URL_KLX as string
 
 // 画板地址
 export const URL_WHITEBOARD = process.env.VUE_APP_WHITEBOARD as string
@@ -8,8 +9,10 @@ export const URL_WHITEBOARD = process.env.VUE_APP_WHITEBOARD as string
 // 安全证书地址
 export const URL_MAC_GYM_SECUREANTH = process.env.VUE_APP_MAC_GYM_SECUREANTH as string
 export const URL_MAC_GYT_SECUREANTH = process.env.VUE_APP_MAC_GYT_SECUREANTH as string
+export const URL_MAC_KLX_SECUREANTH = process.env.VUE_APP_MAC_KLX_SECUREANTH as string
 export const URL_WIN_SECUREANTH = process.env.VUE_APP_WIN_SECUREANTH as string
 
 // 云练习地址
 export const URL_TEACH_GYT = process.env.VUE_APP_TEACH_GYT as string
 export const URL_TEACH_GYM = process.env.VUE_APP_TEACH_GYM as string
+export const URL_TEACH_KLX = process.env.VUE_APP_TEACH_KLX as string

+ 44 - 0
src/config/menus.ts

@@ -107,3 +107,47 @@ export const menus_gym: menuType[] = [
       children: []
    }
 ]
+
+// 酷乐秀
+export const menus_klx: menuType[] = [
+   {
+      path: "/homePage",
+      component: "homePage",
+      title: "首页",
+      icon: "",
+      meta: {
+         routeType: "layout"
+      },
+      children: []
+   },
+   {
+      path: "/cloudTextbooks",
+      component: "cloudTextbooks",
+      title: "云课堂",
+      icon: "",
+      meta: {
+         routeType: "layout"
+      },
+      children: []
+   },
+   {
+      path: "/coursewarePlay/:id",
+      component: "coursewarePlay",
+      title: "播放器",
+      icon: "",
+      meta: {
+         routeType: "singlepage"
+      },
+      children: []
+   },
+   {
+      path: "/cloudPractice",
+      component: "cloudPractice",
+      title: "云练习",
+      icon: "",
+      meta: {
+         routeType: "layout"
+      },
+      children: []
+   }
+]

BIN
src/hooks/useSecureAnth/img/mac3_2.png


BIN
src/hooks/useSecureAnth/img/mac5_2.png


BIN
src/hooks/useSecureAnth/img/win8_2.png


+ 32 - 6
src/hooks/useSecureAnth/secureAnth.vue

@@ -36,13 +36,13 @@
                   <div class="stepNum">03</div>
                   <div class="titleCon">
                      输入证书密码:
-                     <span class="colorTwo">{{ userType === "GYM" ? "dayaedu.com" : "lexiaoya.cn" }}</span>
+                     <span class="colorTwo">{{ passwordObj[userType!] }}</span>
                      ,点击
                      <span class="colorOne">【好】</span>
                   </div>
                </div>
                <div class="contentBox">
-                  <img class="mac3Img" :src="userType === 'GYM' ? require('./img/mac3_1.png') : require('./img/mac3.png')" />
+                  <img class="mac3Img" :src="mac3ImgObj[userType!] " />
                </div>
             </div>
             <div class="stepCon" v-if="stepNum === 3">
@@ -69,7 +69,7 @@
                   </div>
                </div>
                <div class="contentBox">
-                  <img class="mac5Img" :src="userType === 'GYM' ? require('./img/mac5_1.png') : require('./img/mac5.png')" />
+                  <img class="mac5Img" :src="mac5ImgObj[userType!]" />
                </div>
             </div>
             <div class="stepCon" v-if="stepNum === 5">
@@ -186,7 +186,7 @@
                   <div class="titleCon">在【选择证书】弹窗中点击【确定】按钮,证书安装完成,开始使用乐教通吧!</div>
                </div>
                <div class="contentBox">
-                  <img class="win8Img" :src="userType === 'GYM' ? require('./img/win8_1.png') : require('./img/win8.png')" />
+                  <img class="win8Img" :src="win8ImgObj[userType!]" />
                </div>
             </div>
          </template>
@@ -201,7 +201,7 @@
 <script setup lang="ts">
 import { ref } from "vue"
 import { ElScrollbar } from "element-plus"
-import { URL_MAC_GYM_SECUREANTH, URL_MAC_GYT_SECUREANTH, URL_WIN_SECUREANTH } from "@/config"
+import { URL_MAC_GYM_SECUREANTH, URL_MAC_GYT_SECUREANTH, URL_WIN_SECUREANTH, URL_MAC_KLX_SECUREANTH } from "@/config"
 import { getUserType } from "@/libs/auth"
 
 // 因为没有登录页面没有获取用户信息也会弹窗,所以这里取cookie里面的 userType
@@ -221,7 +221,12 @@ const elScrollbarDom = ref<InstanceType<typeof ElScrollbar>>()
 // 下载证书
 function handleDownload() {
    if (isMac) {
-      window.open(userType === "GYM" ? URL_MAC_GYM_SECUREANTH : URL_MAC_GYT_SECUREANTH)
+      const SECUREANTHObj = {
+         GYT: URL_MAC_GYT_SECUREANTH,
+         GYM: URL_MAC_GYM_SECUREANTH,
+         KLX: URL_MAC_KLX_SECUREANTH
+      }
+      window.open(SECUREANTHObj[userType!])
    } else {
       window.open(URL_WIN_SECUREANTH)
    }
@@ -239,6 +244,27 @@ function handleStep(num: -1 | 1) {
    }
    elScrollbarDom.value?.setScrollTop(0)
 }
+
+const passwordObj = {
+   GYT: "lexiaoya.cn",
+   GYM: "dayaedu.com",
+   KLX: "colexiu.com"
+}
+const mac3ImgObj = {
+   GYT: require("./img/mac3.png"),
+   GYM: require("./img/mac3_1.png"),
+   KLX: require("./img/mac3_2.png")
+}
+const mac5ImgObj = {
+   GYT: require("./img/mac5.png"),
+   GYM: require("./img/mac5_1.png"),
+   KLX: require("./img/mac5_2.png")
+}
+const win8ImgObj = {
+   GYT: require("./img/win8.png"),
+   GYM: require("./img/win8_1.png"),
+   KLX: require("./img/win8_2.png")
+}
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
src/libs/auth.ts

@@ -34,7 +34,7 @@ export function removeToken() {
 const userType = "userType"
 
 export function getUserType() {
-   return Cookies.get(userType)
+   return Cookies.get(userType) as rolesType | undefined
 }
 
 export function setUserType(type: string) {

+ 37 - 17
src/store/modules/user.ts

@@ -1,11 +1,11 @@
 import { defineStore } from "pinia"
 import { store } from "../index"
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
-import { logout_gym, logout_gyt, getUserInfo_gyt, queryUserInfo_gym } from "@/api/user.api"
+import { logout_gym, logout_gyt, logout_klx, getUserInfo_gyt, queryUserInfo_gym, getUserInfo_klx } from "@/api/user.api"
 import { removeToken, setToken, setUserType, getUserType, removeUserType, setCODE401 } from "@/libs/auth"
 import router, { resetRouter } from "@/router"
 import { httpAjax, httpAjaxLoading } from "@/plugin/httpAjax"
-import { menus_gym, menus_gyt } from "@/config/menus"
+import { menus_gym, menus_gyt, menus_klx } from "@/config/menus"
 
 interface userDataType {
    appKey: string
@@ -18,7 +18,7 @@ interface userType {
       realName?: string
       phone?: string
    }
-   roles?: "GYM" | "GYT"
+   roles?: rolesType
 }
 
 const useStore = defineStore("user", {
@@ -31,8 +31,13 @@ const useStore = defineStore("user", {
    actions: {
       /** 登录 */
       async login({ data, appKey }: userDataType) {
-         // GYM 和 GYT 区分   获取token的区分
-         setToken(appKey === "GYM" ? data : data.access_token)
+         // GYM,GYT,KLX 区分 获取token的区分
+         const tokenObj = {
+            GYT: data.access_token,
+            GYM: data,
+            KLX: data
+         }
+         setToken(tokenObj[appKey as rolesType])
          setUserType(appKey)
          return Promise.resolve()
       },
@@ -46,23 +51,38 @@ const useStore = defineStore("user", {
                message: "获取用户信息出错!"
             })
          }
-         // GYM 和 GYT 区分 code验证错误码的区分
-         userType === "GYM" || setCODE401(5000)
-         // GYM 和 GYT 区分 获取用户信息的接口区分
-         const userInfoRes = await httpAjaxLoading(userType === "GYM" ? queryUserInfo_gym : getUserInfo_gyt)
+         // GYM,GYT,KLX 区分 code验证错误码的区分 管乐团是5000,其他的是403
+         userType === "GYT" && setCODE401(5000)
+         // GYM,GYT,KLX 区分 获取用户信息的接口区分
+         const userInfoApi = {
+            GYT: getUserInfo_gyt,
+            GYM: queryUserInfo_gym,
+            KLX: getUserInfo_klx
+         }
+         const userInfoRes = await httpAjaxLoading(userInfoApi[userType])
          if (userInfoRes.code !== 200) {
             return Promise.reject(userInfoRes)
          }
-         // GYM 和 GYT 区分 用户信息数据不一样区分
+         // GYM,GYT,KLX 区分 用户信息数据不一样区分
          this.userInfo = handleUserInfo(userType, userInfoRes.data)
-         this.roles = userType as any
-         // GYM 和 GYT 区分  区分菜单然后分配路由
-         return Promise.resolve(userType === "GYM" ? menus_gym : menus_gyt)
+         this.roles = userType
+         // GYM,GYT,KLX 区分  区分菜单然后分配路由
+         const menusObj = {
+            GYT: menus_gyt,
+            GYM: menus_gym,
+            KLX: menus_klx
+         }
+         return Promise.resolve(menusObj[userType])
       },
       /** 退出登录 */
       async loginOut() {
-         // GYM 和 GYT 区分  区分退出登录
-         const logoutRes = await httpAjax(this.roles === "GYM" ? logout_gym : logout_gyt)
+         // GYM,GYT,KLX 区分  区分退出登录
+         const logoutApi = {
+            GYT: logout_gyt,
+            GYM: logout_gym,
+            KLX: logout_klx
+         }
+         const logoutRes = await httpAjax(logoutApi[this.roles!])
          if (logoutRes.code !== 200) {
             return Promise.reject(logoutRes)
          }
@@ -86,9 +106,9 @@ export default () => {
    return useStore(store)
 }
 
-function handleUserInfo(userType: string, userInfo: Record<string, any>) {
+function handleUserInfo(userType: rolesType, userInfo: Record<string, any>) {
    let avatar, username, realName, phone
-   if (userType === "GYM") {
+   if (["GYM", "KLX"].includes(userType)) {
       avatar = userInfo.avatar
       username = userInfo.username
       realName = userInfo.realName

+ 3 - 0
src/type.d.ts

@@ -25,6 +25,9 @@ declare interface menuType {
    }
 }
 
+/** 角色类型 */
+declare type rolesType = "GYM" | "GYT" | "KLX"
+
 /**
  *type tool
  */

+ 37 - 5
src/views/cloudTextbooks/cloudTextbooks.vue

@@ -9,6 +9,18 @@
          <div class="headCon">
             <div class="operate">
                <dictionary
+                  v-if="albumOpt.length > 1"
+                  class="albumOpt"
+                  :popper-class="'classTypePopper'"
+                  v-model="albumId"
+                  :width="200"
+                  :height="40"
+                  :clearable="false"
+                  :options="albumOpt"
+                  placeholder="专辑"
+                  @change="handleQuery"
+               />
+               <dictionary
                   :popper-class="'classTypePopper'"
                   v-model="classType"
                   :width="150"
@@ -61,12 +73,12 @@ import chooseDialog from "./chooseDialog.vue"
 import userStore from "@/store/modules/user"
 import { useDataList } from "./useData"
 import { debounce } from "@/libs/tools"
-import { getLessonCoursewareSubjectList_gym } from "@/api/cloudTextbooks.api"
+import { getLessonCoursewareSubjectList_gym, queryPageSubject_klx } from "@/api/cloudTextbooks.api"
 import { httpAjax } from "@/plugin/httpAjax"
 import myInput from "@/components/myInput"
 
 const userStoreHook = userStore()
-const { handleGetList, listData, loading, handleListQuery } = useDataList()
+const { handleGetList, listData, loading, albumId, albumOpt, handleListQuery } = useDataList()
 
 const navs = [
    {
@@ -99,7 +111,7 @@ enum courseEmnu {
    TUBA_SINGLE = "大号"
 }
 function handleGetClassTypeOpt() {
-   //  区分管乐团和管乐迷课程类型
+   //  GYM,GYT,KLX 区分   课程类型
    if (userStoreHook.roles === "GYM") {
       httpAjax(getLessonCoursewareSubjectList_gym).then(res => {
          if (res.code === 200) {
@@ -108,7 +120,7 @@ function handleGetClassTypeOpt() {
                   value: "",
                   label: "全部"
                },
-               ...res.data.map((item: any) => {
+               ...(res.data || []).map((item: any) => {
                   return {
                      value: item.id,
                      label: item.name
@@ -117,7 +129,7 @@ function handleGetClassTypeOpt() {
             ]
          }
       })
-   } else {
+   } else if (userStoreHook.roles === "GYT") {
       classTypeOpt.value = [
          {
             value: "",
@@ -130,6 +142,23 @@ function handleGetClassTypeOpt() {
             }
          })
       ]
+   } else if (userStoreHook.roles === "KLX") {
+      httpAjax(queryPageSubject_klx).then(res => {
+         if (res.code === 200) {
+            classTypeOpt.value = [
+               {
+                  value: "",
+                  label: "全部"
+               },
+               ...(res.data?.rows || []).map((item: any) => {
+                  return {
+                     value: item.id,
+                     label: item.name
+                  }
+               })
+            ]
+         }
+      })
    }
 }
 
@@ -169,6 +198,9 @@ function handleClick(id: string) {
          .queryIpt {
             margin-left: 12px;
          }
+         > :deep(.albumOpt) {
+            margin-right: 12px;
+         }
       }
    }
    .cloudTextbooksCon {

+ 110 - 7
src/views/cloudTextbooks/useData.ts

@@ -4,7 +4,10 @@ import {
    queryLessonCourseware_gym,
    getLessonCoursewareCourseList_gym,
    getMyCourseware_gyt,
-   getMyCoursewareDetail_gyt
+   getMyCoursewareDetail_gyt,
+   getuyAlbumInfo_klx,
+   queryLessonCourseware_klx,
+   getLessonCoursewareCourseList_klx
 } from "@/api/cloudTextbooks.api"
 
 import { httpAjaxErrMsg, httpAjax } from "@/plugin/httpAjax"
@@ -29,14 +32,47 @@ export const useDataList = () => {
    const userStoreHook = userStore()
    const listData = shallowRef<listType>([])
    let storeData: listType[number] = []
+   // 专辑
+   const albumId = ref("")
+   const albumOpt = shallowRef<{ value: string; label: string }[]>([])
    const loading = ref(false)
    let coursewareController: AbortController
 
    function handleGetList() {
-      userStoreHook.roles === "GYM" ? handleGetList_gym("", "") : handleGetList_gyt()
+      //  GYM,GYT,KLX 区分   获取列表数据
+      if (userStoreHook.roles === "GYM") {
+         handleGetList_gym("", "")
+      } else if (userStoreHook.roles === "GYT") {
+         handleGetList_gyt()
+      } else if (userStoreHook.roles === "KLX") {
+         httpAjax(getuyAlbumInfo_klx).then(res => {
+            if (res.code === 200) {
+               // 专辑赋值
+               albumOpt.value = (res.data || []).reduce((arr: any[], item: any) => {
+                  if (item.coursewareCounts > 0) {
+                     arr.push({
+                        value: item.id,
+                        label: item.name
+                     })
+                  }
+                  return arr
+               }, [])
+               // 默认取第一个专辑
+               albumOpt.value.length && (albumId.value = albumOpt.value[0].value)
+               handleGetList_klx("", albumId.value, "")
+            }
+         })
+      }
    }
    function handleListQuery(type: string, queryStr: string) {
-      userStoreHook.roles === "GYM" ? handleQueryGetList_gym(type, queryStr) : handleQueryGetList_gyt(type, queryStr)
+      //  GYM,GYT,KLX 区分   查询列表数据
+      if (userStoreHook.roles === "GYM") {
+         handleQueryGetList_gym(type, queryStr)
+      } else if (userStoreHook.roles === "GYT") {
+         handleQueryGetList_gyt(type, queryStr)
+      } else if (userStoreHook.roles === "KLX") {
+         handleQueryGetList_klx(type, albumId.value, queryStr)
+      }
    }
 
    // 获取管乐团数据
@@ -107,8 +143,53 @@ export const useDataList = () => {
    function handleQueryGetList_gym(type: string, queryStr: string) {
       handleGetList_gym(type, queryStr)
    }
-
-   return { loading, listData, handleGetList, handleListQuery }
+   // 获取酷乐秀数据
+   function handleGetList_klx(type: string, albumId: string, queryStr: string) {
+      // 当没有专辑id时候 不查询
+      if (!albumId) {
+         return
+      }
+      if (coursewareController) {
+         coursewareController.abort()
+      }
+      coursewareController = new AbortController()
+      loading.value = true
+      httpAjax(queryLessonCourseware_klx, type, albumId, coursewareController).then(res => {
+         // 自己关闭的时候不取消加载
+         if (res.code === CODE_ERR_CANCELED) {
+            return
+         }
+         loading.value = false
+         if (res.code === 200) {
+            const data = (res.data?.rows || []).reduce((arr: any[], item: any) => {
+               if (queryStr ? item.musicSheetName.includes(queryStr) : true) {
+                  arr.push({
+                     name: item.musicSheetName,
+                     type: item.subjectId,
+                     img: item.titleImg,
+                     id: item.id,
+                     courseNum: item.courseNum
+                  })
+               }
+               return arr
+            }, [])
+            listData.value = chunkArray(data, 5)
+         } else {
+            if (res.code !== 511) {
+               ElMessage({
+                  showClose: true,
+                  message: res.message,
+                  type: "error"
+               })
+            }
+         }
+      })
+   }
+   // 管乐迷数据查询
+   function handleQueryGetList_klx(type: string, albumId: string, queryStr: string) {
+      handleGetList_klx(type, albumId, queryStr)
+   }
+   return { loading, listData, albumId, albumOpt, handleGetList, handleListQuery }
 }
 
 /**
@@ -131,7 +212,14 @@ export const useDataDetailList = () => {
       return [data[0] || [], data[1] || []]
    })
    function handleGetDetailList(id: string) {
-      userStoreHook.roles === "GYM" ? handleGetDetaList_gym(id) : handleGetDetailList_gyt(id)
+      //  GYM,GYT,KLX 区分   查询详情列表
+      if (userStoreHook.roles === "GYM") {
+         handleGetDetaList_gym(id)
+      } else if (userStoreHook.roles === "GYT") {
+         handleGetDetailList_gyt(id)
+      } else if (userStoreHook.roles === "KLX") {
+         handleGetDetailList_klx(id)
+      }
    }
    function handlePage(type: "next" | "prev") {
       type === "next" ? pageNum.value++ : pageNum.value--
@@ -170,7 +258,22 @@ export const useDataDetailList = () => {
          }
       })
    }
-
+   // 获取酷乐秀
+   function handleGetDetailList_klx(id: string) {
+      loading.value = true
+      httpAjaxErrMsg(getLessonCoursewareCourseList_klx, id).then(res => {
+         loading.value = false
+         if (res.code === 200) {
+            const data = (res.data || []).map((item: any) => {
+               return {
+                  name: item.coursewareDetailName,
+                  id: item.coursewareDetailId
+               }
+            })
+            listData.value = chunkArray(chunkArray(data, 7), 2)
+         }
+      })
+   }
    return {
       handleGetDetailList,
       loading,

+ 26 - 14
src/views/coursewarePlay/coursewarePlay.vue

@@ -79,7 +79,7 @@
          <div class="leftMenu">
             <img @click="handleGoBack" class="backImg" src="@/img/coursewarePlay/back.png" />
             <playRecordTime
-               v-if="route.query.modeId && coursewareTotalTime && !(userStoreHook.roles === 'GYM')"
+               v-if="route.query.modeId && coursewareTotalTime && userStoreHook.roles === 'GYT'"
                :modeId="route.query.modeId as string"
                :coursewareTotalTime="coursewareTotalTime"
             />
@@ -119,7 +119,7 @@
 
 <script setup lang="ts">
 import videoPlay from "./videoPlay"
-import { getLessonCourseDetail_gym, getLessonCoursewareDetail_gyt } from "@/api/cloudTextbooks.api"
+import { getLessonCourseDetail_gym, getLessonCoursewareDetail_gyt, getLessonCourseDetail_klx } from "@/api/cloudTextbooks.api"
 import { checkWebCourse_gyt } from "@/api/coursewarePlay.api"
 import { httpAjaxErrMsg, httpAjaxLoadingErrMsg } from "@/plugin/httpAjax"
 import userStore from "@/store/modules/user"
@@ -132,7 +132,7 @@ import playRecordTime from "./components/playRecordTime"
 import useDialogConfirm from "@/hooks/useDialogConfirm"
 import { getRecentCourseSchedule_gym } from "@/api/homePage.api"
 import { getToken } from "@/libs/auth"
-import { URL_TEACH_GYT, URL_TEACH_GYM } from "@/config"
+import { URL_TEACH_GYT, URL_TEACH_GYM, URL_TEACH_KLX } from "@/config"
 
 const route = useRoute()
 const userStoreHook = userStore()
@@ -156,9 +156,13 @@ const songPlaySrc = computed<string>(() => {
    if (fileType.value !== "SONG") {
       return ""
    }
-   return userStoreHook.roles === "GYM"
-      ? `${URL_TEACH_GYM}?Authorization=${getToken()}&platform=web&liveConfig=1#/detail/${activeCourseware.value?.content}?isHideBack=true`
-      : `${URL_TEACH_GYT}?id=${activeCourseware.value?.content}&modelType=practice&modeType=json&Authorization=${getToken()}`
+   //  GYM,GYT,KLX 区分   云教练
+   const urlObj = {
+      GYT: `${URL_TEACH_GYT}?id=${activeCourseware.value?.content}&modelType=practice&modeType=json&Authorization=${getToken()}`,
+      GYM: `${URL_TEACH_GYM}?Authorization=${getToken()}&platform=web&liveConfig=1#/detail/${activeCourseware.value?.content}?isHideBack=true`,
+      KLX: `${URL_TEACH_KLX}??Authorization=${getToken()}&id=${activeCourseware.value?.content}&isHideBack=true&limitModel=practice`
+   }
+   return urlObj[userStoreHook.roles!]
 })
 const activeCoursewareIndex = ref(0)
 const drawerShow = ref(false)
@@ -178,7 +182,13 @@ watch(activeCourseware, () => {
 })
 getCoursewareList()
 function getCoursewareList() {
-   httpAjaxErrMsg(userStoreHook.roles === "GYM" ? getLessonCourseDetail_gym : getLessonCoursewareDetail_gyt, route.params.id as string).then(res => {
+   //  GYM,GYT,KLX 区分   查询接口
+   const LessonCoursewareDetailApi = {
+      GYT: getLessonCoursewareDetail_gyt,
+      GYM: getLessonCourseDetail_gym,
+      KLX: getLessonCourseDetail_klx
+   }
+   httpAjaxErrMsg(LessonCoursewareDetailApi[userStoreHook.roles!], route.params.id as string).then(res => {
       if (res.code === 200) {
          const { lockFlag, knowledgePointList } = res.data || {}
          if (lockFlag) {
@@ -357,7 +367,7 @@ function handleCoursewareEnd() {
                }
             }
          })
-      } else {
+      } else if (userStoreHook.roles === "GYT") {
          httpAjaxLoadingErrMsg(checkWebCourse_gyt, route.query.modeId as string).then(res => {
             if (res.code === 200) {
                if (res.data?.signOut === false) {
@@ -383,14 +393,16 @@ function handleCoursewareEnd() {
 // 去练习
 const activeCoursewareResourceId = computed<string | undefined>(() => {
    const materialRefs = activeCourseware.value?.materialRefs
-   return materialRefs ? (userStoreHook.roles === "GYM" ? materialRefs[0]?.resourceIdStr : materialRefs[0]?.resourceId) : undefined
+   return materialRefs ? (["GYM", "KLX"].includes(userStoreHook.roles!) ? materialRefs[0]?.resourceIdStr : materialRefs[0]?.resourceId) : undefined
 })
 function handleGoPracticeBtn(activeCoursewareResourceId: string) {
-   const url =
-      userStoreHook.roles === "GYM"
-         ? `${URL_TEACH_GYM}?Authorization=${getToken()}&platform=web&liveConfig=1#/detail/${activeCoursewareResourceId}?isHideBack=true`
-         : `${URL_TEACH_GYT}?id=${activeCoursewareResourceId}&modelType=practice&modeType=json&Authorization=${getToken()}`
-   window.open(url, "_blank")
+   //  GYM,GYT,KLX 区分   云教练
+   const urlObj = {
+      GYT: `${URL_TEACH_GYT}?id=${activeCoursewareResourceId}&modelType=practice&modeType=json&Authorization=${getToken()}`,
+      GYM: `${URL_TEACH_GYM}?Authorization=${getToken()}&platform=web&liveConfig=1#/detail/${activeCoursewareResourceId}?isHideBack=true`,
+      KLX: `${URL_TEACH_KLX}??Authorization=${getToken()}&id=${activeCoursewareResourceId}&isHideBack=true&limitModel=practice`
+   }
+   window.open(urlObj[userStoreHook.roles!], "_blank")
 }
 </script>
 

+ 47 - 8
src/views/homePage/homePage.vue

@@ -8,12 +8,7 @@
       <div class="homePage">
          <ElScrollbar class="elScrollbar">
             <div class="classTypes">
-               <div
-                  class="classType"
-                  v-for="item in userStoreHook.roles === 'GYM' ? classTypes_gym : classTypes_gyt"
-                  :key="item.name"
-                  @click="handleRouter(item.url)"
-               >
+               <div class="classType" v-for="item in classTypeObj[userStoreHook.roles!]" :key="item.name" @click="handleRouter(item.url)">
                   <img :src="item.img" />
                   <div>{{ item.name }}</div>
                </div>
@@ -25,7 +20,7 @@
                         <div class="line"></div>
                         <div class="title">下次课程</div>
                      </div>
-                     <img class="rightRouter" @click="handleRouterCurriculum" src="@/img/homePage/back.png" />
+                     <img v-if="userStoreHook.roles !== 'KLX'" class="rightRouter" @click="handleRouterCurriculum" src="@/img/homePage/back.png" />
                   </div>
                   <el-skeleton class="elSkeleton" :loading="classDataLoading">
                      <template #template>
@@ -142,6 +137,43 @@ const classTypes_gyt = [
       url: "/cloudTextbooks"
    }
 ]
+const classTypes_klx = [
+   {
+      img: require("@/img/homePage/kb.png"),
+      name: "课表",
+      url: ""
+   },
+   {
+      img: require("@/img/homePage/xl.png"),
+      name: "训练",
+      url: ""
+   },
+   {
+      img: require("@/img/homePage/jdcp.png"),
+      name: "进度测评",
+      url: ""
+   },
+   {
+      img: require("@/img/homePage/xltj.png"),
+      name: "训练统计",
+      url: ""
+   },
+   {
+      img: require("@/img/homePage/yjl.png"),
+      name: "云练习",
+      url: "/cloudPractice"
+   },
+   {
+      img: require("@/img/homePage/yjc.png"),
+      name: "云课堂",
+      url: "/cloudTextbooks"
+   }
+]
+const classTypeObj = {
+   GYT: classTypes_gyt,
+   GYM: classTypes_gym,
+   KLX: classTypes_klx
+}
 
 /* 下次课程信息 */
 const classData = ref<Record<string, any>>({})
@@ -149,7 +181,14 @@ const classDataLoading = ref(true)
 const isEmptyClassData = computed(() => {
    return !Object.keys(classData.value).length
 })
-handleClassData()
+
+// 现在酷乐秀没有课表功能
+if (userStoreHook.roles !== "KLX") {
+   handleClassData()
+} else {
+   classDataLoading.value = false
+}
+
 function handleClassData() {
    if (userStoreHook.roles === "GYM") {
       classDataLoading.value = true

+ 9 - 3
src/viewsframe/login/login.vue

@@ -40,7 +40,7 @@ import { ref, computed } from "vue"
 import userStore from "@/store/modules/user"
 import { useRouter } from "vue-router"
 import useSecureAnth from "@/hooks/useSecureAnth"
-import { mutualTLSQuery_gym, mutualTLSQuery_gyt } from "@/api/user.api"
+import { mutualTLSQuery_gym, mutualTLSQuery_gyt, mutualTLSQuery_klx } from "@/api/user.api"
 import { httpAjaxLoading } from "@/plugin/httpAjax"
 
 const userStoreHook = userStore()
@@ -69,8 +69,14 @@ function handleQrcodeStatus() {
          if (status === "FINISH") {
             // 登录成功
             userStoreHook.login(res.data).then(() => {
-               // 安全证书
-               httpAjaxLoading(res.data.appKey === "GYM" ? mutualTLSQuery_gym : mutualTLSQuery_gyt).then(res => {
+               const appKey = res.data.appKey as rolesType
+               // GYM,GYT,KLX 区分  安全证书
+               const mutualTLSQueryApi = {
+                  GYT: mutualTLSQuery_gyt,
+                  GYM: mutualTLSQuery_gym,
+                  KLX: mutualTLSQuery_klx
+               }
+               httpAjaxLoading(mutualTLSQueryApi[appKey]).then(res => {
                   if (res.code === 511) {
                      useSecureAnth({
                         onCancel() {

+ 6 - 0
vue.config.js

@@ -43,6 +43,12 @@ module.exports = defineConfig({
             pathRewrite: {
                "^/gyt": ""
             }
+         },
+         "/klx": {
+            target: "https://dev.colexiu.com",
+            pathRewrite: {
+               "^/klx": ""
+            }
          }
       }
    }