作者 lyh

gx

@@ -46,9 +46,6 @@ class LoginLogic extends BaseLogic @@ -46,9 +46,6 @@ class LoginLogic extends BaseLogic
46 if (Manage::STATUS_DISABLE == $manage->status) { 46 if (Manage::STATUS_DISABLE == $manage->status) {
47 $this->fail('帐号已被禁用'); 47 $this->fail('帐号已被禁用');
48 } 48 }
49 -// if($this->param['password'] == '123456'){  
50 -// $this->fail('请使用短信登录,修改初始密码');  
51 -// }  
52 $type = 1;//账号密码登录 49 $type = 1;//账号密码登录
53 if (!Hash::check($this->param['password'], $manage->password)) { 50 if (!Hash::check($this->param['password'], $manage->password)) {
54 //验证验证码 51 //验证验证码
@@ -61,8 +58,6 @@ class LoginLogic extends BaseLogic @@ -61,8 +58,6 @@ class LoginLogic extends BaseLogic
61 } 58 }
62 //生成新token 59 //生成新token
63 $token = md5(uniqid().$manage['id']); 60 $token = md5(uniqid().$manage['id']);
64 - //存储缓存  
65 - $manage['token'] = $token;  
66 unset($manage['password']); 61 unset($manage['password']);
67 Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6); 62 Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6);
68 //更新用户信息 63 //更新用户信息
@@ -13,6 +13,7 @@ use App\Models\Template\BSetting; @@ -13,6 +13,7 @@ use App\Models\Template\BSetting;
13 use App\Models\Template\BTemplate; 13 use App\Models\Template\BTemplate;
14 use App\Models\Template\BTemplateLog; 14 use App\Models\Template\BTemplateLog;
15 use App\Models\Template\Template; 15 use App\Models\Template\Template;
  16 +use Illuminate\Support\Facades\Cache;
16 use Illuminate\Support\Facades\DB; 17 use Illuminate\Support\Facades\DB;
17 use mysql_xdevapi\Exception; 18 use mysql_xdevapi\Exception;
18 19
@@ -56,15 +57,20 @@ class BTemplateLogic extends BaseLogic @@ -56,15 +57,20 @@ class BTemplateLogic extends BaseLogic
56 public function getTemplate(){ 57 public function getTemplate(){
57 $bSettingModel = new BSetting(); 58 $bSettingModel = new BSetting();
58 $info = $bSettingModel->read(['project_id'=>$this->user['project_id']]); 59 $info = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
  60 + if($info === false){
  61 + $this->fail('请先选择模版');
  62 + }
59 $TemplateInfo = []; 63 $TemplateInfo = [];
60 - if($info !== false){ 64 + $key = 'template_'.$this->user['project_id'].'_'.$this->param['source'].'_'.$this->param['source_id'];
  65 + if(!empty(Cache::add($key))){
  66 + $this->fail('当前页面正在装修中');
  67 + }
61 if($this->param['source'] == $this->model::SOURCE_HOME){//首页 68 if($this->param['source'] == $this->model::SOURCE_HOME){//首页
62 $TemplateInfo = $this->homeHtml($info,$this->param['source'],$this->param['source_id']); 69 $TemplateInfo = $this->homeHtml($info,$this->param['source'],$this->param['source_id']);
63 } 70 }
64 if($this->param['source'] == $this->model::SOURCE_PRODUCT){//产品页 71 if($this->param['source'] == $this->model::SOURCE_PRODUCT){//产品页
65 $TemplateInfo = $this->productHtml($info,$this->param['source'],$this->param['source_id']); 72 $TemplateInfo = $this->productHtml($info,$this->param['source'],$this->param['source_id']);
66 } 73 }
67 - }  
68 return $this->success($TemplateInfo); 74 return $this->success($TemplateInfo);
69 } 75 }
70 76