21 lines
428 B
Python
21 lines
428 B
Python
import os
|
|
from fastapi import APIRouter
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
# 获取标准原尺寸图
|
|
@router.get("", summary="webhook", description="自动更新")
|
|
def webhook():
|
|
print("webhook")
|
|
|
|
# 执行 Bash 命令
|
|
exit_code = os.system('git pull')
|
|
print('Exit code:', exit_code)
|
|
|
|
exit_code = os.system('npm restart reverse-5002')
|
|
print('Exit code:', exit_code)
|
|
|
|
return {"code": 200, "msg": "success"}
|