修复 bytesio 导致uwsgi 不识别问题

dependabot/npm_and_yarn/fir_admin/async-2.6.4
nineven 3 years ago
parent 5ca5b0eb34
commit 0a64689902
  1. 10
      fir_client/src/restful/download.js
  2. 14
      fir_client/src/restful/index.js
  3. 5
      fir_ser/xsign/utils/supersignutils.py

@ -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);
});
}

@ -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);
});
}
}

@ -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')}")

Loading…
Cancel
Save