Browse Source

fin-v0

master
wengsy 4 years ago
parent
commit
f5de9a1ae6
17 changed files with 32 additions and 19 deletions
  1. BIN
      APP/__pycache__/server.cpython-36.pyc
  2. BIN
      APP/static/img/9fd2ce57-3d6b-47bf-a134-7b2f511c3522.png
  3. +1
    -0
      APP/static/js/ip.js
  4. +3
    -2
      APP/static/js/wsy.js
  5. +2
    -1
      APP/templates/add.html
  6. +2
    -2
      APP/templates/forget.html
  7. +5
    -5
      APP/templates/login.html
  8. +2
    -1
      APP/templates/personal.html
  9. +5
    -7
      APP/templates/register.html
  10. BIN
      APP/view/__pycache__/auth.cpython-36.pyc
  11. BIN
      APP/view/__pycache__/block.cpython-36.pyc
  12. BIN
      APP/view/__pycache__/collection.cpython-36.pyc
  13. BIN
      APP/view/__pycache__/database.cpython-36.pyc
  14. BIN
      APP/view/__pycache__/model.cpython-36.pyc
  15. BIN
      APP/view/__pycache__/start.cpython-36.pyc
  16. +1
    -1
      APP/view/block.py
  17. +11
    -0
      APP/view/database.py

BIN
APP/__pycache__/server.cpython-36.pyc View File


BIN
APP/static/img/9fd2ce57-3d6b-47bf-a134-7b2f511c3522.png View File

Before After
Width: 237  |  Height: 364  |  Size: 11 KiB

+ 1
- 0
APP/static/js/ip.js View File

@ -0,0 +1 @@
var url = '106.75.245.180';

+ 3
- 2
APP/static/js/wsy.js View File

@ -1,5 +1,5 @@
var url_prefix = "http://"+returnCitySN["cip"]+":5000/";;
var url_prefix = 'http://'+url+':5000/';;
var cookie = {
setCookie: function (name, value) {
@ -23,6 +23,7 @@ var cookie = {
function sendRequest(url_suffix, data, func) {
var url = url_prefix + url_suffix;
alert(url);
$.ajax({
type: "post",
url: url,
@ -405,4 +406,4 @@ function compile(){
}
}
}

+ 2
- 1
APP/templates/add.html View File

@ -15,6 +15,7 @@
<meta name="msapplication-tap-highlight" content="no">
<link href="../static/css/charts.css" rel="stylesheet">
<link href="../static/css/main.css" rel="stylesheet">
<script src="../static/js/ip.js"></script>
<script src="../static/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../static/js/showdown-master/dist/showdown.min.js"></script>
<script type="text/javascript">
@ -580,4 +581,4 @@
</body>
</html>
</html>

+ 2
- 2
APP/templates/forget.html View File

@ -6,14 +6,14 @@
<title>忘记密码</title>
<script src="../static/js/jquery-3.5.1.min.js"></script>
<script src="http://api.html5media.info/1.1.8/html5media.min.js"></script>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script src="../static/js/ip.js"></script>
<script type="text/javascript">
function forget(obj){
var phonenum = $(obj).parent().prev().prev().prev().prev().children("#phonenum").val();
var username = $(obj).parent().prev().prev().prev().children("#username").val();
var password = $(obj).parent().prev().prev().children("#password").val();
var password1 = $(obj).parent().prev().children("#password1").val();
var url = "http://"+returnCitySN["cip"]+":5000/bp_auth/forget";
var url = "http://"+url+":5000/bp_auth/forget";
$.ajax({
type: "POST",
url: url,

+ 5
- 5
APP/templates/login.html View File

@ -7,7 +7,7 @@
<title>登录</title>
<script src="../static/js/jquery-3.5.1.min.js"></script>
<script src="http://api.html5media.info/1.1.8/html5media.min.js"></script>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script src="../static/js/ip.js"></script>
<script type="text/javascript">
var cookie = {
setCookie: function (cname, cvalue, exdays) {
@ -35,11 +35,11 @@
function login(obj) {
var phonenum = $(obj).parent().prev().prev().children("#phonenum").val();
var password = $(obj).parent().prev().children("#password").val();
var url = "http://"+returnCitySN["cip"]+":5000/bp_auth/login";
var url_ = "http://"+url+":5000/bp_auth/login";
alert(url_);
$.ajax({
type: "POST",
url: url,
url: url_,
data: {
phonenum: phonenum,
password: password
@ -91,4 +91,4 @@
</div>
</body>
</html>
</html>

+ 2
- 1
APP/templates/personal.html View File

@ -7,6 +7,7 @@
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<meta http-equiv="Content-Language" content="en">
<script src="../static/js/ip.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心</title>
<meta name="viewport"
@ -565,4 +566,4 @@
</script>
</body>
</html>
</html>

+ 5
- 7
APP/templates/register.html View File

@ -6,10 +6,7 @@
<title>注册</title>
<script src="../static/js/jquery-3.5.1.min.js"></script>
<script src="http://api.html5media.info/1.1.8/html5media.min.js"></script>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script>
var url = returnCitySN["cip"];
</script>
<script src="../static/js/ip.js"></script>
</head>
<body>
<div class="background">
@ -36,6 +33,7 @@
var password = $(obj).parent().prev().prev().children("#password").val();
var password1 = $(obj).parent().prev().children("#password1").val();
var suf_url = ":5000/bp_auth/register";
alert(url);
var pre_url = "http://"
$.ajax({
type: "POST",
@ -49,10 +47,10 @@
success: function(data){
alert(data.msg);
if(data.code == 1){
window.location = "%%url_for('start.login')%%";
window.location = "/login";
}
else{
window.location = "%%url_for('start.register')%%";
window.location = "/register";
}
},
@ -60,7 +58,7 @@
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
window.location = "register.html";
window.location = "/register";
}
});
}

BIN
APP/view/__pycache__/auth.cpython-36.pyc View File


BIN
APP/view/__pycache__/block.cpython-36.pyc View File


BIN
APP/view/__pycache__/collection.cpython-36.pyc View File


BIN
APP/view/__pycache__/database.cpython-36.pyc View File


BIN
APP/view/__pycache__/model.cpython-36.pyc View File


BIN
APP/view/__pycache__/start.cpython-36.pyc View File


+ 1
- 1
APP/view/block.py View File

@ -28,7 +28,7 @@ def add_block():
else:
img = request.files.get("content")
print(img)
path = basedir + "/APP/static/img/"
path = basedir + "/static/img/"
file_path = path + id + '.png'
img.save(file_path)
b = Block(type=type, content_text='static/img/'+id+'.png', order=count, id=id)

+ 11
- 0
APP/view/database.py View File

@ -1,6 +1,17 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import socket
def get_host_ip():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 80))
ip = s.getsockname()[0]
finally:
s.close()
return ip
engine = create_engine('mysql+pymysql://root:cui,logic@127.0.0.1:3306/cp', convert_unicode=True)
db_session = scoped_session(sessionmaker(autocommit=False,
autoflush=False,

Loading…
Cancel
Save