-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
资产登记功能:支持添加新的固定资产信息,包括资产编号、名称、规格、采购日期、采购价格。
- Loading branch information
1 parent
63a1540
commit 062c0b6
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
import os | ||
from app.routes import add_asset | ||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
|
||
app.add_url_rule('/api/assets', view_func=add_asset, methods=['POST']) | ||
|
||
if __name__ == '__main__': | ||
try: | ||
# Check if build.sh script exists | ||
if os.path.exists('./build.sh'): | ||
# Execute build.sh script | ||
os.system('./build.sh') | ||
else: | ||
raise FileNotFoundError("build.sh script not found") | ||
|
||
# Start the Flask application | ||
app.run() | ||
except Exception as e: | ||
print(f"An error occurred: {str(e)}") |