|
@@ -30,14 +30,37 @@ export default defineComponent({
|
|
|
setup(props, { emit }) {
|
|
|
console.log('🚀 ~ props', props.item)
|
|
|
const userStore = useUserStore()
|
|
|
- const prefix = /(localhost|192)/.test(location.host)
|
|
|
- ? 'https://ponline.colexiu.com'
|
|
|
- : location.origin //
|
|
|
- const src =
|
|
|
+ // const prefix = /(localhost|192)/.test(location.host)
|
|
|
+ // ? 'https://test.resource.colexiu.com'
|
|
|
+ // : location.origin //
|
|
|
+ // const src =
|
|
|
+ // prefix +
|
|
|
+ // `/instrument/?_t=${Date.now()}&id=${props.item.content}&modelType=practice&Authorization=${
|
|
|
+ // userStore.getToken
|
|
|
+ // }&`
|
|
|
+ const apiUrls = {
|
|
|
+ dev: 'https://dev.kt.colexiu.com',
|
|
|
+ test: 'https://test.kt.colexiu.com',
|
|
|
+ online: 'https://mec.colexiu.com'
|
|
|
+ }
|
|
|
+
|
|
|
+ const environment = location.origin.includes('//dev')
|
|
|
+ ? 'dev'
|
|
|
+ : location.origin.includes('//test')
|
|
|
+ ? 'test'
|
|
|
+ : location.origin.includes('//mec.colexiu')
|
|
|
+ ? 'online'
|
|
|
+ : 'dev'
|
|
|
+ const apiUrl = apiUrls[environment]
|
|
|
+ // const prefix = /(localhost|192)/.test(location.host) ? 'http://dev.resource.colexiu.com/' : location.origin
|
|
|
+ const prefix = /(localhost|192)/.test(location.host) ? 'https://test.kt.colexiu.com' : apiUrl
|
|
|
+ let src =
|
|
|
prefix +
|
|
|
- `/orchestra-music-score/?_t=${Date.now()}&id=${
|
|
|
+ `/instrument/?_t=${Date.now()}&id=${
|
|
|
props.item.content
|
|
|
- }&modelType=practice&Authorization=${userStore.getToken}`
|
|
|
+ }&modelType=practise&modeType=json&Authorization=${
|
|
|
+ userStore.getToken
|
|
|
+ }&isCbs=true&zoom=0.8&isBack=false`
|
|
|
const message = useMessage()
|
|
|
const state = reactive({
|
|
|
current: 1,
|