Skip to content

Commit

Permalink
整合
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang Peng committed Aug 12, 2021
1 parent 6e5fe54 commit d43b348
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 82 deletions.
35 changes: 0 additions & 35 deletions esdata/html/Vue-Ajax-GET.html

This file was deleted.

35 changes: 0 additions & 35 deletions esdata/html/Vue-Ajax-POST.html

This file was deleted.

45 changes: 37 additions & 8 deletions esdata/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
<title>Document</title>
<link rel="stylesheet" href="./index.css" type="text/css">
<script type="text/javascript" src="./index.js"></script>
<script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
<script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
</head>

<body>
<div class="window">
<div id="box" class="window">
<div class="left">
<div class="up">
<form action="#">
Expand Down Expand Up @@ -77,15 +79,13 @@

<div class="down">
<div class="control_01">
<textarea class="subject_01" placeholder="发生测试信息..."" >

</textarea>
<div> {{msg}} </div>
</div>
<div class=" control_02">
<button>启动</button>
<button>暂停</button>
<button>停止</button>
<button onclick="myFunction()">清零</button>
<input type="button" @click="get()" value="启动">
<input type="button" @click="post()" value="暂停">
<input type="button" @click="" value="停止">
<input type="button" @click="" value="清零">
</div>

</div>
Expand Down Expand Up @@ -235,6 +235,35 @@ <h3 id="biaoti">
</div>
</div>
</div>
<script type = "text/javascript">
window.onload = function(){
var vm = new Vue({
el:'#box',
data:{
msg:'Hello World!',
},
methods:{
get:function(){
//发送get请求
this.$http.get('http://127.0.0.1:8080/tp/api/get_test_tp').then(function(res){
this.msg = res.data
},function(){
console.log('请求失败处理');
});
},

post:function(){
//发送 post 请求
this.$http.post('http://127.0.0.1:8080/tp/api/post_test_tp',{"id":"335261","name":"sccuu"},{emulateJSON:true}).then(function(res){
this.msg = res.data
},function(res){
console.log(res.status);
});
}
}
});
}
</script>
</body>

</html>
4 changes: 0 additions & 4 deletions esdata/html/index.js

This file was deleted.

0 comments on commit d43b348

Please sign in to comment.