diff --git a/.gitignore b/.gitignore index a89ad7f..61d3ec8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ $* *.db venv/ __pycache__/ -.vscode/ \ No newline at end of file +.vscode/ +file_storage/ \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py index e45354b..469ce61 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -13,8 +13,10 @@ def create_app(test_config=None): DATABASE_USER='root', DATABASE_HOST='localhost', DATABASE_PASS='lil0,.lil0', + UPLOADDIR=os.path.join("./file_storage"), ) - + if not os.path.exists(app.config['UPLOADDIR']): + os.mkdir(app.config['UPLOADDIR']) if test_config is None: app.config.from_pyfile('config.py', silent=True) else: diff --git a/src/templates/user/book.html b/src/templates/user/book.html index 0cd3564..1f20b9b 100644 --- a/src/templates/user/book.html +++ b/src/templates/user/book.html @@ -1,102 +1,123 @@ {% extends 'base.html' %} {% block header %} - + {% endblock %} {% block content %} -
-
-
- -
-
-
-
{{book['book_name']}}
- {%if booktype|length > 0 %} -
- 分类标签: - {% for atype in booktype %} - {{atype['type_name']}} - {% endfor %} -
- {%endif%} - {%if book['book_author']%} -
- 作者:{{book['book_author']}} -
- {% endif %} - {%if book['book_publisher']%} -
- 出版社:{{book['book_publisher']}} -
- {% endif %} - {%if book['book_isbn']%} -
- ISBN:{{book['book_isbn']}} -
- {% endif %} - {%if book['book_lang']%} -
- 语言:{{book['book_lang']}} -
- {% endif %} -
+
+
+
+ +
+
+
+
{{book['book_name']}}
+ {%if booktype|length > 0 %} +
+ 分类标签: + {% for atype in booktype %} + {{atype['type_name']}} + {% endfor %} +
+ {%endif%} + {%if book['book_author']%} +
+ 作者:{{book['book_author']}} +
+ {% endif %} + {%if book['book_publisher']%} +
+ 出版社:{{book['book_publisher']}} +
+ {% endif %} + {%if book['book_isbn']%} +
+ ISBN:{{book['book_isbn']}} +
+ {% endif %} + {%if book['book_lang']%} +
+ 语言:{{book['book_lang']}} +
+ {% endif %} +
+ +
+
+
+ + +
+
+
+
-
-
-
-
文档1
-
- 大小: - 日期: -
- - -
+
+
+
+ + {% for document in documents %} +
+
+
{{document['doc_name']}}
+
+ 大小 {{document['doc_size']}} KB + 日期{{document['doc_date']}} +
-
-
- +
+ {% endfor %} +
+
+
+ space
- +
+
+
{% endblock %} \ No newline at end of file diff --git a/src/templates/user/result.html b/src/templates/user/result.html index d6970eb..402176d 100644 --- a/src/templates/user/result.html +++ b/src/templates/user/result.html @@ -45,7 +45,11 @@

{{opresult}}

+ {% if ret_url %} +

返回

+ {% else %}

返回

+ {% endif %}