MeiRiYiCheng_1_old/YBDevice.NApi/Views/Home/Privacy.cshtml

27 lines
802 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@{
ViewData["Title"] = "test";
}
<h1>@ViewData["Title"]</h1>
<button id="click">测试ajax</button>
@section Scripts{
<script type="text/javascript">
$("#click").on("click",function(){
var postdata = {"id":"08d9f761-b402-47f0-8656-0e529a9b5b8b"};
$.ajax({
url:"https://localhost:44335/ybapi/fans/getinfo",
method:"post",
xhrFields: {
withCredentials: false // 如果是https请求可以试试 true
},
crossDomain: true,
contentType:"application/json",
data:JSON.stringify(postdata),
success:function(res){
console.log(res);
}
});
});
</script>
}