-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
45 lines (40 loc) · 1.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
<style type="text/css">
</style>
</head>
<body>
<div>
<input type="file" name="photo" id="photo" value="" placeholder="免冠照片">
<input type="button" onclick="postData();" value="下一步" name="" style="width:100px;height:30px;">
</div>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
function postData() {
var formData = new FormData();
formData.append("photo", $("#photo")[0].files[0]);
formData.append("service", 'App.Passion.UploadFile');
console.log(132,formData)
$.ajax({
url: '#', /*接口域名地址*/
type: 'post',
data: formData,
contentType: false,
processData: false,
success: function (res) {
console.log(res.data);
if (res.data["code"] == "succ") {
alert('成功');
} else if (res.data["code"] == "err") {
alert('失败');
} else {
console.log(res);
}
}
})
}
</script>
</body>
</html>