mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-03 04:19:37 +08:00
插件安装报错提示优化
This commit is contained in:
parent
77383a4c6c
commit
4c824e0543
@ -84,7 +84,26 @@ function RequestHandle(key, opt, msg)
|
||||
{
|
||||
$progress.addClass('am-hide');
|
||||
$error.removeClass('am-hide');
|
||||
$error.find('.msg-text').text(HtmlToString(xhr.responseText) || '异常错误');
|
||||
var data = null;
|
||||
if((xhr.responseJSON || null) != null && (xhr.responseJSON.msg || null) != null)
|
||||
{
|
||||
data = xhr.responseJSON;
|
||||
} else {
|
||||
if(xhr.responseText.substr(0, 1) == '{')
|
||||
{
|
||||
var json = JSON.parse(xhr.responseText);
|
||||
if((json.msg || null) != null)
|
||||
{
|
||||
data = json;
|
||||
} else {
|
||||
data = xhr.responseText;
|
||||
}
|
||||
} else {
|
||||
data = xhr.responseText;
|
||||
}
|
||||
}
|
||||
var msg = (typeof(data) == 'object') ? data.msg : data;
|
||||
$error.find('.msg-text').text(msg || '异常错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user