modified 修复缓存处理方式

This commit is contained in:
zhaoxiang 2017-05-18 10:35:42 +08:00
parent 0bc5b202f6
commit ef53faeaf5
2 changed files with 11 additions and 11 deletions

View File

@ -30,9 +30,9 @@ class ApiManageController extends BaseController {
$data = I('post.'); $data = I('post.');
$res = D('ApiList')->where(array('id' => $data['id']))->save($data); $res = D('ApiList')->where(array('id' => $data['id']))->save($data);
if( $res === false ) { if( $res === false ) {
S('ApiInfo_' . $data['hash'], 0);
$this->ajaxError('操作失败'); $this->ajaxError('操作失败');
} else { } else {
S('ApiInfo_' . $data['hash'], null);
$this->ajaxSuccess('添加成功'); $this->ajaxSuccess('添加成功');
} }
} }
@ -59,7 +59,7 @@ class ApiManageController extends BaseController {
$id = I('post.id'); $id = I('post.id');
if( $id ) { if( $id ) {
$hash = D('ApiList')->where(array('id' => $id))->getField('hash'); $hash = D('ApiList')->where(array('id' => $id))->getField('hash');
S('ApiInfo_' . $hash, 0); S('ApiInfo_' . $hash, null);
D('ApiList')->open(array('id' => $id)); D('ApiList')->open(array('id' => $id));
$this->ajaxSuccess('操作成功'); $this->ajaxSuccess('操作成功');
} else { } else {
@ -73,7 +73,7 @@ class ApiManageController extends BaseController {
$id = I('post.id'); $id = I('post.id');
if( $id ) { if( $id ) {
$hash = D('ApiList')->where(array('id' => $id))->getField('hash'); $hash = D('ApiList')->where(array('id' => $id))->getField('hash');
S('ApiInfo_' . $hash, 0); S('ApiInfo_' . $hash, null);
D('ApiList')->close(array('id' => $id)); D('ApiList')->close(array('id' => $id));
$this->ajaxSuccess('操作成功'); $this->ajaxSuccess('操作成功');
} else { } else {
@ -87,7 +87,7 @@ class ApiManageController extends BaseController {
$id = I('post.id'); $id = I('post.id');
if( $id ) { if( $id ) {
$hash = D('ApiList')->where(array('id' => $id))->getField('hash'); $hash = D('ApiList')->where(array('id' => $id))->getField('hash');
S('ApiInfo_' . $hash, 0); S('ApiInfo_' . $hash, null);
D('ApiList')->del(array('id' => $id)); D('ApiList')->del(array('id' => $id));
$this->ajaxSuccess('操作成功'); $this->ajaxSuccess('操作成功');
} else { } else {

View File

@ -78,9 +78,9 @@ class FieldsManageController extends BaseController {
$this->ajaxError('操作失败'); $this->ajaxError('操作失败');
} else { } else {
if ($data['type'] == 0) { if ($data['type'] == 0) {
S('ApiRequest_' . $data['hash'], 0); S('ApiRequest_' . $data['hash'], null);
} else { } else {
S('ApiResponse_' . $data['hash'], 0); S('ApiResponse_' . $data['hash'], null);
} }
$this->ajaxSuccess('添加成功'); $this->ajaxSuccess('添加成功');
} }
@ -101,9 +101,9 @@ class FieldsManageController extends BaseController {
if ($id) { if ($id) {
$detail = D('ApiFields')->where(array('id' => $id))->find(); $detail = D('ApiFields')->where(array('id' => $id))->find();
if ($detail['type'] == 0) { if ($detail['type'] == 0) {
S('ApiRequest_' . $detail['hash'], 0); S('ApiRequest_' . $detail['hash'], null);
} else { } else {
S('ApiResponse_' . $detail['hash'], 0); S('ApiResponse_' . $detail['hash'], null);
} }
D('ApiFields')->where(array('id' => $id))->delete(); D('ApiFields')->where(array('id' => $id))->delete();
$this->ajaxSuccess('操作成功'); $this->ajaxSuccess('操作成功');
@ -143,11 +143,11 @@ class FieldsManageController extends BaseController {
D('ApiFields')->addAll($addData); D('ApiFields')->addAll($addData);
} }
if ($type == 0) { if ($type == 0) {
S('ApiRequest_' . $hash, 0); S('ApiRequest_' . $hash, null);
} else { } else {
S('ApiResponse_' . $hash, 0); S('ApiResponse_' . $hash, null);
} }
S('ApiReturnType_' . $hash, 0); S('ApiReturnType_' . $hash, null);
$this->ajaxSuccess('操作成功'); $this->ajaxSuccess('操作成功');
} else { } else {
$this->display(); $this->display();