indexOf()!==-1 则意味着字符串中会出现指定的字符串

      if(path.indexOf('/detail')!==-1){
        path = '/detail'
      }
这样只要字符串有'detail',就把path设置为'/detail'

相关文章: