forked from zhanghe06/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (39 loc) · 1.42 KB
/
index.html
File metadata and controls
41 lines (39 loc) · 1.42 KB
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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>python web</title>
<script type="text/javascript" src="/static/js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="{{ static_url('js/jsEncrypt.js') }}"></script>
<script type="text/javascript">
$(document).ready(function(){
//解密测试
//var text = JsEncrypt.decode("MCUyQzAlMkMxMzgwMDAwMDAwMCUyQzEyMzQ1NiUyQzAlMkMlMkM=");
//var text2 = decodeURIComponent(text);
//弹出明文
//alert(text2);
//加密
$('#encrypt').click(function(){
var text_encrypt = JsEncrypt.encode(encodeURIComponent("0,0,"+$('#username').val()+","+$('#password').val()+",0,,"));
var text_payload = JSON.stringify({'CS':text_encrypt});
$('#payload').val(text_payload);
});
});
</script>
</head>
<body>
Hello Python~~
I will try my best to learn it !
<br/>
<form method="post" action="/login">
<label for="username">账号:</label><input type="text" id="username">
<br/>
<label for="password">密码:</label><input type="text" id="password">
<br/>
<label for="payload">密参:</label><input type="text" name="payload" id="payload">
<input type="button" id="encrypt" value="加密">
<div id="err_show"></div>
<button type="submit">登录</button>
</form>
</body>
</html>