diff --git a/Application/Admin/Controller/ArticleController.class.php b/Application/Admin/Controller/ArticleController.class.php index db410f4bf..234d9497e 100644 --- a/Application/Admin/Controller/ArticleController.class.php +++ b/Application/Admin/Controller/ArticleController.class.php @@ -965,8 +965,12 @@ class ArticleController extends AdminController { $file_name = $savePath.$name; $error=$upfile["error"];//上传后系统返回的值 $data['document_route'] = 'Documents/'.$name; - M('document_pop_rules')->where(['id' => $id])->save($data); - $backData['tmp'] = $file_name; + $updateres = M('document_pop_rules')->where(['id' => $id])->save($data); + if ($updateres) { + $backData['code'] = 10000; + }else { + $backData['code'] = 10001; + } $this->ajaxReturn(json_encode($backData,TRUE)); } } diff --git a/Application/Admin/View/Article/pop_rule_edit.html b/Application/Admin/View/Article/pop_rule_edit.html index 77aeab21d..f7120294f 100644 --- a/Application/Admin/View/Article/pop_rule_edit.html +++ b/Application/Admin/View/Article/pop_rule_edit.html @@ -27,7 +27,8 @@ - + +
  • @@ -96,7 +97,15 @@ processData : false, // 使数据不做处理 contentType : false, // 不要设置Content-Type请求头 success:function(res) { - // console.log(res) + res = JSON.parse(res) + if (res.code == 10000) { + document.getElementById('uploadstatus').style.display = 'block' + document.getElementById('uploadstatus1').style.display = 'none' + }else { + document.getElementById('uploadstatus1').style.display = 'block' + document.getElementById('uploadstatus').style.display = 'none' + } + } }) }