Browse Source

修改问题

lex-xin 5 months ago
parent
commit
e3118c8f22

+ 0 - 1
src/components/CCascader/index.tsx

@@ -142,7 +142,6 @@ export default defineComponent({
     const valueText = computed(() => {
       const id = props.value;
       const values = getValues(id);
-      console.log(values, 'values')
       const names: any = [];
       audioPlayTypeList.value.forEach((item: any) => {
         if (item.id === state.tempAudioPlayTypes && props.showAudioPlayType) {

+ 7 - 3
src/store/modules/users.ts

@@ -8,6 +8,7 @@ import {
 } from '@/store/mutation-types';
 import { storage } from '@/utils/storage';
 import { userLogin, getUserInfo } from '@/api/user';
+import { getAuthForAdmin } from '/src/utils';
 
 export interface IUserState {
   token: string;
@@ -38,9 +39,12 @@ export const useUserStore = defineStore('user-store', {
     getToken(): string {
       // 为了处理课堂乐器后台预览课件的功能
       let Authorization = this.token;
-      const authSource = sessionStorage.getItem('authSource');
-      if (authSource === 'admin' && storage.get(ACCESS_TOKEN_ADMIN)) {
-        Authorization = storage.get(ACCESS_TOKEN_ADMIN);
+      // 为了处理课堂乐器后台预览课件的功能
+      const userAuth = getAuthForAdmin();
+      if (userAuth.authSource === 'admin') {
+        Authorization = userAuth.Authorization;
+      } else {
+        Authorization = this.token || '';
       }
       return Authorization;
     },

+ 1 - 12
src/utils/request.ts

@@ -29,18 +29,7 @@ request.interceptors.request.use(
 
     const userStore = useUserStore();
 
-    let Authorization = '';
-    // 为了处理课堂乐器后台预览课件的功能
-    // const authSource = sessionStorage.getItem('authSource');
-    const userAuth = getAuthForAdmin()
-    if (userAuth.authSource === 'admin') {
-      // if(storage.get(ACCESS_TOKEN_ADMIN)) {
-      //   Authorization = storage.get(ACCESS_TOKEN_ADMIN);
-      // }
-      Authorization = userAuth.Authorization
-    } else {
-      Authorization = userStore.getToken || '';
-    }
+    let Authorization = userStore.getToken || '';
     const authHeaders: any = {};
     // if (
     //   userStore.getUserInfo &&

+ 1 - 0
src/views/prepare-lessons/components/lesson-main/courseware-head/index.tsx

@@ -41,6 +41,7 @@ export default defineComponent({
       }) as any;
       // item.instrumentIds = ids;
       forms.subjects = ids;
+      eventGlobal.emit('coursewareSubjectChange', forms.subjects)
     };
 
     const getForms = () => {

+ 0 - 1
src/views/prepare-lessons/components/resource-main/components/resource-item/resource-search-group/index.tsx

@@ -86,7 +86,6 @@ export default defineComponent({
       if(tags.length > 0) {
         tags[0].columnName = '声部'
 
-        console.log(tags[0])
         const firstChild = tags[0]
         forms.subjectId = firstChild.value
         forms.musicalInstrumentId = firstChild.children[0]?.value