瀏覽代碼

修复脉象绘制 3D 跨域 (https://wx.hzliuzhi.com/mz/hybrid/)

cc12458 3 月之前
父節點
當前提交
98dd62c661
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/components/AnalysisPulseComponent.vue

+ 4 - 1
src/components/AnalysisPulseComponent.vue

@@ -23,10 +23,13 @@ const parseUrl = (value?: string) => {
   const [url, query = ''] = (value ?? report.value?.url)?.split('report.html') ?? [];
   const params = getURLSearchParamsByUrl(query);
   if (url && params.has('appId') && params.has('access_session')) {
+    const replace /* 绘制 3D 跨域 */ = () => [
+      `https://wx.hzliuzhi.com/mz/hybrid/`,
+    ].includes(url) ? 'https://hybrid.reborn-tech.com/' : url;
     return {
       appId: params.get('appId')!!,
       token: params.get('access_session')!!,
-      url: `${url}report.html#/`,
+      url: `${replace()}report.html#/`,
     };
   }
 };