Browse Source

后缀问题修改

haojianlong 4 years ago
parent
commit
aaa76361ac
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/views/ready/buildfloor/repetitionGraphy.vue

+ 3 - 2
src/views/ready/buildfloor/repetitionGraphy.vue

@@ -109,7 +109,7 @@ export default {
         if (this.modelId != '') {
             this.hasGraph = true;
             const temp = this.modelId.split('.');
-            if (temp[1].toLowerCase() == 'png' || temp[1].toLowerCase() == 'jpg') {
+            if (temp[1] && (temp[1].toLowerCase() == 'png' || temp[1].toLowerCase() == 'jpg')) {
                 // return
             } else {
                 this.init()
@@ -295,7 +295,8 @@ export default {
         },
         // 根据modelid初始化
         initFromModelId(id){
-            if (id.split('.')[1].toLowerCase() == 'png' || id.split('.')[1].toLowerCase() == 'jpg') {
+            const temp = id.split('.')[1];
+            if (temp && (temp.toLowerCase() == 'png' || temp.toLowerCase() == 'jpg')) {
                 this.$refs.drawFloor.initGraphy(id, 3)
             } else {
                 this.$refs.drawFloor.initGraphy(id, 1)