diff --git a/application/config/config.yaml b/application/config/config.yaml index ff912a3090490c348257e3f4df4e2c0a423a5ffb..15ee82a84402061c6ffa04ae9bf15190e7879316 100644 --- a/application/config/config.yaml +++ b/application/config/config.yaml @@ -39,6 +39,6 @@ Redis: DB: 13 Scheduler: - Start: 2023-11-11 15:20:00 + Start: 2023-11-11 15:34:00 End: 2099-11-11 16:00:00 Timezone: Asia/Shanghai diff --git a/application/libs/tasks/task.py b/application/libs/tasks/task.py index 098507d43493f8d54f93129877ddedee86fd2339..beda166f6a9f88e303efead23a58b2b2be7adc2c 100644 --- a/application/libs/tasks/task.py +++ b/application/libs/tasks/task.py @@ -10,6 +10,9 @@ # @Description : """ +from application.extensions.init_sqlalchemy import db +from application.models import User + def task(): """ @@ -17,4 +20,9 @@ def task(): :return: None """ - print(1) + with db.app.app_context(): + print("create user") + user = User(username="CWZ", email="Stu@outlook.com", password="qwe!2345", active=True) + db.session.add(user) + db.session.commit() + print("created user admin")