mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
modified 修复缓存处理方式
This commit is contained in:
parent
0bc5b202f6
commit
ef53faeaf5
@ -30,9 +30,9 @@ class ApiManageController extends BaseController {
|
||||
$data = I('post.');
|
||||
$res = D('ApiList')->where(array('id' => $data['id']))->save($data);
|
||||
if( $res === false ) {
|
||||
S('ApiInfo_' . $data['hash'], 0);
|
||||
$this->ajaxError('操作失败');
|
||||
} else {
|
||||
S('ApiInfo_' . $data['hash'], null);
|
||||
$this->ajaxSuccess('添加成功');
|
||||
}
|
||||
}
|
||||
@ -59,7 +59,7 @@ class ApiManageController extends BaseController {
|
||||
$id = I('post.id');
|
||||
if( $id ) {
|
||||
$hash = D('ApiList')->where(array('id' => $id))->getField('hash');
|
||||
S('ApiInfo_' . $hash, 0);
|
||||
S('ApiInfo_' . $hash, null);
|
||||
D('ApiList')->open(array('id' => $id));
|
||||
$this->ajaxSuccess('操作成功');
|
||||
} else {
|
||||
@ -73,7 +73,7 @@ class ApiManageController extends BaseController {
|
||||
$id = I('post.id');
|
||||
if( $id ) {
|
||||
$hash = D('ApiList')->where(array('id' => $id))->getField('hash');
|
||||
S('ApiInfo_' . $hash, 0);
|
||||
S('ApiInfo_' . $hash, null);
|
||||
D('ApiList')->close(array('id' => $id));
|
||||
$this->ajaxSuccess('操作成功');
|
||||
} else {
|
||||
@ -87,7 +87,7 @@ class ApiManageController extends BaseController {
|
||||
$id = I('post.id');
|
||||
if( $id ) {
|
||||
$hash = D('ApiList')->where(array('id' => $id))->getField('hash');
|
||||
S('ApiInfo_' . $hash, 0);
|
||||
S('ApiInfo_' . $hash, null);
|
||||
D('ApiList')->del(array('id' => $id));
|
||||
$this->ajaxSuccess('操作成功');
|
||||
} else {
|
||||
|
@ -78,9 +78,9 @@ class FieldsManageController extends BaseController {
|
||||
$this->ajaxError('操作失败');
|
||||
} else {
|
||||
if ($data['type'] == 0) {
|
||||
S('ApiRequest_' . $data['hash'], 0);
|
||||
S('ApiRequest_' . $data['hash'], null);
|
||||
} else {
|
||||
S('ApiResponse_' . $data['hash'], 0);
|
||||
S('ApiResponse_' . $data['hash'], null);
|
||||
}
|
||||
$this->ajaxSuccess('添加成功');
|
||||
}
|
||||
@ -101,9 +101,9 @@ class FieldsManageController extends BaseController {
|
||||
if ($id) {
|
||||
$detail = D('ApiFields')->where(array('id' => $id))->find();
|
||||
if ($detail['type'] == 0) {
|
||||
S('ApiRequest_' . $detail['hash'], 0);
|
||||
S('ApiRequest_' . $detail['hash'], null);
|
||||
} else {
|
||||
S('ApiResponse_' . $detail['hash'], 0);
|
||||
S('ApiResponse_' . $detail['hash'], null);
|
||||
}
|
||||
D('ApiFields')->where(array('id' => $id))->delete();
|
||||
$this->ajaxSuccess('操作成功');
|
||||
@ -143,11 +143,11 @@ class FieldsManageController extends BaseController {
|
||||
D('ApiFields')->addAll($addData);
|
||||
}
|
||||
if ($type == 0) {
|
||||
S('ApiRequest_' . $hash, 0);
|
||||
S('ApiRequest_' . $hash, null);
|
||||
} else {
|
||||
S('ApiResponse_' . $hash, 0);
|
||||
S('ApiResponse_' . $hash, null);
|
||||
}
|
||||
S('ApiReturnType_' . $hash, 0);
|
||||
S('ApiReturnType_' . $hash, null);
|
||||
$this->ajaxSuccess('操作成功');
|
||||
} else {
|
||||
$this->display();
|
||||
|
Loading…
x
Reference in New Issue
Block a user