作者 lyh

gx

... ... @@ -39,7 +39,7 @@ class BaseController extends Controller
$info = Cache::get(Common::MANAGE_TOKEN . $this->token);
if(!empty($this->token) && !empty($info)){
$this->manage = $info;
Cache::put($this->token, $info, 3600);//更新缓存时间
Cache::put($this->token, $info, 3600 * 6);//更新缓存时间
$this->uid = $info['id'];
}
}
... ...
... ... @@ -54,7 +54,7 @@ class LoginLogic extends BaseLogic
$token = md5(uniqid().$manage['id']);
//存储缓存
$manage['token'] = $token;
Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600);
Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6);
//更新用户信息
$manage->token = $token;
$res = $manage->save();
... ...
... ... @@ -48,8 +48,8 @@ class KeywordLogic extends BaseLogic
* @time :2023/8/23 16:50
*/
public function keywordSave(){
DB::beginTransaction();
try {
// DB::beginTransaction();
// try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $this->param['id'], $this->user['project_id']);
$id = $this->editCategoryRoute($this->param['id'],$route);
... ... @@ -63,11 +63,11 @@ class KeywordLogic extends BaseLogic
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
}
$this->model->edit(['route'=>$route],['id'=>$id]);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('保存失败');
}
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('保存失败');
// }
//通知更新
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT_KEYWORD, 'route'=>$route]);
return $this->success();
... ...