From 1800da69b2bd3b0413cfb0592ca6cd3067353692 Mon Sep 17 00:00:00 2001 From: Ricardo2001zg Date: Fri, 23 Sep 2022 22:02:23 +0800 Subject: [PATCH 1/2] Updated: Project config Desc: update project config Author: Ricardo2001zg --- SourceCode/HaoGeProject/index.html | 27 +++++++++++++++++++++++++++ SourceCode/flaskProject/.idea/vcs.xml | 6 ++++++ 2 files changed, 33 insertions(+) create mode 100644 SourceCode/HaoGeProject/index.html create mode 100644 SourceCode/flaskProject/.idea/vcs.xml diff --git a/SourceCode/HaoGeProject/index.html b/SourceCode/HaoGeProject/index.html new file mode 100644 index 0000000..1146572 --- /dev/null +++ b/SourceCode/HaoGeProject/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + Document + + +
{{ message }}
+ + + diff --git a/SourceCode/flaskProject/.idea/vcs.xml b/SourceCode/flaskProject/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/SourceCode/flaskProject/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file -- Gitee From ba549f350c9222fba3e5613fbaf4c5ad598ef0b0 Mon Sep 17 00:00:00 2001 From: Ricardo2001zg Date: Fri, 23 Sep 2022 23:08:23 +0800 Subject: [PATCH 2/2] Published: Vue with localtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Desc: 完成了前后端通过json交换数据的demo Author: Ricardo2001zg Version: 0.2.0 --- README.md | 2 +- SourceCode/HaoGeProject/index.html | 19 +++++++++++++++---- SourceCode/flaskProject/collect_url.py | 8 ++++++-- SourceCode/flaskProject/serverStart.bat | 1 + 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 SourceCode/flaskProject/serverStart.bat diff --git a/README.md b/README.md index 340129f..6c6281c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ 基于语义化版本号控制。 -0.0.1 +0.2.0 #### 软件架构 diff --git a/SourceCode/HaoGeProject/index.html b/SourceCode/HaoGeProject/index.html index 1146572..58d07cf 100644 --- a/SourceCode/HaoGeProject/index.html +++ b/SourceCode/HaoGeProject/index.html @@ -9,17 +9,28 @@ + + Document -
{{ message }}
+
{{ info }}
diff --git a/SourceCode/flaskProject/collect_url.py b/SourceCode/flaskProject/collect_url.py index fe6bb90..f29d14a 100644 --- a/SourceCode/flaskProject/collect_url.py +++ b/SourceCode/flaskProject/collect_url.py @@ -1,5 +1,7 @@ -from flask import Flask, redirect, url_for, request, render_template +from flask import Flask, redirect, url_for, request, render_template, jsonify +from flask_cors import CORS, cross_origin import time +import json collecter = Flask(__name__) @@ -15,8 +17,10 @@ def success(name): @collecter.route('/time') +@cross_origin() def re_time(): - return str(time.asctime(time.localtime(time.time()))) + _response = jsonify({"time": str(time.asctime(time.localtime(time.time())))}) + return _response @collecter.route('/login', methods=['post', 'GET']) diff --git a/SourceCode/flaskProject/serverStart.bat b/SourceCode/flaskProject/serverStart.bat new file mode 100644 index 0000000..5182b9b --- /dev/null +++ b/SourceCode/flaskProject/serverStart.bat @@ -0,0 +1 @@ +python collect_url.py -- Gitee