新增mock文件必须要添加文件后缀
This commit is contained in:
parent
5a89528e91
commit
43fc4ebf57
@ -872,6 +872,10 @@
|
||||
this.$message.error("文件名不能包含路径分隔符");
|
||||
return;
|
||||
}
|
||||
if (!/\.[^./\\]+$/.test(fileName)) {
|
||||
this.$message.error("文件名必须包含后缀,如 .json、.txt 等");
|
||||
return;
|
||||
}
|
||||
var filePath = "mock/" + fileName;
|
||||
try {
|
||||
var resp = await fetch("/__mock-files", {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user