Add request method
This commit is contained in:
parent
943b4c0b87
commit
2eb0ac21d6
@ -6,27 +6,34 @@
|
||||
<!-- <span style="font-size: 30px;font-weight: bold">Simple Json View</span>-->
|
||||
<div style="display: flex;flex-direction: row;align-items: flex-end;height: 30px">
|
||||
<el-link :underline="false" href="https://landaiqing.space" target='_blank' style="font-size: medium">博客</el-link>
|
||||
<el-link :underline="false" href="https://landaiqing.space" target='_blank' style="font-size: medium;margin-left: 20px">源码</el-link>
|
||||
<el-link :underline="false" href="https://git.landaiqing.space/Qing/simple-json-view" target='_blank' style="font-size: medium;margin-left: 20px">源码</el-link>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main style="width: 100%">
|
||||
<div style="display: flex;flex-direction: row;align-items: center">
|
||||
<div style="display: flex;flex-direction: row;align-items: center;justify-content: center">
|
||||
<el-input
|
||||
autosize
|
||||
type="text"
|
||||
placeholder="输入接口链接或在下方输入Json"
|
||||
style="width: 100%;margin-bottom: 10px;margin-top: 30px"
|
||||
style=";margin-bottom: 10px;margin-top: 30px"
|
||||
@blur="getJson"
|
||||
v-model="url"
|
||||
>
|
||||
</el-input>
|
||||
<div style="display: flex;flex-direction: row;flex-wrap: nowrap;align-items: center">
|
||||
<el-radio-group @change="radioChange($event)" v-model="radio" style="margin-top: 15px;width: 150px;height: 30px;display: flex;flex-direction: row;align-items: center">
|
||||
<el-radio :label="1">get</el-radio>
|
||||
<el-radio :label="2">post</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<JsonEditor :json-data="jsonData"></JsonEditor>
|
||||
<!-- <JsonSchema></JsonSchema>-->
|
||||
</el-main>
|
||||
<el-footer style="height: 20px">
|
||||
陕ICP备2023001488号 | 陕公网安备 61072902000127号
|
||||
Qing | 陕ICP备2023001488号 | 陕公网安备 61072902000127号
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</div>
|
||||
@ -48,15 +55,16 @@ export default {
|
||||
return{
|
||||
url:null,
|
||||
jsonData:null,
|
||||
radio:2,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
getJson(){
|
||||
console.log(this.url);
|
||||
console.log(this.radio)
|
||||
if(this.url!==null){
|
||||
var that=this;
|
||||
axios({
|
||||
method: 'post',
|
||||
method: this.radio===2?'post':'get',
|
||||
// 请求的地址
|
||||
url: this.url,
|
||||
}).then( (res)=> {
|
||||
@ -73,6 +81,9 @@ export default {
|
||||
return false;
|
||||
}
|
||||
|
||||
},
|
||||
radioChange(){
|
||||
this.getJson();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user