display error detial in version submit

This commit is contained in:
jack 2018-05-02 16:59:48 +08:00
parent 5ed06ccc78
commit c197c946a4
1 changed files with 12 additions and 1 deletions

View File

@ -68,6 +68,17 @@
<!-- //页面内容 -->
<script>
$('#wapper').width($('body').width()-300);
function errorContentHtml(err){
var html = "";
if(err && err.error)
html += "<h4>" + err.error + "</h4>";
if(err && err.detail)
html += "<p>" + err.detail + "</p>";
return html;
}
function action(ac,id){
$.ajax({
'type':"POST",
@ -77,7 +88,7 @@ function action(ac,id){
if (typeof(data)=='object')
{
if(typeof(data.error)!='undefined')
{$.colorbox({'innerWidth':'50%','html':data.error});}
{$.colorbox({'innerWidth':'50%','html': errorContentHtml(data)});}
if(typeof(data.deleted)!='undefined')
{$('#list_'+data.deleted).fadeOut("slow",function(){$(this).remove();});}
if(typeof(data.commited)!='undefined')