skyblued 2 years ago
parent
commit
12f6e5fd90

+ 0 - 2
index.html

@@ -150,9 +150,7 @@
           const win = window;
           win.originalPostMessage = win.originalPostMessage || window.postMessage
           const instance = window.ORCHESTRA || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.ORCHESTRA) 
-          console.log("🚀 ~ instance", instance)
           return function (data) {
-            console.log("🚀 ~ data", data)
             if (instance) {
               const uuid = getRandomKey()
               data.content = data.content ? Object.assign(Object.assign({}, data.content), { uuid }) : { uuid }

+ 1 - 12
src/helpers/native-message.ts

@@ -66,7 +66,7 @@ const browserInfo = browser()
 if (browserInfo.isApp) {
   window.addEventListener('message', (evt) => {
     try {
-      // console.log(evt, 'message', evt.data)
+      console.log('message', evt.data)
       const data = evt.data ? (typeof evt.data === 'object' ? evt.data : JSON.parse(evt.data)) : {}
       const uuid = data.content?.uuid || data.uuid
       // console.log(uuid, data.content, 'uuid')
@@ -113,21 +113,10 @@ export const postMessage = (data: IPostMessage, callback?: CallBack) => {
     calls[uuid] = callback || loop
     data.content = data.content ? { ...data.content, uuid } : { uuid }
     console.log('send:', JSON.stringify(data))
-    console.log('instance管乐团', instance)
     instance.postMessage(JSON.stringify(data))
   }
 }
 
-// export const listenerMessage = (api: string, callback: CallBack) => {
-//   console.log(browserInfo, 'browserInfo', api, 'api', callback)
-//   if (browserInfo.isApp) {
-//     const uuid = api
-//     if (!calls[uuid]) {
-//       calls[uuid] = []
-//     }
-//     ;(calls[uuid] as CallBack[]).push(callback || loop)
-//   }
-// }
 export const listenerMessage = (api: string, callback: CallBack) => {
   if (browserInfo.isApp) {
     const uuid = api

+ 1 - 0
src/subpages/colexiu/buttons/evaluating.tsx

@@ -167,6 +167,7 @@ const connect = async () => {
   if (browserInfo.ios) {
     content.platform = 'IOS'
   }
+  // console.log("评测数据", content)
   const evt = await promisefiyPostMessage({
     api: 'startEvaluating',
     content: content,

+ 1 - 1
src/subpages/colexiu/index.tsx

@@ -191,7 +191,7 @@ export default defineComponent({
             },
             times: detailState.times,
           })
-          console.log('生成缓存数据', productRef.value)
+          // console.log('生成缓存数据', musicJSON)
           musicJSON.svg = document.getElementById('osmdSvgPage1')?.outerHTML || '';
           nextTick(() => {
             musicJSON.svg = document.getElementById('osmdSvgPage1')?.outerHTML || '';

+ 1 - 1
src/subpages/colexiu/main.ts

@@ -12,7 +12,7 @@ import router from './router'
 import { promisefiyPostMessage } from '/src/helpers/native-message'
 // 获取token
 promisefiyPostMessage({ api: 'getToken' }).then((res: any) => {
-  console.log('获取token', res)
+  // console.log('获取token', res)
   if (res?.content?.accessToken) {
     sessionStorage.setItem('Authorization', res.content.tokenType + ' ' + res.content.accessToken)
   }