bill 1 year ago
parent
commit
029e7eecac
2 changed files with 3 additions and 2 deletions
  1. 1 1
      src/api/instance.ts
  2. 2 1
      src/sdk/association.ts

+ 1 - 1
src/api/instance.ts

@@ -25,7 +25,7 @@ export const {
 } = instance
 
 const gotoLogin = () => {
-  const loginHref = import.meta.env.DEV ? 'http://localhost:5174' : '/'
+  const loginHref = import.meta.env.DEV ? 'http://localhost:5174' : '/' + location.pathname
   location.href = loginHref + '?redirect=' + escape(location.href) + '#/login'
 }
 

+ 2 - 1
src/sdk/association.ts

@@ -84,13 +84,14 @@ const associationModels = (sdk: SDK) => {
       const itemRaw = toRaw(item)
       let sceneModel: SceneModel
       try {
+        console.log(item.type === SceneType.SWSS ? 'laser' : item.modelType, item)
         sceneModel = sdk.addModel({
           ...itemRaw,
           ...modelRange,
           mode: RoutesName.signModel === currentLayout.value! ? 'single' : 'many',
           isDynamicAdded: dynamicAddedModelIds.value.some(id => itemRaw.id === id),
           type: item.type === SceneType.SWSS ? 'laser' : item.modelType,
-          url: item.type === SceneType.SWSS ? item.url : getResource(item.url)
+          url: item.type === SceneType.SWSS ? item.url : item.url && getResource(item.url)
         })
       } catch(e) {
         console.error('模型加载失败', e)