diff --git a/README.md b/README.md index 07233f74d69c959a67876c5c49726177cf3097f0..590bcdff799abc6fe3b619161af560ece70516cf 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,12 @@ Pear Admin Flask git clone https://gitee.com/pear-admin/pear-admin-flask # 安 装 +# 配置虚拟环境 +python -m venv venv +# 激活虚拟环境 +venv\Scripts\activate +# PyCharm 打开Setting,选中 Python Interpreter,Add,选择Existing environment Apply +# 安装库 pip install -r requirements.txt ``` diff --git a/applications/config.py b/applications/config.py index ed79ce14a028a78d00e2a4ef98a9561c41eebd8c..e867fc9dc94419b2850ffc648211f395d1768b7d 100644 --- a/applications/config.py +++ b/applications/config.py @@ -35,15 +35,15 @@ class BaseConfig: SECRET_KEY = "pear-system-flask" # mysql 配置 - # MYSQL_USERNAME = "root" - # MYSQL_PASSWORD = "123456" - # MYSQL_HOST = "127.0.0.1" - # MYSQL_PORT = 3306 - # MYSQL_DATABASE = "PearAdminFlask" + MYSQL_USERNAME = "root" + MYSQL_PASSWORD = "123456" + MYSQL_HOST = "127.0.0.1" + MYSQL_PORT = 3306 + MYSQL_DATABASE = "PearAdminFlask" # 数据库的配置信息 - SQLALCHEMY_DATABASE_URI = 'sqlite:///../pear.db' - # SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{urlquote(MYSQL_PASSWORD)}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}?charset=utf8mb4" + # SQLALCHEMY_DATABASE_URI = 'sqlite:///../pear.db' + SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}?charset=utf8mb4" # 默认日志等级 LOG_LEVEL = logging.WARN diff --git a/static/system/component/pear/pear.js b/static/system/component/pear/pear.js index 236631cef6ada7a6d0c3695f1e1a521362d6b9ad..806554ade2648120be6b399d8a3979c52e83f5cd 100644 --- a/static/system/component/pear/pear.js +++ b/static/system/component/pear/pear.js @@ -48,4 +48,13 @@ layui.config({ popover:"popover/popover" //汽泡组件 }).use(['layer', 'theme'], function () { layui.theme.changeTheme(window, false); -}); \ No newline at end of file +}); + +// 调整时间偏移量 +const toLocalTime = function (date) { + const now = new Date(date) + // 获取浏览器的时区偏移量(以分钟为单位) + const timezoneOffset = now.getTimezoneOffset(); + // 根据时区偏移量调整时间 + return now.setMinutes(now.getMinutes() + timezoneOffset); +} \ No newline at end of file diff --git a/templates/system/mail/main.html b/templates/system/mail/main.html index 2039983bec5cf4e96765b5a332b39f4dc8793761..8f510822eb1212b49389278194e3adaf3f9792c8 100644 --- a/templates/system/mail/main.html +++ b/templates/system/mail/main.html @@ -78,7 +78,7 @@ {# 用户注册时间 #} {% include 'system/common/footer.html' %} diff --git a/templates/system/user/main.html b/templates/system/user/main.html index 6e976d5e56197c4392298c16e4205df15d53040b..712dd20017b5d03a8d25326bcd64f32d437e276e 100644 --- a/templates/system/user/main.html +++ b/templates/system/user/main.html @@ -86,11 +86,11 @@ {% endraw %}