Browse Source

static href

master
LOGIC0805 4 years ago
parent
commit
60d7c7e369
14 changed files with 357 additions and 26 deletions
  1. +4
    -0
      .idea/encodings.xml
  2. +3
    -0
      .idea/misc.xml
  3. +318
    -2
      .idea/workspace.xml
  4. +3
    -4
      APP/templates/forget.html
  5. +10
    -7
      APP/templates/login.html
  6. +3
    -4
      APP/templates/register.html
  7. +9
    -0
      APP/url crawler.py
  8. BIN
      APP/view/__pycache__/auth.cpython-37.pyc
  9. BIN
      APP/view/__pycache__/block.cpython-37.pyc
  10. BIN
      APP/view/__pycache__/collection.cpython-37.pyc
  11. BIN
      APP/view/__pycache__/database.cpython-37.pyc
  12. BIN
      APP/view/__pycache__/model.cpython-37.pyc
  13. +6
    -8
      APP/view/auth.py
  14. +1
    -1
      APP/view/database.py

+ 4
- 0
.idea/encodings.xml View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

+ 3
- 0
.idea/misc.xml View File

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
</project>

+ 318
- 2
.idea/workspace.xml View File

@ -1,17 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="ccd18ece-a4ed-4116-ada0-c6de56a9afb1" name="默认的" comment="" />
<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" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf>
<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>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/APP/view/database.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="57">
<caret line="3" column="70" selection-start-line="3" selection-start-column="70" selection-end-line="3" selection-end-column="70" />
<folding>
<element signature="e#0#36#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<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" />
<folding>
<element signature="e#0#52#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<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>
</provider>
</entry>
</file>
<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>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<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>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/APP/view/block.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="38">
<caret line="2" column="11" selection-start-line="2" selection-start-column="11" selection-end-line="2" selection-end-column="11" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/APP/view/collection.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="19">
<caret line="1" column="26" selection-start-line="1" selection-start-column="26" selection-end-line="1" selection-end-column="26" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>json_util</find>
</findStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<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/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="6">
<option name="x" value="-10" />
<option name="y" value="-10" />
<option name="width" value="1940" />
<option name="height" value="1050" />
</component>
<component name="ProjectId" id="1mhKD9KpVlX4td3NNUwfqIK7RXy" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="Personal-Collections-Website" type="b2602c69:ProjectViewProjectNode" />
<item name="Personal-Collections-Website" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Personal-Collections-Website" type="b2602c69:ProjectViewProjectNode" />
<item name="Personal-Collections-Website" type="462c0819:PsiDirectoryNode" />
<item name="APP" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Personal-Collections-Website" type="b2602c69:ProjectViewProjectNode" />
<item name="Personal-Collections-Website" type="462c0819:PsiDirectoryNode" />
<item name="APP" type="462c0819:PsiDirectoryNode" />
<item name="static" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Personal-Collections-Website" type="b2602c69:ProjectViewProjectNode" />
<item name="Personal-Collections-Website" type="462c0819:PsiDirectoryNode" />
<item name="APP" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Personal-Collections-Website" type="b2602c69:ProjectViewProjectNode" />
<item name="Personal-Collections-Website" type="462c0819:PsiDirectoryNode" />
<item name="APP" type="462c0819:PsiDirectoryNode" />
<item name="view" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
@ -21,7 +178,71 @@
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../../dataManage/proj3/bookstore" />
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
<module name="Personal-Collections-Website" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="C:\Users\dell\AppData\Local\Programs\Python\Python37-32\python.exe" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="server" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="Personal-Collections-Website" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="C:\Users\dell\AppData\Local\Programs\Python\Python37-32\python.exe" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/APP" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/APP/server.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Python.server" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" BundledDictionaries="0" Folders="0" CustomDictionaries="0" Dictionaries="0" CorrectionsLimit="5" DefaultDictionary="application-level" UseSingleDictionary="true" />
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="ccd18ece-a4ed-4116-ada0-c6de56a9afb1" name="默认的" comment="" />
@ -32,4 +253,99 @@
</task>
<servers />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="-7" y="-7" width="1550" height="838" extended-state="6" />
<layout>
<window_info id="Favorites" side_tool="true" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24966975" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="Version Control" weight="0.32991204" />
<window_info anchor="bottom" id="Python Console" weight="0.32991204" />
<window_info anchor="bottom" id="Terminal" weight="0.32991204" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.30645162" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32991204" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/APP/view/block.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="38">
<caret line="2" column="11" selection-start-line="2" selection-start-column="11" selection-end-line="2" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/APP/view/collection.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="19">
<caret line="1" column="26" selection-start-line="1" selection-start-column="26" selection-end-line="1" selection-end-column="26" />
</state>
</provider>
</entry>
<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>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/APP/view/database.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="57">
<caret line="3" column="70" selection-start-line="3" selection-start-column="70" selection-end-line="3" selection-end-column="70" />
<folding>
<element signature="e#0#36#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<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>
</provider>
</entry>
<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>
</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" />
<folding>
<element signature="e#0#52#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<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>
</provider>
</entry>
</component>
</project>

+ 3
- 4
APP/templates/forget.html View File

@ -12,7 +12,7 @@
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://127.0.0.1:5000/forget";
var url = "http://127.0.0.1:5000/bp_auth/forget";
$.ajax({
type: "POST",
url: url,
@ -24,9 +24,8 @@
},
success: function(data){
alert(data.msg);
if(data.code == 0){
var newurl = "http://127.0.0.1:5000/login";
window.location = newurl;
if(data.code == 1){
window.location = "login.html";
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {

+ 10
- 7
APP/templates/login.html View File

@ -34,7 +34,7 @@
function login(obj) {
var phonenum = $(obj).parent().prev().prev().children("#phonenum").val();
var password = $(obj).parent().prev().children("#password").val();
var url = "http://127.0.0.1:5000/login";
var url = "http://127.0.0.1:5000/bp_auth/login";
$.ajax({
type: "POST",
@ -45,15 +45,18 @@
},
success: function (data) {
cookie.setCookie('phonenum', phonenum, 30);
var newurl = "personal.html";
window.location = newurl;
alert(data.msg);
if(data.code != 1){
window.location = "login.html";
}else{
window.location = "personal.html";
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
window.location = url;
window.location = "login.html";
}
});
}
@ -80,8 +83,8 @@
</p>
</div>
<div class="reg-bar">
<a class="reg" href="http://127.0.0.1:5000/register">立即注册</a>
<a class="forget" href="http://127.0.0.1:5000/forget">忘记密码</a>
<a class="reg" href="register.html">立即注册</a>
<a class="forget" href="forget.html">忘记密码</a>
</div>
</div>
</body>

+ 3
- 4
APP/templates/register.html View File

@ -12,7 +12,7 @@
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://127.0.0.1:5000/register";
var url = "http://127.0.0.1:5000/bp_auth/register";
$.ajax({
type: "POST",
url: url,
@ -24,9 +24,8 @@
},
success: function(data){
alert(data.msg);
if(data.code == 0){
var newurl = "http://127.0.0.1:5000/login";
window.location = newurl;
if(data.code == 1){
window.location = "login.html";
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {

+ 9
- 0
APP/url crawler.py View File

@ -0,0 +1,9 @@
import requests
from bs4 import BeautifulSoup
url = "https://www.baidu.com"
html = requests.get(url)
html.encoding = 'utf-8'
soup = BeautifulSoup(html.text, "html.parser")
title = soup.find('title').text
# print(title)

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


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


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


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


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


+ 6
- 8
APP/view/auth.py View File

@ -8,9 +8,8 @@ bp_auth = Blueprint("bp_auth", __name__,url_prefix="/bp_auth")
@bp_auth.route('/login', methods=['POST', 'GET'])
def login():
if request.method == 'POST':
datas = json.loads(request.get_data())
phonenum = datas['phonenum']
password = datas['password']
phonenum = request.form['phonenum']
password = request.form['password']
name = ''
msg = ''
@ -82,11 +81,10 @@ def register():
@bp_auth.route('/forget', methods=['POST', 'GET'])
def forget():
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']
name = request.form['name']
password = request.form['password']
password1 = request.form['password1']
msg = ''
userlist = db_session.query(Users)

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

@ -1,7 +1,7 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('mysql+pymysql://root:WAMM0609dd@localhost:3306/cp', convert_unicode=True)
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,
bind=engine))

Loading…
Cancel
Save