fix(server): 修正/api/app/version的project_root路径计算
This commit is contained in:
parent
cc22541560
commit
426825d475
@ -41,7 +41,7 @@ import server.state as state
|
||||
@status_bp.route('/api/app/version')
|
||||
@api_login_required
|
||||
def get_app_version_info():
|
||||
project_root = Path(__file__).resolve().parent.parent
|
||||
project_root = Path(__file__).resolve().parent.parent.parent
|
||||
version_code, version_name = _parse_android_version_from_gradle(project_root)
|
||||
apk_path = _resolve_android_apk_path(project_root)
|
||||
apk_exists = apk_path.exists()
|
||||
@ -73,7 +73,7 @@ def get_app_version_info():
|
||||
|
||||
@status_bp.route('/api/app/apk/latest')
|
||||
def download_latest_apk():
|
||||
project_root = Path(__file__).resolve().parent.parent
|
||||
project_root = Path(__file__).resolve().parent.parent.parent
|
||||
apk_path = _resolve_android_apk_path(project_root)
|
||||
if not apk_path.exists():
|
||||
return jsonify({"success": False, "error": "APK 不存在,请先构建 release 包"}), 404
|
||||
|
||||
Loading…
Reference in New Issue
Block a user