提交增加重复检测调试

master
zhaocheng 2 years ago
parent 541d17e062
commit d7f3bb9cab
  1. 12
      app/controller/Task.php

@ -108,12 +108,6 @@ class Task extends BaseController
public function save() public function save()
{ {
$params = $this->request->param(); $params = $this->request->param();
$cache_name = md5($params);
if (Cache::get($cache_name)) {
$this->json_data['code'] = 0;
$this->json_data['msg'] = '表单已提交,请勿重复操作';
return json($this->json_data);
}
Cache::set($cache_name, 1, 60); Cache::set($cache_name, 1, 60);
$type = $this->request->param('task_type', '0'); $type = $this->request->param('task_type', '0');
$original_filename = $this->request->param('original_filename'); $original_filename = $this->request->param('original_filename');
@ -282,6 +276,12 @@ class Task extends BaseController
return json($this->json_data); return json($this->json_data);
} }
} }
$cache_name = md5($params);
if (Cache::get($cache_name)) {
$this->json_data['code'] = 0;
$this->json_data['msg'] = '表单已提交,请勿重复操作';
return json($this->json_data);
}
$action = [ $action = [
'1'=>'import', '1'=>'import',
'2'=>'export', '2'=>'export',

Loading…
Cancel
Save