'commit'
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
ddfc6fda53
commit
4b21f5c666
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,7 @@
|
||||
go get -u github.com/jteeuwen/go-bindata/...
|
||||
|
||||
go-bindata fonts
|
||||
sed -i "s/package main/package base64Captcha/g" bindata.go
|
||||
|
||||
|
||||
https://github.com/jteeuwen/go-bindata
|
Binary file not shown.
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<img id="capt" src=""/><br/>
|
||||
<input id="captvalue" placeholder="请输入验证码"/><br/>
|
||||
<input type="button" name="save" value="提交" onclick="submit()"/>
|
||||
<script>
|
||||
var curCaptId = "";
|
||||
//得到图形验证码和id
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/dsSzxy/captchaRelate/getCaptcha",
|
||||
data: {},
|
||||
dataType: "JSON",
|
||||
success: function (result) {
|
||||
curCaptId = result.captcha.id;
|
||||
document.getElementById("capt").src = result.captcha.base_64_blob;
|
||||
}
|
||||
});
|
||||
|
||||
//提交验证码和id
|
||||
function submit() {
|
||||
var capt = document.getElementById("captvalue").value;
|
||||
var postdata = {
|
||||
"id": curCaptId,
|
||||
"capt": capt
|
||||
};
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/dsSzxy/captchaRelate/verifyCaptcha",
|
||||
data: postdata,
|
||||
dataType: "JSON",
|
||||
success: function (result) {
|
||||
console.log(result.success);
|
||||
if (result.success) {
|
||||
alert("验证成功");
|
||||
} else {
|
||||
alert("验证错误!" );
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue