Browse Source

static href

master
LOGIC0805 4 years ago
parent
commit
0c719efa99
5 changed files with 46 additions and 43 deletions
  1. +35
    -31
      .idea/workspace.xml
  2. +1
    -1
      APP/templates/forget.html
  3. +1
    -1
      APP/templates/register.html
  4. BIN
      APP/view/__pycache__/auth.cpython-37.pyc
  5. +9
    -10
      APP/view/auth.py

+ 35
- 31
.idea/workspace.xml View File

@ -2,14 +2,9 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="ccd18ece-a4ed-4116-ada0-c6de56a9afb1" name="默认的" comment="">
<change afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/APP/templates/forget.html" beforeDir="false" afterPath="$PROJECT_DIR$/APP/templates/forget.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/APP/templates/login.html" beforeDir="false" afterPath="$PROJECT_DIR$/APP/templates/login.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/APP/templates/register.html" beforeDir="false" afterPath="$PROJECT_DIR$/APP/templates/register.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/APP/view/auth.py" beforeDir="false" afterPath="$PROJECT_DIR$/APP/view/auth.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/APP/view/database.py" beforeDir="false" afterPath="$PROJECT_DIR$/APP/view/database.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
@ -22,8 +17,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/APP/server.py">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="41" selection-start-column="41" selection-end-column="41" />
<state relative-caret-position="57">
<caret line="3" column="38" lean-forward="true" selection-start-line="3" selection-start-column="38" selection-end-line="3" selection-end-column="38" />
</state>
</provider>
</entry>
@ -43,8 +38,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/APP/view/auth.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="43">
<caret line="86" column="43" selection-start-line="86" selection-start-column="43" selection-end-line="86" selection-end-column="43" />
<state relative-caret-position="437">
<caret line="88" column="42&#34; lean-forward="true" selection-start-line="88" selection-start-column="42" selection-end-line="88" selection-end-column="42" />
<folding>
<element signature="e#0#52#0" expanded="true" />
</folding>
@ -52,11 +47,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/APP/templates/login.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="209">
<caret line="51" column="58" lean-forward="true" selection-start-line="51" selection-start-column="58" selection-end-line="51" selection-end-column="58" />
<state>
<caret line="23" selection-start-line="23" selection-end-line="23" />
</state>
</provider>
</entry>
@ -64,17 +59,17 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/APP/templates/register.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="214">
<caret line="26" column="33" selection-start-line="26" selection-start-column="33" selection-end-line="26" selection-end-column="33" />
<state relative-caret-position="252">
<caret line="28" column="17&#34; lean-forward=&#34;true" selection-start-line="28" selection-start-column="17" selection-end-line="28" selection-end-column="17" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/APP/templates/forget.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="456">
<caret line="24" column="36" lean-forward="true" selection-start-line="24" selection-start-column="36" selection-end-line="24" selection-end-column="36" />
<state relative-caret-position="247">
<caret line="33" column="34" lean-forward="true" selection-start-line="33" selection-start-column="34" selection-end-line="33" selection-end-column="34" />
</state>
</provider>
</entry>
@ -113,13 +108,14 @@
<option value="$PROJECT_DIR$/APP/view/database.py" />
<option value="$PROJECT_DIR$/APP/view/collection.py" />
<option value="$PROJECT_DIR$/APP/templates/login.html" />
<option value="$PROJECT_DIR$/APP/server.py" />
<option value="$PROJECT_DIR$/APP/view/auth.py" />
<option value="$PROJECT_DIR$/APP/templates/register.html" />
<option value="$PROJECT_DIR$/APP/templates/forget.html" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="7">
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="-10" />
<option name="y" value="-10" />
<option name="width" value="1940" />
@ -264,6 +260,7 @@
</component>
<component name="ToolWindowManager">
<frame x="-7" y="-7" width="1550" height="838" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Favorites" side_tool="true" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24966975" />
@ -299,10 +296,10 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/APP/server.py">
<entry file="file://$PROJECT_DIR$/APP/templates/login.html">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="41" selection-start-column="41" selection-end-column="41" />
<caret line="23" selection-start-line="23" selection-end-line="23" />
</state>
</provider>
</entry>
@ -316,34 +313,41 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/APP/templates/register.html">
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python37-32/Lib/site-packages/pymysql/cursors.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="214">
<caret line="26" column="33" selection-start-line="26" selection-start-column="33" selection-end-line="26" selection-end-column="33" />
<state relative-caret-position="-1941">
<caret line="169" selection-start-line="169" selection-end-line="169" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/APP/templates/forget.html">
<entry file="file://$PROJECT_DIR$/APP/server.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="456">
<caret line="24" column="36" lean-forward="true" selection-start-line="24" selection-start-column="36" selection-end-line="24" selection-end-column="36" />
<state relative-caret-position="57">
<caret line="3" column="38" lean-forward="true" selection-start-line="3" selection-start-column="38" selection-end-line="3" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/APP/view/auth.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="43">
<caret line="86" column="43" selection-start-line="86" selection-start-column="43" selection-end-line="86" selection-end-column="43" />
<state relative-caret-position="437">
<caret line="88" column="42&#34; lean-forward="true" selection-start-line="88" selection-start-column="42" selection-end-line="88" selection-end-column="42" />
<folding>
<element signature="e#0#52#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/APP/templates/login.html">
<entry file="file://$PROJECT_DIR$/APP/templates/register.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="28" column="17" lean-forward="true" selection-start-line="28" selection-start-column="17" selection-end-line="28" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/APP/templates/forget.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="209">
<caret line="51" column="58" lean-forward="true" selection-start-line="51" selection-start-column="58" selection-end-line="51" selection-end-column="58" />
<state relative-caret-position="247">
<caret line="33" column="34" lean-forward="true" selection-start-line="33" selection-start-column="34" selection-end-line="33" selection-end-column="34" />
</state>
</provider>
</entry>

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

@ -32,7 +32,7 @@
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
window.location = url;
window.location = "forget.html";
}
});
}

+ 1
- 1
APP/templates/register.html View File

@ -32,7 +32,7 @@
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
window.location = url;
window.location = "register.html";
}
});
}

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


+ 9
- 10
APP/view/auth.py View File

@ -44,11 +44,10 @@ def login():
@bp_auth.route('/register', methods=['POST', 'GET'])
def register():
if request.method == 'POST':
datas = json.loads(request.get_data())
phonenum = datas['phonenum']
name = datas['name']
password = datas['password']
password1 = datas['password1']
phonenum = request.form['phonenum']
username = request.form['username']
password = request.form['password']
password1 = request.form['password1']
msg = ''
userlist = db_session.query(Users)
@ -63,10 +62,10 @@ def register():
else:
if phonenum != '' and password != '':
if password == password1:
user = Users(phonenum=phonenum, name=name, password=password)
user = Users(phonenum=phonenum, name=username, password=password)
db_session.add(user)
db_session.commit()
return jsonify({'code': 1, 'name': name, 'phonenum': phonenum})
return jsonify({'code': 1, 'name': username, 'phonenum': phonenum})
else:
msg = "两次输入密码不一致!"
return jsonify({'code': 2, 'msg': msg})
@ -82,7 +81,7 @@ def register():
def forget():
if request.method == 'POST':
phonenum = request.form['phonenum']
name = request.form['name']
username = request.form['username']
password = request.form['password']
password1 = request.form['password1']
msg = ''
@ -91,7 +90,7 @@ def forget():
flag = 0
for user in userlist:
if user.phonenum == phonenum:
if user.name == name:
if user.name == username:
user.password = password
db_session.commit()
flag = 1
@ -106,7 +105,7 @@ def forget():
if password == password1:
if flag == 1:
msg = "修改密码成功!"
return jsonify({'code': 1, 'name': name, 'phonenum': phonenum})
return jsonify({'code': 1, 'name': username, 'phonenum': phonenum})
else:
msg = "用户名输入错误!"
return jsonify({'code': 2, 'msg': msg})

Loading…
Cancel
Save