mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
f355f1969a
@ -206,9 +206,14 @@ class ProjectData extends Component {
|
||||
|
||||
handleAddInterface(info){
|
||||
if(this.state.selectCatid){
|
||||
let filename = info.file.name;
|
||||
let filetype = filename.substr(filename.lastIndexOf(".")).toLowerCase();
|
||||
// console.log(filename,filetype);
|
||||
if(filetype != ".json") return message.error("文件格式只能为json");
|
||||
let reader = new FileReader();
|
||||
reader.readAsText(info.file);
|
||||
reader.onload = (res)=>{
|
||||
|
||||
res = res.target.result;
|
||||
try{
|
||||
res = JSON.parse(res);
|
||||
|
Loading…
Reference in New Issue
Block a user