vbenjs / vite-plugin-mock

A mock plugin for vite.use mockjs.
MIT License
610 stars 96 forks source link

使用带?的 url 报错 #126

Open wlpswll opened 8 months ago

wlpswll commented 8 months ago

如下 mock 代码,vite@5,vite-plugin-mock@3.0.0 代码: export default [ { url: '/xx/xxx/xxxx?sss=1211', method: 'post', timeout: Math.floor(Math.random() * (1200 + 1)), response: () => { return { ret: 0, msg: '', total: 1, list: [

    ]
  };
}

} ] as MockMethod[]; 报错信息: node_modules/path-to-regexp/dist/index.js:114 throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type)); ^

TypeError: Unexpected MODIFIER at 31, expected END