diff --git a/fir_client/src/restful/download.js b/fir_client/src/restful/download.js index b9d5fa6..ce81e03 100644 --- a/fir_client/src/restful/download.js +++ b/fir_client/src/restful/download.js @@ -7,7 +7,7 @@ const DOMAIN = process.env.base_env.baseShortUrl; const APIPATH = '/api/v1/fir/server'; let USERSEVER = DOMAIN + APIPATH; -function ErrorMsg(error,callBack) { +function ErrorMsg(error, callBack) { if (error && error.response) { switch (error.response.status) { case 400: @@ -28,7 +28,7 @@ function ErrorMsg(error,callBack) { } else { error.message = '连接服务器失败!'; } - callBack({code:-1,msg:error.message}) + callBack({code: -1, msg: error.message}) } function responseMiddleware(data, callBack) { @@ -48,7 +48,7 @@ function getData(methods = 'GET', url, params = {}, callBack) { responseMiddleware(response.data, callBack); }) .catch(function (error) { - ErrorMsg(error,callBack); + ErrorMsg(error, callBack); }); } else if (methods === 'POST') { Axios @@ -57,7 +57,7 @@ function getData(methods = 'GET', url, params = {}, callBack) { responseMiddleware(response.data, callBack); }) .catch(function (error) { - ErrorMsg(error,callBack); + ErrorMsg(error, callBack); }); } else Axios @@ -66,7 +66,7 @@ function getData(methods = 'GET', url, params = {}, callBack) { responseMiddleware(response.data, callBack); }) .catch(function (error) { - ErrorMsg(error,callBack); + ErrorMsg(error, callBack); }); } diff --git a/fir_client/src/restful/index.js b/fir_client/src/restful/index.js index e8d6fb1..63a5719 100644 --- a/fir_client/src/restful/index.js +++ b/fir_client/src/restful/index.js @@ -79,7 +79,7 @@ export function set_auth_token() { set_auth_token(); -function ErrorMsg(error,callBack) { +function ErrorMsg(error, callBack) { if (error && error.response) { switch (error.response.status) { case 400: @@ -127,7 +127,7 @@ function ErrorMsg(error,callBack) { if (error.response && error.response.status === 403) { router.push({name: 'FirLogin'}); } - callBack({code:-1, msg:error.message}) + callBack({code: -1, msg: error.message}) } function responseMiddleware(data, callBack) { @@ -147,7 +147,7 @@ function getData(methods, url, params = {}, callBack) { responseMiddleware(response.data, callBack); }) .catch(function (error) { - ErrorMsg(error,callBack); + ErrorMsg(error, callBack); }); } else if (methods === "PUT") { @@ -157,7 +157,7 @@ function getData(methods, url, params = {}, callBack) { responseMiddleware(response.data, callBack); }) .catch(function (error) { - ErrorMsg(error,callBack); + ErrorMsg(error, callBack); }); } else if (methods === 'POST') { @@ -167,7 +167,7 @@ function getData(methods, url, params = {}, callBack) { responseMiddleware(response.data, callBack); }) .catch(function (error) { - ErrorMsg(error,callBack); + ErrorMsg(error, callBack); }); } else if (methods === 'FILE') { Axios @@ -176,7 +176,7 @@ function getData(methods, url, params = {}, callBack) { convertRes2Blob(response) }) .catch(function (error) { - ErrorMsg(error,callBack); + ErrorMsg(error, callBack); }); } else { Axios @@ -185,7 +185,7 @@ function getData(methods, url, params = {}, callBack) { responseMiddleware(response.data, callBack); }) .catch(function (error) { - ErrorMsg(error,callBack); + ErrorMsg(error, callBack); }); } } diff --git a/fir_ser/xsign/utils/supersignutils.py b/fir_ser/xsign/utils/supersignutils.py index 98d921e..f2925cc 100644 --- a/fir_ser/xsign/utils/supersignutils.py +++ b/fir_ser/xsign/utils/supersignutils.py @@ -10,6 +10,7 @@ import time import uuid import zipfile from io import BytesIO +from wsgiref.util import FileWrapper import xmltodict from django.core.cache import cache @@ -166,8 +167,8 @@ def make_sign_udid_mobile_config(udid_url, bundle_id, app_name): status, result = ResignApp.sign_mobile_config(make_udid_mobile_config(udid_url, bundle_id, app_name), ssl_pem_path, ssl_key_path, ssl_pem_data, ssl_key_data) if status and result.get('data'): - buffer = BytesIO(result.get("data")) - return buffer + buffer = BytesIO(result.get("data")) # uwsgi 无法解析该类型,需求加上 FileWrapper 包装 + return FileWrapper(buffer) else: logger.error( f"{bundle_id} {app_name} sign_mobile_config failed ERROR:{result.get('err_info')}")