Browse Source

Merge branch 'iteration-20250107-url'

lex-xin 2 months ago
parent
commit
53930f1030
82 changed files with 258 additions and 251 deletions
  1. 3 2
      src/components/col-img-code/index.tsx
  2. 1 1
      src/helpers/validate.ts
  3. 6 6
      src/student/group-class/group-detail.tsx
  4. 0 12
      src/student/home/components/hot-album/index.tsx
  5. 0 20
      src/student/home/components/info-list/index.tsx
  6. 2 4
      src/student/home/index.tsx
  7. 6 6
      src/student/live-class/live-detail.tsx
  8. 2 2
      src/student/member-center/member-active-o.tsx
  9. 2 2
      src/student/member-center/member-record.tsx
  10. 4 5
      src/student/share-active/track-review-activity/index.tsx
  11. 2 2
      src/student/share-active/track-review-activity/track-song.tsx
  12. 2 2
      src/student/video-class/video-class-detail.tsx
  13. 7 7
      src/student/video-class/video-detail.tsx
  14. 3 3
      src/teacher/cash-protocol/index.tsx
  15. 2 1
      src/teacher/group-class/group-detail.tsx
  16. 2 1
      src/teacher/live-class/live-detail.tsx
  17. 4 3
      src/teacher/music/upload-protocol/index.tsx
  18. 4 3
      src/teacher/music/upload/message-tip/index.tsx
  19. 2 1
      src/teacher/piano-room/model/share/index.tsx
  20. 3 3
      src/teacher/share-page/share-album/index.tsx
  21. 5 6
      src/teacher/share-page/share-group/index.tsx
  22. 5 6
      src/teacher/share-page/share-live/index.tsx
  23. 8 8
      src/teacher/share-page/share-mall/index.tsx
  24. 2 2
      src/teacher/share-page/share-music-sheet/index.tsx
  25. 3 3
      src/teacher/share-page/share-music/index.tsx
  26. 5 6
      src/teacher/share-page/share-video/index.tsx
  27. 3 3
      src/teacher/share-page/share-vip/index.tsx
  28. 2 1
      src/teacher/share-page/track-review-activity/index.tsx
  29. 2 2
      src/teacher/statistics/exercise-detail/exercise-detail.tsx
  30. 8 0
      src/teacher/statistics/home-statistics-detail/list/index.module.less
  31. 1 1
      src/teacher/statistics/home-statistics-detail/list/index.tsx
  32. 2 2
      src/teacher/statistics/home-statistics/index.tsx
  33. 9 2
      src/teacher/statistics/practice-statistics-detail/index.module.less
  34. 2 2
      src/teacher/teacher-cert/index.tsx
  35. 2 1
      src/teacher/video-class/video-detail.tsx
  36. 2 1
      src/tenant/exercise-record/modals/detail-item.tsx
  37. 3 3
      src/tenant/music/album-detail/index.tsx
  38. 3 3
      src/tenant/music/courseList/index.tsx
  39. 3 3
      src/tenant/music/courseListSearch/index.tsx
  40. 2 2
      src/tenant/music/coursewarePlay/component/musicScore.tsx
  41. 2 2
      src/tenant/music/lessonCourseware/index.tsx
  42. 2 2
      src/tenant/music/list/index.tsx
  43. 2 1
      src/tenant/music/list/item.tsx
  44. 2 1
      src/tenant/music/list/list.tsx
  45. 21 21
      src/tenant/music/music-detail/index.tsx
  46. 2 2
      src/tenant/music/music-detail/new-index.tsx
  47. 2 2
      src/tenant/music/music.ts
  48. 2 1
      src/tenant/music/personal/collection.tsx
  49. 2 1
      src/tenant/music/personal/personal.tsx
  50. 2 1
      src/tenant/music/personal/practice.tsx
  51. 3 3
      src/tenant/music/search/header.tsx
  52. 2 1
      src/tenant/music/search/music-swiper.tsx
  53. 4 3
      src/tenant/music/search/result-all-search.tsx
  54. 2 1
      src/tenant/music/search/searchAlbum.tsx
  55. 2 1
      src/tenant/music/songbook/list.tsx
  56. 2 2
      src/tenant/music/train-list/index.tsx
  57. 2 1
      src/tenant/music/train-list/item.tsx
  58. 2 1
      src/tenant/music/train-list/list.tsx
  59. 5 5
      src/views/adapay/pay-define/index.tsx
  60. 6 6
      src/views/adapay/pay-result/index.tsx
  61. 2 1
      src/views/article-center/theory.tsx
  62. 4 3
      src/views/creation/index-share.tsx
  63. 2 1
      src/views/creation/share-model/index.tsx
  64. 2 2
      src/views/member-center/index copy.tsx
  65. 2 2
      src/views/member-center/index.tsx
  66. 3 3
      src/views/music/album-detail/index.tsx
  67. 2 2
      src/views/music/list/index.tsx
  68. 2 1
      src/views/music/list/item.tsx
  69. 2 1
      src/views/music/list/list.tsx
  70. 9 9
      src/views/music/music-detail/index---copy.tsx
  71. 2 2
      src/views/music/music-detail/index.tsx
  72. 2 2
      src/views/music/music.ts
  73. 2 1
      src/views/music/personal/collection.tsx
  74. 2 1
      src/views/music/personal/personal.tsx
  75. 2 1
      src/views/music/personal/practice.tsx
  76. 2 1
      src/views/music/songbook/list.tsx
  77. 3 3
      src/views/order-detail/index.tsx
  78. 3 3
      src/views/order-detail/userAuth/index.tsx
  79. 6 6
      src/views/shop-mall/goods-detail/index.tsx
  80. 2 2
      src/views/shop-mall/index.tsx
  81. 2 2
      src/views/tenantStudentRejest/index.tsx
  82. 2 1
      src/views/tenantTeacherRejest/index.tsx

+ 3 - 2
src/components/col-img-code/index.tsx

@@ -3,6 +3,7 @@ import { Col, Popup, Row, Image as VanImage, Loading, Field, Toast } from 'vant'
 import styles from './index.module.less'
 import request from '@/helpers/request'
 import { state } from '@/state'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'imgCode',
@@ -24,7 +25,7 @@ export default defineComponent({
     }
   },
   data() {
-    const origin = window.location.origin
+    const origin = getHttpOrigin()
     const suffix =
       state.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
     return {
@@ -51,7 +52,7 @@ export default defineComponent({
   methods: {
     async updateIdentifyingCode() {
       // 刷新token
-      const origin = window.location.origin
+      const origin = getHttpOrigin()
       this.identifyingCode = `${origin}${
         this.isSuffix
       }/code/getImageCode?phone=${this.phone}&token=${Math.random()}`

+ 1 - 1
src/helpers/validate.ts

@@ -1,6 +1,6 @@
 // 学生地址
 export function vaildStudentUrl() {
-  const url = window.location.href;
+  const url = window.location.origin;
   let returnUrl = '';
   if (/online/.test(url)) {
     //线上

+ 6 - 6
src/student/group-class/group-detail.tsx

@@ -15,7 +15,7 @@ import ColShare from '@/components/col-share'
 import LiveItem from '@/views/live-class/live-item'
 import iconShare from '@/views/shop-mall/images/icon-share.svg'
 import { state } from '@/state'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { tradeOrder } from '../trade/tradeOrder'
 import { courseType } from '@/constant'
 import GroupPlanStep from '@/business-components/group-plan-step'
@@ -127,11 +127,11 @@ export default defineComponent({
   },
   async mounted() {
     await this._init()
-    if (/(localhost|192)/g.test(location.origin)) {
-      this.shareUrl = `https://dev.colexiu.com/teacher/#/shareGroup?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&userType=${state.platformType}&p=tenant`
-    } else {
-      this.shareUrl = `${location.origin}/teacher/#/shareGroup?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&userType=${state.platformType}&p=tenant`
-    }
+    // if (/(localhost|192)/g.test(location.origin)) {
+    //   this.shareUrl = `https://dev.colexiu.com/teacher/#/shareGroup?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&userType=${state.platformType}&p=tenant`
+    // } else {
+      this.shareUrl = `${getHttpOrigin()}/teacher/#/shareGroup?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&userType=${state.platformType}&p=tenant`
+    // }
 
     /** 埋点 */
     useStatisticTracking({

+ 0 - 12
src/student/home/components/hot-album/index.tsx

@@ -24,10 +24,6 @@ export default defineComponent({
           <TheTitle
             title="热门专辑"
             onDetail={() => {
-              // const url = location.origin + location.pathname + '#/music-album'
-              // openDefaultWebView(url, () => {
-              //   router.push('/music-album')
-              // })
               event.emit('downloadApp')
             }}
           />
@@ -39,14 +35,6 @@ export default defineComponent({
               class={styles.album}
               key={item.id}
               onClick={() => {
-                // const url =
-                //   location.origin +
-                //   location.pathname +
-                //   '#/music-album-detail/' +
-                //   item.id
-                // openDefaultWebView(url, () => {
-                //   router.push('/music-album-detail/' + item.id)
-                // })
                 event.emit('downloadApp')
               }}
             >

+ 0 - 20
src/student/home/components/info-list/index.tsx

@@ -66,26 +66,6 @@ export default defineComponent({
                 <Cell
                   valueClass={styles.valueContent}
                   onClick={() => {
-                    // let url =
-                    //   location.origin +
-                    //   location.pathname +
-                    //   '#/specialDetail?id=' +
-                    //   item.id
-
-                    // if (verifyUrl(item.linkUrl)) {
-                    //   openDefaultWebView(item.linkUrl, () => {
-                    //     window.location.href = item.linkUrl
-                    //   })
-                    // } else {
-                    //   openDefaultWebView(url, () => {
-                    //     router.push({
-                    //       path: '/specialDetail',
-                    //       query: {
-                    //         id: item.id
-                    //       }
-                    //     })
-                    //   })
-                    // }
                     event.emit('downloadApp')
                   }}
                 >

+ 2 - 4
src/student/home/index.tsx

@@ -20,7 +20,7 @@ import {
   promisefiyPostMessage,
   removeListenerMessage
 } from '@/helpers/native-message'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { setLogout, state } from '@/state'
 import event from './event'
 
@@ -269,9 +269,7 @@ export default defineComponent({
                 postMessage({ api: 'openApp', content: { type: type } })
               } else {
                 const url = browser().orchestraAndroid
-                  ? window.location.origin +
-                    window.location.pathname +
-                    '#/download'
+                  ? getHttpOrigin() + window.location.pathname + '#/download'
                   : 'https://itunes.apple.com/cn/app/id1626971695?mt=8'
                 postMessage({
                   api: 'downloadApp',

+ 6 - 6
src/student/live-class/live-detail.tsx

@@ -15,7 +15,7 @@ import ColShare from '@/components/col-share'
 import LiveItem from '@/views/live-class/live-item'
 import iconShare from '@/views/shop-mall/images/icon-share.svg'
 import { state } from '@/state'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { tradeOrder } from '../trade/tradeOrder'
 import TheSticky from '@/components/the-sticky'
 import { useStatisticTracking } from '@/helpers/hooks'
@@ -122,11 +122,11 @@ export default defineComponent({
   },
   async mounted() {
     await this._init()
-    if (/(localhost|192)/g.test(location.origin)) {
-      this.shareUrl = `https://dev.colexiu.com/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&userType=${state.platformType}&p=tenant`
-    } else {
-      this.shareUrl = `${location.origin}/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&userType=${state.platformType}&p=tenant`
-    }
+    // if (/(localhost|192)/g.test(location.origin)) {
+    //   this.shareUrl = `https://dev.colexiu.com/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&userType=${state.platformType}&p=tenant`
+    // } else {
+      this.shareUrl = `${getHttpOrigin()}/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&userType=${state.platformType}&p=tenant`
+    // }
 
     /** 埋点 */
     useStatisticTracking({

+ 2 - 2
src/student/member-center/member-active-o.tsx

@@ -7,7 +7,7 @@ import btn from './images/active-o/btn.png'
 import { useRouter } from 'vue-router'
 import { postMessage } from '@/helpers/native-message'
 import { Icon } from 'vant'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import ColSticky from '@/components/col-sticky'
 import { state } from '@/state'
 
@@ -19,7 +19,7 @@ export default defineComponent({
     const onDetail = () => {
       // 判断是否是机构学生
       if (state.user.data.tenantId > 0) {
-        window.location.href = location.origin + '/tenant/#/memberCenter'
+        window.location.href = getHttpOrigin() + '/tenant/#/memberCenter'
       } else {
         router.push('/memberCenter')
       }

+ 2 - 2
src/student/member-center/member-record.tsx

@@ -15,7 +15,7 @@ import {
 } from 'vant'
 import { levelMember } from '@/constant'
 import request from '@/helpers/request'
-import { formatterDate } from '@/helpers/utils'
+import { formatterDate, getHttpOrigin } from '@/helpers/utils'
 import dayjs from 'dayjs'
 import ColResult from '@/components/col-result'
 import { postMessage } from '@/helpers/native-message'
@@ -206,7 +206,7 @@ export default defineComponent({
                       api: 'openAccompanyWebView',
                       content: {
                         url:
-                          location.origin + musicScorePath + '#/' +
+                          getHttpOrigin() + musicScorePath + '#/' +
                           'evaluat-report?id=' +
                           item.id +
                           '&behaviorId=' +

+ 4 - 5
src/student/share-active/track-review-activity/index.tsx

@@ -1,6 +1,6 @@
 import ColSticky from '@/components/col-sticky'
 import request from '@/helpers/request'
-import { browser, removeAuth } from '@/helpers/utils'
+import { browser, getHttpOrigin, removeAuth } from '@/helpers/utils'
 import { postMessage } from '@/helpers/native-message'
 import {
   Button,
@@ -298,7 +298,7 @@ export default defineComponent({
         const browserInfo = browser()
         const musicScorePath = "/klx-music-score/";
         const url = qs.stringifyUrl({
-          url: location.origin + musicScorePath,
+          url: getHttpOrigin() + musicScorePath,
           query: {
             id: selectMusic.musicSheetId,
             behaviorId: this.behaviorId,
@@ -334,14 +334,13 @@ export default defineComponent({
           return
         }
         // 如果不在app里面则不需要唤起操作
-        const { origin } = location
         const str =
-          origin +
+        getHttpOrigin() +
           `/student/#/track-review-activity?id=${this.id}&recomUserId=${this.recomUserId}`
         shareCall(str, {})
         // 不管有没有唤起,则跳转到下载页面
         setTimeout(() => {
-          window.location.href = location.origin + '/student/#/download'
+          window.location.href = getHttpOrigin() + '/student/#/download'
         }, 3000)
       } else {
         this.popupStatus = false

+ 2 - 2
src/student/share-active/track-review-activity/track-song.tsx

@@ -4,7 +4,7 @@ import { useEventListener, useWindowScroll } from '@vueuse/core'
 import { defineComponent } from 'vue'
 import { Button, Cell, CellGroup, Image } from 'vant'
 import styles from './index.module.less'
-import { browser, getRandomKey } from '@/helpers/utils'
+import { browser, getHttpOrigin, getRandomKey } from '@/helpers/utils'
 import qs from 'query-string'
 import request from '@/helpers/request'
 import { postMessage } from '@/helpers/native-message'
@@ -105,7 +105,7 @@ export default defineComponent({
         const browserInfo = browser()
         const musicScorePath = "/klx-music-score/";
         const url = qs.stringifyUrl({
-          url: location.origin + musicScorePath,
+          url: getHttpOrigin() + musicScorePath,
           query: {
             id: item.musicSheetId,
             behaviorId: this.behaviorId,

+ 2 - 2
src/student/video-class/video-class-detail.tsx

@@ -26,7 +26,7 @@ import iconTeacher from '@common/images/icon_teacher.png'
 import ColResult from '@/components/col-result'
 import dayjs from 'dayjs'
 import { onSubmitZero, orderStatus } from '@/views/order-detail/orderStatus'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { usePageVisibility } from '@vant/use'
 import ColSticky from '@/components/col-sticky'
 
@@ -254,7 +254,7 @@ export default defineComponent({
                           postMessage({
                             api: 'openWebView',
                             content: {
-                              url: `${location.origin}${location.pathname}#/memberCenter`,
+                              url: `${getHttpOrigin()}${location.pathname}#/memberCenter`,
                               orientation: 1,
                               isHideTitle: false
                             }

+ 7 - 7
src/student/video-class/video-detail.tsx

@@ -14,7 +14,7 @@ import iconShare from '@/views/shop-mall/images/icon-share.svg'
 import ColShare from '@/components/col-share'
 import LiveItem from '@/views/live-class/live-item'
 import { setLogin, state } from '@/state'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { usePageVisibility } from '@vant/use'
 import TheSticky from '@/components/the-sticky'
 import { useStatisticTracking } from '@/helpers/hooks'
@@ -47,11 +47,11 @@ export default defineComponent({
   async mounted() {
     this.pageVisibility = usePageVisibility()
     await this._init()
-    if (/(localhost|192)/g.test(location.origin)) {
-      this.shareUrl = `https://dev.colexiu.com/teacher#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.groupId}&userType=${state.platformType}&p=tenant`
-    } else {
-      this.shareUrl = `${location.origin}/teacher#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.groupId}&userType=${state.platformType}&p=tenant`
-    }
+    // if (/(localhost|192)/g.test(location.origin)) {
+    //   this.shareUrl = `https://dev.colexiu.com/teacher#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.groupId}&userType=${state.platformType}&p=tenant`
+    // } else {
+      this.shareUrl = `${getHttpOrigin()}/teacher#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.groupId}&userType=${state.platformType}&p=tenant`
+    // }
 
     /** 埋点 */
     useStatisticTracking({
@@ -147,7 +147,7 @@ export default defineComponent({
             postMessage({
               api: 'openWebView',
               content: {
-                url: `${location.origin}${location.pathname}#/memberCenter`,
+                url: `${getHttpOrigin()}${location.pathname}#/memberCenter`,
                 orientation: 1,
                 isHideTitle: false
               }

+ 3 - 3
src/teacher/cash-protocol/index.tsx

@@ -7,7 +7,7 @@ import { postMessage } from '@/helpers/native-message'
 import { state } from '@/state'
 import ColHeader from '@/components/col-header'
 import TheSticky from '@/components/the-sticky'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'cash-protocol',
@@ -51,7 +51,7 @@ export default defineComponent({
             }
           )
           this.url =
-            window.location.origin +
+            getHttpOrigin() +
             window.location.pathname +
             '/pdf/web/viewer.html?file=' +
             encodeURIComponent(res.data) +
@@ -67,7 +67,7 @@ export default defineComponent({
           )
 
           this.url =
-            window.location.origin +
+            getHttpOrigin() +
             window.location.pathname +
             '/pdf/web/viewer.html?file=' +
             encodeURIComponent(res.data.origanalFileUrl) +

+ 2 - 1
src/teacher/group-class/group-detail.tsx

@@ -16,6 +16,7 @@ import styles from './group-detail.module.less'
 import ColHeader from '@/components/col-header'
 import GroupPlanStep from '@/business-components/group-plan-step'
 import TheSticky from '@/components/the-sticky'
+import { getHttpOrigin } from '@/helpers/utils'
 interface IProps {
   courseTime: string
   coursePlan: string
@@ -141,7 +142,7 @@ export default defineComponent({
         this.myself = !res.data.myself
       }
 
-      this.shareUrl = `${location.origin}/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&p=tenant`
+      this.shareUrl = `${getHttpOrigin()}/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&p=tenant`
       // console.log(this.live)
     } catch {
       //

+ 2 - 1
src/teacher/live-class/live-detail.tsx

@@ -15,6 +15,7 @@ import { defineComponent } from 'vue'
 import styles from './live-detail.module.less'
 import ColHeader from '@/components/col-header'
 import TheSticky from '@/components/the-sticky'
+import { getHttpOrigin } from '@/helpers/utils'
 interface IProps {
   courseTime: string
   coursePlan: string
@@ -136,7 +137,7 @@ export default defineComponent({
         this.myself = !res.data.myself
       }
 
-      this.shareUrl = `${location.origin}/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&p=tenant`
+      this.shareUrl = `${getHttpOrigin()}/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}&p=tenant`
       // console.log(this.live)
     } catch {
       //

+ 4 - 3
src/teacher/music/upload-protocol/index.tsx

@@ -1,6 +1,7 @@
 import ColHeader from '@/components/col-header'
 import styles from './index.module.less'
 import { defineComponent } from 'vue'
+import { getHttpOrigin } from '@/helpers/utils'
 
 // 预览协议 - 原生实名认证使用
 export default defineComponent({
@@ -15,12 +16,12 @@ export default defineComponent({
   async mounted() {
     const type = this.$route.query.type
     if (type === 'question') {
-      this.protocolUrl = `${location.origin}/teacher/muic-standard/question.html`
+      this.protocolUrl = `${getHttpOrigin()}/teacher/muic-standard/question.html`
     } else if (type === 'music') {
-      this.protocolUrl = `${location.origin}/teacher/muic-standard/index.html`
+      this.protocolUrl = `${getHttpOrigin()}/teacher/muic-standard/index.html`
       this.title = '曲谱排版规范'
     } else {
-      this.protocolUrl = `${location.origin}/teacher/muic-standard/index.html`
+      this.protocolUrl = `${getHttpOrigin()}/teacher/muic-standard/index.html`
     }
   },
   render() {

+ 4 - 3
src/teacher/music/upload/message-tip/index.tsx

@@ -2,6 +2,7 @@ import { Button, Popup } from 'vant'
 import { PropType, defineComponent, onMounted, ref, watch } from 'vue'
 import styles from './index.module.less'
 import { postMessage } from '@/helpers/native-message'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'message-tip',
@@ -56,12 +57,12 @@ export default defineComponent({
 
     // 详情
     const onDetail = (type: string) => {
-      let url = `${location.origin}/teacher/#/registerProtocol`
+      let url = `${getHttpOrigin()}/teacher/#/registerProtocol`
 
       if (type === 'question') {
-        url = `${location.origin}/teacher/#/upload-protocol?type=question`
+        url = `${getHttpOrigin()}/teacher/#/upload-protocol?type=question`
       } else if (type === 'music') {
-        url = `${location.origin}/teacher/#/upload-protocol?type=music`
+        url = `${getHttpOrigin()}/teacher/#/upload-protocol?type=music`
       }
 
       postMessage({

+ 2 - 1
src/teacher/piano-room/model/share/index.tsx

@@ -13,6 +13,7 @@ import iconTeacher from '@/common/images/icon_teacher.png'
 import logo from '../../images/logo.png'
 import { state } from '@/state'
 import request from '@/helpers/request'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'share',
@@ -31,7 +32,7 @@ export default defineComponent({
   async mounted() {
     try {
       this.qrCode =
-        location.origin + '/student/#/inviteTeacher?id=' + this.teacherId
+        getHttpOrigin() + '/student/#/inviteTeacher?id=' + this.teacherId
       const shortRes = await request.post('/api-teacher/sysConfig/shortURL', {
         requestType: 'form',
         data: {

+ 3 - 3
src/teacher/share-page/share-album/index.tsx

@@ -16,7 +16,7 @@ import Song from '@/views/music/component/song'
 import ColResult from '@/components/col-result'
 import MusicGrid from '@/views/music/component/music-grid'
 import ColSticky from '@/components/col-sticky'
-import { browser, moneyFormat } from '@/helpers/utils'
+import { browser, getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import { initJumpNativePage, shareCall } from '../share'
 import wxImage from '../images/wx_bg.png'
 import qs from 'query-string'
@@ -46,7 +46,7 @@ export default defineComponent({
     const color = ref<string>('#fff')
     const heightInfo = ref<any>('auto')
 
-    const tmpUrl = `${location.origin}/${
+    const tmpUrl = `${getHttpOrigin()}/${
       route.query.p == 'tenant' ? 'tenant.html' : 'student/'
     }#/music-album-detail/${route.query.id}?${qs.stringify(route.query)}`
 
@@ -105,7 +105,7 @@ export default defineComponent({
       shareCall(jumpUrl.value)
       // 不管有没有拉起app则都跳转到下载app
       setTimeout(() => {
-        window.location.href = location.origin + '/student/#/download'
+        window.location.href = getHttpOrigin() + '/student/#/download'
       }, 3000)
     }
 

+ 5 - 6
src/teacher/share-page/share-group/index.tsx

@@ -4,7 +4,7 @@ import UserDetail from '@/business-components/user-detail'
 import ColSticky from '@/components/col-sticky'
 import { postMessage, promisefiyPostMessage } from '@/helpers/native-message'
 import request from '@/helpers/request'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { state } from '@/state'
 import dayjs from 'dayjs'
 import { Button, Dialog, Toast } from 'vant'
@@ -97,13 +97,13 @@ export default defineComponent({
           query.userType && query.userType == 'STUDENT' ? '' : query.recomUserId
         if (browser().ios) {
           window.location.replace(
-            `${location.origin}/student/#/groupDetail??${qs.stringify(query)}`
+            `${getHttpOrigin()}/student/#/groupDetail??${qs.stringify(query)}`
           )
         } else {
           postMessage({
             api: 'openWebView',
             content: {
-              url: `${location.origin}/student/#/groupDetail??${qs.stringify(
+              url: `${getHttpOrigin()}/student/#/groupDetail??${qs.stringify(
                 query
               )}`,
               orientation: 1,
@@ -150,8 +150,7 @@ export default defineComponent({
       }
     },
     reCall() {
-      const { origin } = location
-      let str = origin + '/student/#/groupDetail'
+      let str = getHttpOrigin() + '/student/#/groupDetail'
       const params = this.$route.query
       str += `?recomUserId=${
         params.userType && params.userType == 'STUDENT' ? '' : this.recomUserId
@@ -165,7 +164,7 @@ export default defineComponent({
       }
       this.reCall()
       setTimeout(() => {
-        window.location.href = location.origin + '/student/#/download'
+        window.location.href = getHttpOrigin() + '/student/#/download'
       }, 3000)
     }
   },

+ 5 - 6
src/teacher/share-page/share-live/index.tsx

@@ -4,7 +4,7 @@ import UserDetail from '@/business-components/user-detail'
 import ColSticky from '@/components/col-sticky'
 import { postMessage, promisefiyPostMessage } from '@/helpers/native-message'
 import request from '@/helpers/request'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { state } from '@/state'
 import dayjs from 'dayjs'
 import { Button, Dialog, Toast } from 'vant'
@@ -91,13 +91,13 @@ export default defineComponent({
           query.userType && query.userType == 'STUDENT' ? '' : query.recomUserId
         if (browser().ios) {
           window.location.replace(
-            `${location.origin}/student/#/liveDetail??${qs.stringify(query)}`
+            `${getHttpOrigin()}/student/#/liveDetail??${qs.stringify(query)}`
           )
         } else {
           postMessage({
             api: 'openWebView',
             content: {
-              url: `${location.origin}/student/#/liveDetail??${qs.stringify(
+              url: `${getHttpOrigin()}/student/#/liveDetail??${qs.stringify(
                 query
               )}`,
               orientation: 1,
@@ -144,8 +144,7 @@ export default defineComponent({
       }
     },
     reCall() {
-      const { origin } = location
-      let str = origin + '/student/#/liveDetail'
+      let str = getHttpOrigin() + '/student/#/liveDetail'
       const params = this.$route.query
       str += `?recomUserId=${
         params.userType && params.userType == 'STUDENT' ? '' : this.recomUserId
@@ -159,7 +158,7 @@ export default defineComponent({
       }
       this.reCall()
       setTimeout(() => {
-        window.location.href = location.origin + '/student/#/download'
+        window.location.href = getHttpOrigin() + '/student/#/download'
       }, 3000)
     }
   },

+ 8 - 8
src/teacher/share-page/share-mall/index.tsx

@@ -1,5 +1,5 @@
 import request from '@/helpers/request'
-import { browser, moneyFormat } from '@/helpers/utils'
+import { browser, getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import {
   Swipe,
   SwipeItem,
@@ -66,13 +66,13 @@ export default defineComponent({
         // 自动跳转到学生端商品详情
         if (browser().ios) {
           window.location.replace(
-            `${location.origin}/student/#/goodsDetail?${qs.stringify(params)}`
+            `${getHttpOrigin()}/student/#/goodsDetail?${qs.stringify(params)}`
           )
         } else {
           postMessage({
             api: 'openWebView',
             content: {
-              url: `${location.origin}/student/#/goodsDetail?${qs.stringify(
+              url: `${getHttpOrigin()}/student/#/goodsDetail?${qs.stringify(
                 params
               )}`,
               orientation: 1,
@@ -91,10 +91,10 @@ export default defineComponent({
         })
       }
     } else {
-      const { origin } = location
+      
       const query = this.$route.query
       const str =
-        origin +
+      getHttpOrigin() +
         `/student/#/goodsDetail?id=${query.bizId}&promoterId=${
           query.userType && query.userType == 'STUDENT' ? '' : query.userId
         }&p=${query.p}`
@@ -194,14 +194,14 @@ export default defineComponent({
         this.wxStatus = true
         return
       }
-      const { origin } = location
+      
       const query = this.$route.query
       const str =
-        origin +
+      getHttpOrigin() +
         `/student/#/goodsDetail?id=${query.bizId}&promoterId=${query.userId}&p=${query.p}`
       shareCall(str, {})
       setTimeout(() => {
-        location.href = origin + '/student/#/download'
+        location.href = getHttpOrigin() + '/student/#/download'
       }, 3000)
     }
   },

+ 2 - 2
src/teacher/share-page/share-music-sheet/index.tsx

@@ -1,7 +1,7 @@
 import { Button, Cell } from 'vant'
 import { defineComponent } from 'vue'
 import qs from 'query-string'
-import { browser, getRandomKey } from '@/helpers/utils'
+import { browser, getHttpOrigin, getRandomKey } from '@/helpers/utils'
 import styles from './index.module.less'
 import { postMessage } from '@/helpers/native-message'
 
@@ -57,7 +57,7 @@ export default defineComponent({
       const browserInfo = browser()
       const musicScorePath = "/klx-music-score/";
       const url = qs.stringifyUrl({
-        url: location.origin + musicScorePath,
+        url: getHttpOrigin() + musicScorePath,
         query: {
           id: this.id,
           recomUserId:

+ 3 - 3
src/teacher/share-page/share-music/index.tsx

@@ -34,7 +34,7 @@ import { getRandomKey } from '@/views/music/music'
 import { getOssUploadUrl, state } from '@/state'
 import { useEventTracking } from '@/helpers/hooks'
 import ColSticky from '@/components/col-sticky'
-import { browser, moneyFormat } from '@/helpers/utils'
+import { browser, getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import { orderStatus } from '@/views/order-detail/orderStatus'
 import iconAlbum from '@/views/music/component/images/icon_album.png'
 import iconDownload from '@/views/music/music-detail/images/icon_download.png'
@@ -94,7 +94,7 @@ export default defineComponent({
       radio: 'staff' // staff first fixed
     })
 
-    const tmpUrl = `${location.origin}/${
+    const tmpUrl = `${getHttpOrigin()}/${
       route.query.p == 'tenant' ? 'tenant' : 'student'
     }/#/music-detail?${qs.stringify(route.query)}`
     const jumpUrl = ref<string>(tmpUrl)
@@ -247,7 +247,7 @@ export default defineComponent({
       shareCall(jumpUrl.value)
       // 不管有没有拉起app则都跳转到下载app
       setTimeout(() => {
-        window.location.href = location.origin + '/student/#/download'
+        window.location.href = getHttpOrigin() + '/student/#/download'
       }, 3000)
     }
 

+ 5 - 6
src/teacher/share-page/share-video/index.tsx

@@ -7,7 +7,7 @@ import styles from './index.module.less'
 import request from '@/helpers/request'
 import ColSticky from '@/components/col-sticky'
 import { shareCall } from '../share'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { postMessage } from '@/helpers/native-message'
 import { state } from '@/state'
 import qs from 'query-string'
@@ -48,13 +48,13 @@ export default defineComponent({
         // 为了处理andoird webview的跳转问题
         if (browser().ios) {
           window.location.replace(
-            `${location.origin}/student/#/videoDetail?${qs.stringify(query)}`
+            `${getHttpOrigin()}/student/#/videoDetail?${qs.stringify(query)}`
           )
         } else {
           postMessage({
             api: 'openWebView',
             content: {
-              url: `${location.origin}/student/#/videoDetail?${qs.stringify(
+              url: `${getHttpOrigin()}/student/#/videoDetail?${qs.stringify(
                 query
               )}`,
               orientation: 1,
@@ -121,8 +121,7 @@ export default defineComponent({
       }
     },
     reCall() {
-      const { origin } = location
-      let str = origin + '/student/#/videoDetail'
+      let str = getHttpOrigin() + '/student/#/videoDetail'
       const params = this.$route.query
       str += `?recomUserId=${
         params.userType && params.userType == 'STUDENT' ? '' : this.recomUserId
@@ -137,7 +136,7 @@ export default defineComponent({
       }
       this.reCall()
       setTimeout(() => {
-        window.location.href = location.origin + '/student/#/download'
+        window.location.href = getHttpOrigin() + '/student/#/download'
       }, 3000)
     }
   },

+ 3 - 3
src/teacher/share-page/share-vip/index.tsx

@@ -7,7 +7,7 @@ import { state } from '@/state'
 import shareBanner from '../images/share-banner.png'
 import wxImage from '../images/wx_bg.png'
 import { shareCall, initJumpNativePage } from '../share'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { postMessage } from '@/helpers/native-message'
 import qs from 'query-string'
 import iconTitle from './images/icon-title-3.png'
@@ -26,7 +26,7 @@ export default defineComponent({
     const query = this.$route.query
     query.recomUserId =
       query.userType && query.userType == 'STUDENT' ? '' : query.recomUserId
-    const tmpUrl = `${location.origin}/student/#/memberCenter?${qs.stringify(
+    const tmpUrl = `${getHttpOrigin()}/student/#/memberCenter?${qs.stringify(
       query
     )}`
     return {
@@ -88,7 +88,7 @@ export default defineComponent({
       shareCall(this.jumpUrl)
       // 不管有没有拉起app则都跳转到下载app
       setTimeout(() => {
-        window.location.href = location.origin + '/student/#/download'
+        window.location.href = getHttpOrigin() + '/student/#/download'
       }, 3000)
     }
   },

+ 2 - 1
src/teacher/share-page/track-review-activity/index.tsx

@@ -8,6 +8,7 @@ import ShareModel from './share-model'
 import { postMessage } from '@/helpers/native-message'
 import { state } from '@/state'
 import ColHeader from '@/components/col-header'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `./images/${fileName}`
@@ -87,7 +88,7 @@ export default defineComponent({
         document.title = this.activeInfo.activityName
 
         // 设置连接
-        this.shareUrl = `${location.origin}/student/#/track-review-activity?recomUserId=${state.user.data?.userId}&id=${this.activeInfo.id}`
+        this.shareUrl = `${getHttpOrigin()}/student/#/track-review-activity?recomUserId=${state.user.data?.userId}&id=${this.activeInfo.id}`
       } catch {
         //
       }

+ 2 - 2
src/teacher/statistics/exercise-detail/exercise-detail.tsx

@@ -14,7 +14,7 @@ import {
 } from 'vant'
 import { levelMember } from '@/constant'
 import request from '@/helpers/request'
-import { formatterDate } from '@/helpers/utils'
+import { formatterDate, getHttpOrigin } from '@/helpers/utils'
 import dayjs from 'dayjs'
 import ColResult from '@/components/col-result'
 import { postMessage } from '@/helpers/native-message'
@@ -213,7 +213,7 @@ export default defineComponent({
                       api: 'openAccompanyWebView',
                       content: {
                         url:
-                          location.origin +
+                          getHttpOrigin() +
                           musicScorePath +
                           '#/' +
                           'evaluat-report?id=' +

+ 8 - 0
src/teacher/statistics/home-statistics-detail/list/index.module.less

@@ -106,4 +106,12 @@
     //   right: -26px;
     // }
   }
+
+  .cellGroup {
+    :global {
+      .van-cell:first-child {
+        padding-top: 6px !important;
+      }
+    }
+  }
 }

+ 1 - 1
src/teacher/statistics/home-statistics-detail/list/index.tsx

@@ -182,7 +182,7 @@ export default defineComponent({
               immediateCheck={false}
               onLoad={getList}
             >
-              <CellGroup border={false}>
+              <CellGroup class={styles.cellGroup} border={false}>
                 {['VIP_COURSE', 'PRACTICE'].includes(props.type) && (
                   <TeacherItem list={tableList.value} />
                 )}

+ 2 - 2
src/teacher/statistics/home-statistics/index.tsx

@@ -33,7 +33,7 @@ import { CanvasRenderer } from 'echarts/renderers'
 import request from '@/helpers/request'
 import dayjs from 'dayjs'
 import { listenerMessage, postMessage } from '@/helpers/native-message'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { useRouter } from 'vue-router'
 
 // 注册必须的组件
@@ -368,7 +368,7 @@ export default defineComponent({
         postMessage({
           api: 'openWebView',
           content: {
-            url: `${location.origin}/teacher/#/home-statistics-detail?currentType=${currentType.value}`,
+            url: `${getHttpOrigin()}/teacher/#/home-statistics-detail?currentType=${currentType.value}`,
             orientation: 1,
             isHideTitle: false
           }

+ 9 - 2
src/teacher/statistics/practice-statistics-detail/index.module.less

@@ -196,8 +196,15 @@
       right: -12px;
     }
   }
-  tbody td {
-    border-bottom: 1px solid #f2f2f2;
+  tbody {
+    td {
+      border-bottom: 1px solid #f2f2f2;
+    }
+    tr:last-child {
+      td {
+        border-bottom: none;
+      }
+    }
   }
   thead th {
     border-left: 1px solid #fff;

+ 2 - 2
src/teacher/teacher-cert/index.tsx

@@ -12,7 +12,7 @@ import request from '@/helpers/request'
 import ColResult from '@/components/col-result'
 import { state } from '@/state'
 import ColHeader from '@/components/col-header'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { postMessage } from '@/helpers/native-message'
 
 export default defineComponent({
@@ -233,7 +233,7 @@ export default defineComponent({
                   if (browser().isApp) {
                     postMessage({ api: 'back', content: {} })
                   } else {
-                    window.open(location.origin + '/student/#/download?type=teacher')
+                    window.open(getHttpOrigin() + '/student/#/download?type=teacher')
                   }
                 }}
               />

+ 2 - 1
src/teacher/video-class/video-detail.tsx

@@ -14,6 +14,7 @@ import { state } from '@/state'
 import { postMessage } from '@/helpers/native-message'
 import ColHeader from '@/components/col-header'
 import TheSticky from '@/components/the-sticky'
+import { getHttpOrigin } from '@/helpers/utils'
 export default defineComponent({
   name: 'VideoDetail',
   data() {
@@ -77,7 +78,7 @@ export default defineComponent({
       this.detailList = result.detailList || []
 
       // shareVideo?recomUserId=56&groupId=124
-      this.shareUrl = `${location.origin}/teacher/#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.videoLessonGroupId}&p=tenant`
+      this.shareUrl = `${getHttpOrigin()}/teacher/#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.videoLessonGroupId}&p=tenant`
       console.log(this.shareUrl, 'shareVideo')
       !this.myself && this.getList()
     } catch (e) {

+ 2 - 1
src/tenant/exercise-record/modals/detail-item.tsx

@@ -8,6 +8,7 @@ import Image3 from '../images/Image3.png'
 import Image4 from '../images/Image4.png'
 import Image5 from '../images/Image5.png'
 import iconPlay from '../images/icon-play.png'
+import { getHttpOrigin } from '@/helpers/utils'
 
 const scoreInfos: any = {
   1: {
@@ -64,7 +65,7 @@ export default defineComponent({
         api: 'openAccompanyWebView',
         content: {
           url:
-            location.origin + musicScorePath + '#/' +
+            getHttpOrigin() + musicScorePath + '#/' +
             'evaluat-report?id=' +
             props.item.id +
             '&behaviorId=' +

+ 3 - 3
src/tenant/music/album-detail/index.tsx

@@ -24,7 +24,7 @@ import ColResult from '@/components/col-result'
 import MusicGrid from '../component/music-grid'
 import { useEventTracking } from '@/helpers/hooks'
 import ColSticky from '@/components/col-sticky'
-import { moneyFormat } from '@/helpers/utils'
+import { getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import { orderStatus } from '@/views/order-detail/orderStatus'
 import iconShare from '../../images/icon-share.png'
 import ColShare from '@/components/col-share'
@@ -252,7 +252,7 @@ export default defineComponent({
           shareDiscount.value = res.data.discount || 0
         }
       }
-      shareUrl.value = `${location.origin}/teacher/#/shareAblum?id=${id}&recomUserId=${userId}&activityId=${activityId}&userType=${state.platformType}&p=tenant`
+      shareUrl.value = `${getHttpOrigin()}/teacher/#/shareAblum?id=${id}&recomUserId=${userId}&activityId=${activityId}&userType=${state.platformType}&p=tenant`
       // console.log(shareUrl.value, 'shareUrl')
       shareStatus.value = true
     }
@@ -373,7 +373,7 @@ export default defineComponent({
                 onDetail={(item: any) => {
                   if (onItemClick === noop || !onItemClick) {
                     const url =
-                      location.origin +
+                      getHttpOrigin() +
                       location.pathname +
                       '#/music-detail?id=' +
                       item.id +

+ 3 - 3
src/tenant/music/courseList/index.tsx

@@ -24,7 +24,7 @@ import iconCourse from './image/icon-course.png'
 import iconCachePoint from './image/icon-cache-point.png'
 import play from './image/paly.png'
 import iconSearch from './image/icon-search.png'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import ColResult from '@/components/col-result'
 import { useEventListener } from '@vant/use'
 import TheSticky from '@/components/the-sticky'
@@ -192,7 +192,7 @@ export default defineComponent({
         postMessage({
           api: 'openWebView',
           content: {
-            url: `${location.origin}${location.pathname}#/coursewarePlay?id=${item.coursewareDetailId}&source=my-course`,
+            url: `${getHttpOrigin()}${location.pathname}#/coursewarePlay?id=${item.coursewareDetailId}&source=my-course`,
             orientation: 0,
             isHideTitle: true,
             statusBarTextColor: false,
@@ -373,7 +373,7 @@ export default defineComponent({
         message: '请在酷乐秀APP中使用',
         confirmButtonColor: '#2dc7aa'
       }).then(() => {
-        window.location.href = location.origin + '/student/#/download'
+        window.location.href = getHttpOrigin() + '/student/#/download'
       })
     }
     return () => (

+ 3 - 3
src/tenant/music/courseListSearch/index.tsx

@@ -20,7 +20,7 @@ import ColSearch from '@/components/col-search';
 import { Vue3Lottie } from 'vue3-lottie';
 import AstronautJSON from '../music-detail/animate/refresh_anim.json'
 import ColResult from '@/components/col-result';
-import { browser } from '@/helpers/utils';
+import { browser, getHttpOrigin } from '@/helpers/utils';
 import { orderStatus } from '@/views/order-detail/orderStatus';
 import { postMessage } from '@/helpers/native-message'
 
@@ -197,7 +197,7 @@ export default defineComponent({
         postMessage({
           api: 'openWebView',
           content: {
-            url: `${location.origin}${location.pathname}#/coursewarePlay?lessonId=${route.query.id}&source=search&kId=${item.id}&search=${encodeURIComponent(data.search || '')}`,
+            url: `${getHttpOrigin()}${location.pathname}#/coursewarePlay?lessonId=${route.query.id}&source=search&kId=${item.id}&search=${encodeURIComponent(data.search || '')}`,
             orientation: 0,
             isHideTitle: true,
             statusBarTextColor: false,
@@ -304,7 +304,7 @@ export default defineComponent({
         message: '请在酷乐秀APP中使用',
         confirmButtonColor: '#2dc7aa'
       }).then(() => {
-        window.location.href = location.origin + '/student/#/download'
+        window.location.href = getHttpOrigin() + '/student/#/download'
       })
     }
 

+ 2 - 2
src/tenant/music/coursewarePlay/component/musicScore.tsx

@@ -6,7 +6,7 @@ import { listenerMessage, postMessage } from '@/helpers/native-message'
 import { Skeleton } from 'vant'
 import { usePageVisibility } from '@vant/use'
 import { useRoute } from 'vue-router'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'musicScore',
@@ -40,7 +40,7 @@ export default defineComponent({
 
     const musicScorePath = "/klx-music-score/";
       const src = qs.stringifyUrl({
-        url: location.origin + musicScorePath,
+        url: getHttpOrigin() + musicScorePath,
         query: {
           t: +new Date(),
           id: props.music.content,

+ 2 - 2
src/tenant/music/lessonCourseware/index.tsx

@@ -17,7 +17,7 @@ import bgImg from '../../images/bg.png'
 import Search from '@/components/col-search'
 import CourseItem from './component/CourseItem'
 import ColResult from '@/components/col-result'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import { postMessage } from '@/helpers/native-message'
 
 export default defineComponent({
@@ -197,7 +197,7 @@ export default defineComponent({
                   })}
                   onItemClick={row => {
                     if (browser().isApp) {
-                      const url = `${location.origin}/tenant/#/courseList?id=${row.id}&albumId=${params.albumId}`
+                      const url = `${getHttpOrigin()}/tenant/#/courseList?id=${row.id}&albumId=${params.albumId}`
                       postMessage({
                         api: 'openWebView',
                         content: {

+ 2 - 2
src/tenant/music/list/index.tsx

@@ -28,7 +28,7 @@ import { useAsyncState } from '@vueuse/core'
 import bgImg from '../../images/bg-image.png'
 import iconSearch from './icons/icon_search.png'
 import iconFree from './icons/icon-free.png'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import TheSticky from '@/components/the-sticky'
 import { tmpdir } from 'os'
 
@@ -440,7 +440,7 @@ export default defineComponent({
                   onDetail={(item: any) => {
                     if (onItemClick === noop) {
                       const url =
-                        location.origin +
+                        getHttpOrigin() +
                         location.pathname +
                         '#/music-detail?id=' +
                         item.id

+ 2 - 1
src/tenant/music/list/item.tsx

@@ -10,6 +10,7 @@ import styles from './item.module.less'
 import request from '@/helpers/request'
 import { state } from '@/state'
 import ColShare from '@/components/col-share'
+import { getHttpOrigin } from '@/helpers/utils'
 
 const chargeTypes = {
   CHARGE: '点播',
@@ -65,7 +66,7 @@ export default defineComponent({
           }
         })
         let url =
-          location.origin +
+          getHttpOrigin() +
           `/accompany/colexiu-share.html?id=${data.id}&recomUserId=${state.user.data?.userId}`
         // 判断是否有活动
         if (res.data.discount === 1) {

+ 2 - 1
src/tenant/music/list/list.tsx

@@ -7,6 +7,7 @@ import { defineComponent, reactive, ref } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import Song from '../component/song'
 import styles from './index.module.less'
+import { getHttpOrigin } from '@/helpers/utils'
 
 const noop = () => {}
 
@@ -108,7 +109,7 @@ export default defineComponent({
               onDetail={(item: any) => {
                 if (onItemClick === noop) {
                   const url =
-                    location.origin +
+                    getHttpOrigin() +
                     location.pathname +
                     '#/music-detail?id=' +
                     item.id

+ 21 - 21
src/tenant/music/music-detail/index.tsx

@@ -37,7 +37,7 @@ import { getRandomKey, musicBuy } from '../music'
 import { getOssUploadUrl, state } from '@/state'
 import { useEventTracking } from '@/helpers/hooks'
 import ColSticky from '@/components/col-sticky'
-import { browser, moneyFormat } from '@/helpers/utils'
+import { browser, getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import { orderStatus } from '@/views/order-detail/orderStatus'
 import iconShare from '@/views/music/album/icon_share.svg'
 import iconAlbum from '@/views/music/component/images/icon_album.png'
@@ -250,24 +250,24 @@ export default defineComponent({
       }
     }
 
-    const setAccompanyUrl = () => {
-      let url = location.origin
-      if (
-        location.host.includes('dev.colexiu') ||
-        location.host.includes('192.168') ||
-        location.host.includes('localhost')
-      ) {
-        url = 'https://dev.colexiu.com'
-      }
-      const music = musicDetail.value
-      let subjectId = ''
-      if (music.background && music.background.length > 0) {
-        subjectId = music.background[0].id
-      }
-      accompanyUrl.value =
-        url +
-        `/accompany/colxiu-website.html?id=${music.id}&part-index=${subjectId}`
-    }
+    // const setAccompanyUrl = () => {
+    //   let url = location.origin
+    //   if (
+    //     location.host.includes('dev.colexiu') ||
+    //     location.host.includes('192.168') ||
+    //     location.host.includes('localhost')
+    //   ) {
+    //     url = 'https://dev.colexiu.com'
+    //   }
+    //   const music = musicDetail.value
+    //   let subjectId = ''
+    //   if (music.background && music.background.length > 0) {
+    //     subjectId = music.background[0].id
+    //   }
+    //   accompanyUrl.value =
+    //     url +
+    //     `/accompany/colxiu-website.html?id=${music.id}&part-index=${subjectId}`
+    // }
     const player = ref<any>(null)
     const audio = ref<any>(null)
     const freeRate = ref<any>(0)
@@ -496,7 +496,7 @@ export default defineComponent({
           }
         })
         let url =
-          location.origin +
+          getHttpOrigin() +
           `/teacher/#/shareMusic?id=${musicDetail.value?.id}&recomUserId=${state.user.data?.userId}&userType=${state.platformType}&p=tenant`
         // 判断是否有活动
         if (res.data.discount === 1) {
@@ -521,7 +521,7 @@ export default defineComponent({
     })
     /** 渲染五线谱 */
     const renderStaff = () => {
-      staffData.iframeSrc = `${location.origin}${location.pathname}osmd/index.html`
+      staffData.iframeSrc = `${getHttpOrigin()}${location.pathname}osmd/index.html`
       staffData.musicXml = musicDetail.value?.xmlFileUrl || ''
       staffData.partList = musicDetail.value?.background || []
       staffData.instrumentName = getInstrumentName(

+ 2 - 2
src/tenant/music/music-detail/new-index.tsx

@@ -646,7 +646,7 @@ export default defineComponent({
       try {
         nextTick(() => {
           if (staffData.musicPdfUrl) {
-            const url = `${location.origin}${
+            const url = `${getHttpOrigin()}${
               location.pathname
             }pdf/web/viewer-pdf.html?file=${encodeURIComponent(
               staffData.musicPdfUrl
@@ -683,7 +683,7 @@ export default defineComponent({
         message: '请在酷乐秀APP中使用',
         confirmButtonColor: '#2dc7aa'
       }).then(() => {
-        window.location.href = location.origin + '/student/#/download'
+        window.location.href = getHttpOrigin() + '/student/#/download'
       })
     }
 

+ 2 - 2
src/tenant/music/music.ts

@@ -2,7 +2,7 @@ import { orderStatus } from '@/views/order-detail/orderStatus'
 import { postMessage } from '@/helpers/native-message'
 import { Dialog } from 'vant'
 import qs from 'query-string'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 
 const browserInfo = browser()
 
@@ -16,7 +16,7 @@ export const musicBuy = (item: any, callBack?: any, moreQuery = {}) => {
   // 酷乐秀云教练的部署目录
   const musicScorePath = "/klx-music-score/";
   const url = qs.stringifyUrl({
-    url: location.origin + musicScorePath,
+    url: getHttpOrigin() + musicScorePath,
     query: {
       id: item.id,
       behaviorId,

+ 2 - 1
src/tenant/music/personal/collection.tsx

@@ -6,6 +6,7 @@ import ColResult from '@/components/col-result'
 import { openDefaultWebView, state } from '@/state'
 import styles from './index.module.less'
 import Song from '../component/song'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'MusicList',
@@ -74,7 +75,7 @@ export default defineComponent({
               list={rows.value}
               onDetail={(item: any) => {
                 const url =
-                  location.origin +
+                  getHttpOrigin() +
                   location.pathname +
                   '#/music-detail?id=' +
                   item.id

+ 2 - 1
src/tenant/music/personal/personal.tsx

@@ -7,6 +7,7 @@ import { openDefaultWebView, state } from '@/state'
 import styles from './index.module.less'
 import Song from '../component/song'
 import { number } from 'echarts/core'
+import { getHttpOrigin } from '@/helpers/utils'
 
 
 export default defineComponent({
@@ -98,7 +99,7 @@ export default defineComponent({
                 list={rows.value}
                 onDetail={(item: any) => {
                   const url =
-                    location.origin +
+                    getHttpOrigin() +
                     location.pathname +
                     '#/music-detail?id=' +
                     item.id

+ 2 - 1
src/tenant/music/personal/practice.tsx

@@ -8,6 +8,7 @@ import styles from './index.module.less'
 import Song from '../component/song'
 import songEmpty from '@/common/images/song-empty.png'
 import { useRouter } from 'vue-router'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'Practice',
@@ -77,7 +78,7 @@ export default defineComponent({
                       return
                     }
                     const url =
-                      location.origin +
+                      getHttpOrigin() +
                       location.pathname +
                       '#/music-detail?id=' +
                       item.id

+ 3 - 3
src/tenant/music/search/header.tsx

@@ -32,7 +32,7 @@ import bgImg from '../../images/bg-image-search.png'
 import iconSearch from './icon-search.png'
 import iconDelete from './icon-delete.png'
 import request from '@/helpers/request'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import ColHeader from '@/components/col-header'
 import ColResult from '@/components/col-result'
 import { postMessage } from '@/helpers/native-message'
@@ -461,7 +461,7 @@ export default defineComponent({
                   onClick={() => {
                     if (item.type === 'ALBUM') {
                       openWebViewOrWeb(
-                        `${location.origin}/tenant/#/music-album-detail/${item.id}`,
+                        `${getHttpOrigin()}/tenant/#/music-album-detail/${item.id}`,
                         () => {
                           router.push({
                             path: '/music-album-detail/' + item.id
@@ -470,7 +470,7 @@ export default defineComponent({
                       )
                     } else {
                       openWebViewOrWeb(
-                        `${location.origin}/tenant/#/music-detail?id=${
+                        `${getHttpOrigin()}/tenant/#/music-detail?id=${
                           item.id
                         }&tenantAlbumId=${
                           route.path === '/music-songbook/searchAlbum'

+ 2 - 1
src/tenant/music/search/music-swiper.tsx

@@ -4,6 +4,7 @@ import { defineComponent, onMounted, reactive, ref } from 'vue'
 import { useRouter } from 'vue-router'
 import request from '@/helpers/request'
 import { openDefaultWebView } from '@/state'
+import { getHttpOrigin } from '@/helpers/utils'
 // import event from '../../event'
 // import Song from '../component/song'
 
@@ -64,7 +65,7 @@ export default defineComponent({
 
     const onDetail = (item: any) => {
       const url =
-        location.origin + location.pathname + '#/music-detail?id=' + item.id
+        getHttpOrigin() + location.pathname + '#/music-detail?id=' + item.id
       openDefaultWebView(url, () => {
         router.push({
           path: '/music-detail',

+ 4 - 3
src/tenant/music/search/result-all-search.tsx

@@ -7,6 +7,7 @@ import MusicList from '../list'
 import { Icon } from 'vant'
 import { mitter, openWebViewOrWeb } from './header'
 import ColResult from '@/components/col-result'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'MusicSearch',
@@ -72,7 +73,7 @@ export default defineComponent({
                 class={styles.more}
                 onClick={() => {
                   openWebViewOrWeb(
-                    `${location.origin}/tenant/#/music-album`,
+                    `${getHttpOrigin()}/tenant/#/music-album`,
                     () => {
                       router.push({
                         path: '/music-album'
@@ -91,7 +92,7 @@ export default defineComponent({
                 list={state.albumList}
                 onGoto={(n: any) => {
                   openWebViewOrWeb(
-                    `${location.origin}/tenant/#/music-album-detail/${n.id}`,
+                    `${getHttpOrigin()}/tenant/#/music-album-detail/${n.id}`,
                     () => {
                       router.push({
                         name: 'music-album-detail',
@@ -129,7 +130,7 @@ export default defineComponent({
             ref={musicList}
             onItemClick={(item: any) => {
               openWebViewOrWeb(
-                `${location.origin}/tenant/#/music-detail?id=${item.id}`,
+                `${getHttpOrigin()}/tenant/#/music-detail?id=${item.id}`,
                 () => {
                   router.push({
                     path: '/music-detail',

+ 2 - 1
src/tenant/music/search/searchAlbum.tsx

@@ -10,6 +10,7 @@ import Song from '../component/song'
 import ColResult from '@/components/col-result'
 import { openDefaultWebView, state } from '@/state'
 import request from '@/helpers/request'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'MusicSearch',
@@ -111,7 +112,7 @@ export default defineComponent({
                 list={data.value.rows}
                 onDetail={(item: any) => {
                   const url =
-                    location.origin +
+                    getHttpOrigin() +
                     location.pathname +
                     '#/music-detail?id=' +
                     item.id +

+ 2 - 1
src/tenant/music/songbook/list.tsx

@@ -10,6 +10,7 @@ import ColResult from '@/components/col-result'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
 import Song from '../component/song'
 import { openDefaultWebView, state } from '@/state'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'Songbook',
@@ -102,7 +103,7 @@ export default defineComponent({
                 list={data.value.rows}
                 onDetail={(item: any) => {
                   const url =
-                    location.origin +
+                    getHttpOrigin() +
                     location.pathname +
                     '#/music-detail?id=' +
                     item.id

+ 2 - 2
src/tenant/music/train-list/index.tsx

@@ -31,7 +31,7 @@ import ColHeader from '@/components/col-header'
 import bgImg from '../../images/bg.png'
 import TheSticky from '@/components/the-sticky'
 import dayjs from 'dayjs'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 
 const noop = () => {
   //
@@ -486,7 +486,7 @@ export default defineComponent({
                   list={data.value.rows}
                   onDetail={(item: any) => {
                     if (browser().isApp) {
-                      const url = `${location.origin}/tenant/#/music-detail?id=${item.id}&subjectType=${subjectType}&tenantAlbumId=${item.tenantAlbumId}`
+                      const url = `${getHttpOrigin()}/tenant/#/music-detail?id=${item.id}&subjectType=${subjectType}&tenantAlbumId=${item.tenantAlbumId}`
                       postMessage({
                         api: 'openWebView',
                         content: {

+ 2 - 1
src/tenant/music/train-list/item.tsx

@@ -10,6 +10,7 @@ import styles from './item.module.less'
 import request from '@/helpers/request'
 import { state } from '@/state'
 import ColShare from '@/components/col-share'
+import { getHttpOrigin } from '@/helpers/utils'
 
 const chargeTypes = {
   CHARGE: '点播',
@@ -65,7 +66,7 @@ export default defineComponent({
           }
         })
         let url =
-          location.origin +
+          getHttpOrigin() +
           `/accompany/colexiu-share.html?id=${data.id}&recomUserId=${state.user.data?.userId}`
         // 判断是否有活动
         if (res.data.discount === 1) {

+ 2 - 1
src/tenant/music/train-list/list.tsx

@@ -7,6 +7,7 @@ import { defineComponent, reactive, ref } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import Song from '../component/song'
 import styles from './index.module.less'
+import { getHttpOrigin } from '@/helpers/utils'
 
 const noop = () => {}
 
@@ -108,7 +109,7 @@ export default defineComponent({
               onDetail={(item: any) => {
                 if (onItemClick === noop) {
                   const url =
-                    location.origin +
+                    getHttpOrigin() +
                     location.pathname +
                     '#/music-detail?id=' +
                     item.id

+ 5 - 5
src/views/adapay/pay-define/index.tsx

@@ -1,5 +1,5 @@
 import request from '@/helpers/request'
-import { browser, getUrlCode, moneyFormat } from '@/helpers/utils'
+import { browser, getHttpOrigin, getUrlCode, moneyFormat } from '@/helpers/utils'
 import { goAliAuth, goWechatAuth } from '@/state'
 import { Button, Cell, CellGroup, Icon, Toast } from 'vant'
 import { defineComponent, onMounted, reactive } from 'vue'
@@ -126,14 +126,14 @@ export default defineComponent({
           function (data: any) {
             if ('9000' == data.resultCode) {
               window.location.replace(
-                location.origin +
+                getHttpOrigin() +
                   +baseState.payBackPath +
                   '#/tradeDetail?orderNo=' +
                   state.orderNo
               )
             } else {
               window.location.replace(
-                location.origin +
+                getHttpOrigin() +
                   +baseState.payBackPath +
                   '#/tradeDetail?orderNo=' +
                   state.orderNo
@@ -168,7 +168,7 @@ export default defineComponent({
             res.err_msg == 'get_brand_wcpay_request:fail'
           ) {
             window.location.replace(
-              location.origin +
+              getHttpOrigin() +
                 baseState.payBackPath +
                 '#/tradeDetail?orderNo=' +
                 state.orderNo
@@ -178,7 +178,7 @@ export default defineComponent({
             //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
             // alert('支付成功')
             window.location.replace(
-              location.origin +
+              getHttpOrigin() +
                 baseState.payBackPath +
                 '#/tradeDetail?orderNo=' +
                 state.orderNo

+ 6 - 6
src/views/adapay/pay-result/index.tsx

@@ -1,5 +1,5 @@
 import request from '@/helpers/request'
-import { browser, getUrlCode, moneyFormat } from '@/helpers/utils'
+import { browser, getHttpOrigin, getUrlCode, moneyFormat } from '@/helpers/utils'
 import { goAliAuth, goWechatAuth } from '@/state'
 import { Cell, CellGroup, Dialog, Icon, Loading, Toast } from 'vant'
 import { defineComponent, onMounted, reactive } from 'vue'
@@ -98,7 +98,7 @@ export default defineComponent({
         console.log(e)
         // 接口报错也跳转到支付回调页
         window.location.replace(
-          location.origin +
+          getHttpOrigin() +
             baseState.payBackPath +
             '#/tradeDetail?orderNo=' +
             state.orderNo
@@ -125,14 +125,14 @@ export default defineComponent({
           function (data: any) {
             if ('9000' == data.resultCode) {
               window.location.replace(
-                location.origin +
+                getHttpOrigin() +
                   baseState.payBackPath +
                   '#/tradeDetail?orderNo=' +
                   state.orderNo
               )
             } else {
               window.location.replace(
-                location.origin +
+                getHttpOrigin() +
                   baseState.payBackPath +
                   '#/tradeDetail?orderNo=' +
                   state.orderNo
@@ -214,7 +214,7 @@ export default defineComponent({
             res.err_msg == 'get_brand_wcpay_request:fail'
           ) {
             window.location.replace(
-              location.origin +
+              getHttpOrigin() +
                 baseState.payBackPath +
                 '#/tradeDetail?orderNo=' +
                 state.orderNo
@@ -224,7 +224,7 @@ export default defineComponent({
             //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
             // alert('支付成功')
             window.location.replace(
-              location.origin +
+              getHttpOrigin() +
                 baseState.payBackPath +
                 '#/tradeDetail?orderNo=' +
                 state.orderNo

+ 2 - 1
src/views/article-center/theory.tsx

@@ -17,6 +17,7 @@ import { state } from '@/state'
 import { useEventTracking } from '@/helpers/hooks'
 import ColHeader from '@/components/col-header'
 import ColSticky from '@/components/col-sticky'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'special',
@@ -117,7 +118,7 @@ export default defineComponent({
         postMessage({
           api: 'openWebView',
           content: {
-            url: `${location.origin}/${client}/#/theoryDetail?id=${item.id}`,
+            url: `${getHttpOrigin()}/${client}/#/theoryDetail?id=${item.id}`,
             orientation: 1,
             isHideTitle: false
           }

+ 4 - 3
src/views/creation/index-share.tsx

@@ -38,6 +38,7 @@ import {
   browser,
   getAuth,
   getGradeCh,
+  getHttpOrigin,
   getSecondRPM,
   removeAuth,
   setAuth
@@ -316,9 +317,9 @@ export default defineComponent({
         setTimeout(() => {
           if(Date.now() - t < 3500){
             if (window.location.pathname.includes('teacher')) {
-              window.location.href = location.origin + '/student' + '/#/transfer'
+              window.location.href = getHttpOrigin() + '/student' + '/#/transfer'
             } else {
-              window.location.href = location.origin + '/student' + '/#/download'
+              window.location.href = getHttpOrigin() + '/student' + '/#/download'
             }
           }
         }, 3000)
@@ -431,7 +432,7 @@ export default defineComponent({
       }else{
         // 如果是老师端
         if (window.location.pathname.includes('teacher')) {
-          window.location.href = location.origin + '/student' + '/#/transfer'
+          window.location.href = getHttpOrigin() + '/student' + '/#/transfer'
         } else {
           router.push({
             path:"/download"

+ 2 - 1
src/views/creation/share-model/index.tsx

@@ -16,6 +16,7 @@ import videoLabel from './images/videoLabel.png';
 import QRCode from 'qrcode'
 import { promisefiyPostMessage } from '@/helpers/native-message'
 import html2canvas from 'html2canvas'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'sahre-model',
@@ -169,7 +170,7 @@ export default defineComponent({
     onMounted(() => {
       const canvas = canvasRef.value
       state.url =
-        location.origin +
+        getHttpOrigin() +
         location.pathname +
         '#/shareCreation?id=' +
         props.musicDetail.id

+ 2 - 2
src/views/member-center/index copy.tsx

@@ -13,7 +13,7 @@ import iconMemberLogo from './images/member_logo.png'
 import { orderStatus } from '@/views/order-detail/orderStatus'
 import dayjs from 'dayjs'
 import { memberType } from '@/constant'
-import { moneyFormat } from '@/helpers/utils'
+import { getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import ColShare from '@/components/col-share'
 
 export const getAssetsHomeFile = (fileName: string) => {
@@ -134,7 +134,7 @@ export default defineComponent({
           }
         })
 
-        this.shareUrl = `${location.origin}/teacher#/shareVip?recomUserId=${this.userInfo.id}&userType=${state.platformType}`
+        this.shareUrl = `${getHttpOrigin()}/teacher#/shareVip?recomUserId=${this.userInfo.id}&userType=${state.platformType}`
         // 判断是否有我分享的编号
         if (res.data && res.data.activityId) {
           this.shareUrl = this.shareUrl + '&activityId=' + res.data.activityId

+ 2 - 2
src/views/member-center/index.tsx

@@ -20,7 +20,7 @@ import iconGift from './new-images/icon-discount-gift.png'
 import request from '@/helpers/request'
 import MemberInteres from './components/member-interes'
 import ColSticky from '@/components/col-sticky'
-import { moneyFormat } from '@/helpers/utils'
+import { getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import { useRoute, useRouter } from 'vue-router'
 import deepClone from '@/helpers/deep-clone'
 import { memberSimpleType, memberType, studyCardType } from '@/constant'
@@ -172,7 +172,7 @@ export default defineComponent({
           }
         })
 
-        state.shareUrl = `${location.origin}/teacher#/shareVip?recomUserId=${userInfo.value.id}&userType=${baseState.platformType}`
+        state.shareUrl = `${getHttpOrigin()}/teacher#/shareVip?recomUserId=${userInfo.value.id}&userType=${baseState.platformType}`
         // 判断是否有我分享的编号
         if (res.data && res.data.activityId) {
           state.shareUrl = state.shareUrl + '&activityId=' + res.data.activityId

+ 3 - 3
src/views/music/album-detail/index.tsx

@@ -28,7 +28,7 @@ import ColResult from '@/components/col-result'
 // import MusicGrid from '../component/music-grid'
 import { useEventTracking } from '@/helpers/hooks'
 // import ColSticky from '@/components/col-sticky'
-import { moneyFormat } from '@/helpers/utils'
+import { getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import { orderStatus } from '@/views/order-detail/orderStatus'
 import iconShare from '../album/icon_share.svg'
 import iconShare2 from '../album/icon_share2.svg'
@@ -291,7 +291,7 @@ export default defineComponent({
           shareDiscount.value = res.data.discount || 0
         }
       }
-      shareUrl.value = `${location.origin}/teacher#/shareAblum?id=${id}&recomUserId=${userId}&activityId=${activityId}&userType=${state.platformType}`
+      shareUrl.value = `${getHttpOrigin()}/teacher/#/shareAblum?id=${id}&recomUserId=${userId}&activityId=${activityId}&userType=${state.platformType}`
       console.log(shareUrl.value, 'shareUrl')
       shareStatus.value = true
     }
@@ -472,7 +472,7 @@ export default defineComponent({
                     onDetail={(item: any) => {
                       if (onItemClick === noop || !onItemClick) {
                         const url =
-                          location.origin +
+                          getHttpOrigin() +
                           location.pathname +
                           '#/music-detail?id=' +
                           item.id +

+ 2 - 2
src/views/music/list/index.tsx

@@ -23,7 +23,7 @@ import ColHeader from '@/components/col-header'
 import { useAsyncState } from '@vueuse/core'
 import bgImg from './icons/bgImg.png'
 import iconSearch from './icons/icon_search.png'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import TheSticky from '@/components/the-sticky'
 // import deepClone from '@/helpers/deep-clone'
 
@@ -482,7 +482,7 @@ export default defineComponent({
                   onDetail={(item: any) => {
                     if (onItemClick === noop) {
                       const url =
-                        location.origin +
+                        getHttpOrigin() +
                         location.pathname +
                         '#/music-detail?id=' +
                         item.id

+ 2 - 1
src/views/music/list/item.tsx

@@ -10,6 +10,7 @@ import styles from './item.module.less'
 import request from '@/helpers/request'
 import { state } from '@/state'
 import ColShare from '@/components/col-share'
+import { getHttpOrigin } from '@/helpers/utils'
 
 const chargeTypes = {
   CHARGE: '点播',
@@ -65,7 +66,7 @@ export default defineComponent({
           }
         })
         let url =
-          location.origin +
+          getHttpOrigin() +
           `/accompany/colexiu-share.html?id=${data.id}&recomUserId=${state.user.data?.userId}`
         // 判断是否有活动
         if (res.data.discount === 1) {

+ 2 - 1
src/views/music/list/list.tsx

@@ -7,6 +7,7 @@ import { defineComponent, reactive, ref } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import Song from '../component/song'
 import styles from './index.module.less'
+import { getHttpOrigin } from '@/helpers/utils'
 
 const noop = () => {}
 
@@ -108,7 +109,7 @@ export default defineComponent({
               onDetail={(item: any) => {
                 if (onItemClick === noop) {
                   const url =
-                    location.origin +
+                    getHttpOrigin() +
                     location.pathname +
                     '#/music-detail?id=' +
                     item.id

+ 9 - 9
src/views/music/music-detail/index---copy.tsx

@@ -37,7 +37,7 @@ import { getRandomKey, musicBuy } from '../music'
 import { getOssUploadUrl, state } from '@/state'
 // import { useEventTracking } from '@/helpers/hooks'
 import ColSticky from '@/components/col-sticky'
-import { browser, moneyFormat } from '@/helpers/utils'
+import { browser, getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import { orderStatus } from '@/views/order-detail/orderStatus'
 import iconShare from '@/views/music/album/icon_share.svg'
 import iconAlbum from './images/icon_album.png'
@@ -512,7 +512,7 @@ export default defineComponent({
           }
         })
         let url =
-          location.origin +
+          getHttpOrigin() +
           `/teacher/#/shareMusic?id=${musicDetail.value?.id}&recomUserId=${state.user.data?.userId}&userType=${state.platformType}`
         // 判断是否有活动
         if (res.data.discount === 1) {
@@ -591,8 +591,8 @@ export default defineComponent({
           staffData.xmlPartList = partList
         }
 
-        // staffData.iframeSrc = `${location.origin}/osmd/index.html`
-        // staffData.iframeSrc = `${location.origin}${location.pathname}osmd/index.html`
+        // staffData.iframeSrc = `${getHttpOrigin()}/osmd/index.html`
+        // staffData.iframeSrc = `${getHttpOrigin()}${location.pathname}osmd/index.html`
         staffData.musicXml = musicDetail.value?.xmlFileUrl || ''
         const tempList = musicDetail.value?.background || []
         const tempPartList = [] as any
@@ -631,10 +631,10 @@ export default defineComponent({
       try {
         nextTick(() => {
           if (musicPdfUrl.value) {
-            // const url = `${location.origin}/pdf/web/viewer-pdf.html?file=${encodeURIComponent(
+            // const url = `${getHttpOrigin()}/pdf/web/viewer-pdf.html?file=${encodeURIComponent(
             //   musicPdfUrl.value
             // )}&t=${Date.now()}`
-            const url = `${location.origin}${
+            const url = `${getHttpOrigin()}${
               location.pathname
             }pdf/web/viewer-pdf.html?file=${encodeURIComponent(
               musicPdfUrl.value
@@ -644,14 +644,14 @@ export default defineComponent({
             iframeRef.contentWindow.location.replace(url)
             staffData.iframeSrc = url
           } else {
-            const url = `${location.origin}${
+            const url = `${getHttpOrigin()}${
               location.pathname
             }osmd/index.html?t=${new Date().getTime()}`
-            // const url = `${location.origin}/osmd/index.html`
+            // const url = `${getHttpOrigin()}/osmd/index.html`
 
             const iframeRef = document.querySelector('#staffIframeRef') as any
             iframeRef.contentWindow.location.replace(
-              `${location.origin}${location.pathname}osmd/index.html`
+              `${getHttpOrigin()}${location.pathname}osmd/index.html`
             )
             staffData.iframeSrc = url
           }

+ 2 - 2
src/views/music/music-detail/index.tsx

@@ -537,7 +537,7 @@ export default defineComponent({
           }
         })
         let url =
-          location.origin +
+        getHttpOrigin() +
           `/teacher/#/shareMusic?id=${staffData.details?.id}&recomUserId=${state.user.data?.userId}&userType=${state.platformType}`
         // 判断是否有活动
         if (res.data.discount === 1) {
@@ -750,7 +750,7 @@ export default defineComponent({
       nextTick(() => {
         // console.log(staffData.musicPdfUrl, 'staffData.musicPdfUrl')
         if (staffData.musicPdfUrl) {
-          const url = `${location.origin}${
+          const url = `${getHttpOrigin()}${
             location.pathname
           }pdf/web/viewer-pdf.html?file=${encodeURIComponent(
             staffData.musicPdfUrl

+ 2 - 2
src/views/music/music.ts

@@ -2,7 +2,7 @@ import { orderStatus } from '@/views/order-detail/orderStatus'
 import { postMessage } from '@/helpers/native-message'
 import { Dialog } from 'vant'
 import qs from 'query-string'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 
 const browserInfo = browser()
 
@@ -16,7 +16,7 @@ export const musicBuy = (item: any, callBack?: any, moreQuery = {}) => {
   // 酷乐秀云教练的部署目录
   const musicScorePath = "/klx-music-score/";
   const url = qs.stringifyUrl({
-    url: location.origin + musicScorePath,
+    url: getHttpOrigin() + musicScorePath,
     query: {
       id: item.id,
       behaviorId,

+ 2 - 1
src/views/music/personal/collection.tsx

@@ -6,6 +6,7 @@ import ColResult from '@/components/col-result'
 import { openDefaultWebView, state } from '@/state'
 import styles from './index.module.less'
 import Song from '../component/song'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'MusicList',
@@ -80,7 +81,7 @@ export default defineComponent({
               list={rows.value}
               onDetail={(item: any) => {
                 let url =
-                  location.origin +
+                  getHttpOrigin() +
                   location.pathname +
                   '#/music-detail?id=' +
                   item.id

+ 2 - 1
src/views/music/personal/personal.tsx

@@ -7,6 +7,7 @@ import { openDefaultWebView, state } from '@/state'
 import styles from './index.module.less'
 import Song from '../component/song'
 import { number } from 'echarts/core'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'MusicList',
@@ -92,7 +93,7 @@ export default defineComponent({
               list={rows.value}
               onDetail={(item: any) => {
                 const url =
-                  location.origin +
+                  getHttpOrigin() +
                   location.pathname +
                   '#/music-detail?id=' +
                   item.id

+ 2 - 1
src/views/music/personal/practice.tsx

@@ -8,6 +8,7 @@ import songEmpty from '@/common/images/song-empty.png'
 import styles from './index.module.less'
 import Song from '../component/song'
 import { useRouter } from 'vue-router'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'Practice',
@@ -70,7 +71,7 @@ export default defineComponent({
                   return
                 }
                 const url =
-                  location.origin +
+                  getHttpOrigin() +
                   location.pathname +
                   '#/music-detail?id=' +
                   item.id

+ 2 - 1
src/views/music/songbook/list.tsx

@@ -10,6 +10,7 @@ import ColResult from '@/components/col-result'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
 import Song from '../component/song'
 import { openDefaultWebView, state } from '@/state'
+import { getHttpOrigin } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'Songbook',
@@ -102,7 +103,7 @@ export default defineComponent({
                 list={data.value.rows}
                 onDetail={(item: any) => {
                   const url =
-                    location.origin +
+                    getHttpOrigin() +
                     location.pathname +
                     '#/music-detail?id=' +
                     item.id

+ 3 - 3
src/views/order-detail/index.tsx

@@ -31,7 +31,7 @@ import OrderLive from './order-live'
 import OrderPractice from './order-practice'
 import OrderVip from './order-vip'
 import OrderMusic from './order-music'
-import { moneyFormat } from '@/helpers/utils'
+import { getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import OrderPinao from './order-pinao'
 import { getMusicDetail } from '@/student/trade/tradeOrder'
 import OrderActive from './order-active'
@@ -600,11 +600,11 @@ export default defineComponent({
       console.log(params, 'params ---', config)
       if (val.payCode === 'payResult') {
         window.location.href =
-          window.location.origin + state.payBackPath + '#/payResult?' + params
+          getHttpOrigin() + state.payBackPath + '#/payResult?' + params
       } else {
         
         this.qrCodeUrl =
-          window.location.origin + state.payBackPath + '#/payDefine?' + params
+          getHttpOrigin() + state.payBackPath + '#/payDefine?' + params
         this.showQrcode = true
         this.paymentStatus = false
 

+ 3 - 3
src/views/order-detail/userAuth/index.tsx

@@ -20,7 +20,7 @@ import activeButtonIcon from '@common/images/icon_checkbox.png'
 import inactiveButtonIcon from '@common/images/icon_checkbox_default.png'
 import activeButtonIconTenant from '@common/images/icon_checkbox-tenant.png'
 import styles from './index.module.less'
-import { browser } from '@/helpers/utils'
+import { browser, getHttpOrigin } from '@/helpers/utils'
 import PreviewProtocol from '@/views/preview-protocol'
 
 export default defineComponent({
@@ -92,13 +92,13 @@ export default defineComponent({
         postMessage({
           api: 'openWebView',
           content: {
-            url: `${location.origin}/${client}/#/previewProtocol`,
+            url: `${getHttpOrigin()}/${client}/#/previewProtocol`,
             orientation: 1,
             isHideTitle: false
           }
         })
       } else {
-        // this.iframeSrc = `${location.origin}/#/previewProtocol`
+        // this.iframeSrc = `${getHttpOrigin()}/#/previewProtocol`
         // console.log(this.iframeSrc, 'this.iframeSrc')
         this.popupShow = true
       }

+ 6 - 6
src/views/shop-mall/goods-detail/index.tsx

@@ -1,5 +1,5 @@
 import request from '@/helpers/request'
-import { browser, moneyFormat } from '@/helpers/utils'
+import { browser, getHttpOrigin, moneyFormat } from '@/helpers/utils'
 import {
   Swipe,
   SwipeItem,
@@ -98,11 +98,11 @@ export default defineComponent({
     shareUrl() {
       // 分享链接
       const productId = this.product.id as any
-      if (browser().isApp) {
-        return `${location.origin}/teacher/#/shareMall?bizId=${productId}&userId=${state.user.data.userId}&userType=${state.platformType}&p=tenant`
-      } else {
-        return `${location.origin}/teacher.html#/shareMall?bizId=${productId}&userId=${state.user.data.userId}&userType=${state.platformType}&p=tenant`
-      }
+      // if (browser().isApp) {
+        return `${getHttpOrigin()}/teacher/#/shareMall?bizId=${productId}&userId=${state.user.data.userId}&userType=${state.platformType}&p=tenant`
+      // } else {
+      //   return `${getHttpOrigin()}/teacher.html#/shareMall?bizId=${productId}&userId=${state.user.data.userId}&userType=${state.platformType}&p=tenant`
+      // }
     },
     platformStatus() {
       const userInfo = state.user.data as any

+ 2 - 2
src/views/shop-mall/index.tsx

@@ -26,7 +26,7 @@ import {
   removeListenerMessage
 } from '@/helpers/native-message'
 import ColSearch from '@/components/col-search'
-import { browser, getAuth, setAuth } from '@/helpers/utils'
+import { browser, getAuth, getHttpOrigin, setAuth } from '@/helpers/utils'
 import { cartCount, getCartCount } from './shop-mall'
 import TheHomeHeader from './components/TheHomeHeader'
 import { state } from '@/state'
@@ -100,7 +100,7 @@ export default defineComponent({
     },
     openWebView(url: string): void {
       try {
-        const origin = location.origin + location.pathname + '#'
+        const origin = getHttpOrigin() + location.pathname + '#'
         if (!url) return
 
         if (url.indexOf('http') < 0) {

+ 2 - 2
src/views/tenantStudentRejest/index.tsx

@@ -24,7 +24,7 @@ import rejectBtn from './images/rejectBtn.png'
 import studentSuccess from './images/studentSuccess.png'
 import request from '@/helpers/request'
 import dayjs from 'dayjs'
-import { removeAuth, setAuth } from '@/helpers/utils'
+import { getHttpOrigin, removeAuth, setAuth } from '@/helpers/utils'
 import { state } from '@/helpers/helpState'
 import { setLogin } from '@/state'
 export default defineComponent({
@@ -287,7 +287,7 @@ export default defineComponent({
     }
 
     const downApp = () => {
-      window.open(location.origin + '/student/#/download')
+      window.open(getHttpOrigin() + '/student/#/download')
       data.showSuccess = false
     }
 

+ 2 - 1
src/views/tenantTeacherRejest/index.tsx

@@ -32,6 +32,7 @@ import teacherSuccess from './images/teacherSuccess.png'
 import SubjectModel from './modals/chioseSuond'
 import request from '@/helpers/request'
 import dayjs from 'dayjs'
+import { getHttpOrigin } from '@/helpers/utils'
 export default defineComponent({
   name: 'tenantStudentRejest',
   setup() {
@@ -173,7 +174,7 @@ export default defineComponent({
     }
 
     const downApp = () => {
-      window.open(location.origin + '/student/#/download?type=teacher')
+      window.open(getHttpOrigin() + '/student/#/download?type=teacher')
       data.showSuccess = false
     }