Merge remote-tracking branch 'origin/develop' into akun
正在显示
5 个修改的文件
包含
14 行增加
和
13 行删除
| @@ -34,13 +34,14 @@ class BTemplateLogController extends BaseController | @@ -34,13 +34,14 @@ class BTemplateLogController extends BaseController | ||
| 34 | */ | 34 | */ |
| 35 | public function lists(BTemplateLog $bTemplateLog){ | 35 | public function lists(BTemplateLog $bTemplateLog){ |
| 36 | $this->map['project_id'] = $this->user['project_id']; | 36 | $this->map['project_id'] = $this->user['project_id']; |
| 37 | + $this->map['source'] = 1; | ||
| 37 | $lists = $bTemplateLog->lists($this->map,$this->page,$this->row,$this->order,['id','template_id','operator_id','source','created_at','updated_at']); | 38 | $lists = $bTemplateLog->lists($this->map,$this->page,$this->row,$this->order,['id','template_id','operator_id','source','created_at','updated_at']); |
| 38 | if(!empty($lists['list'])){ | 39 | if(!empty($lists['list'])){ |
| 39 | $templateModel = new Template(); | 40 | $templateModel = new Template(); |
| 40 | $userModel = new User(); | 41 | $userModel = new User(); |
| 41 | foreach ($lists['list'] as $k => $v){ | 42 | foreach ($lists['list'] as $k => $v){ |
| 42 | $v['template_name'] = $templateModel->read(['id'=>$v['template_id']],['name'])['name']; | 43 | $v['template_name'] = $templateModel->read(['id'=>$v['template_id']],['name'])['name']; |
| 43 | - $v['operator_name'] = $userModel->read(['id'=>$v['operator_id']],['name'])['name']; | 44 | + $v['operator_name'] = $userModel->getName($v['operator_id']); |
| 44 | $lists['list'][$k] = $v; | 45 | $lists['list'][$k] = $v; |
| 45 | } | 46 | } |
| 46 | } | 47 | } |
| @@ -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 | //验证验证码 |
| @@ -56,13 +53,10 @@ class LoginLogic extends BaseLogic | @@ -56,13 +53,10 @@ class LoginLogic extends BaseLogic | ||
| 56 | $type = 2;//验证码登录 | 53 | $type = 2;//验证码登录 |
| 57 | } | 54 | } |
| 58 | if(!empty($manage['token'])){ | 55 | if(!empty($manage['token'])){ |
| 59 | - //清除上一次用户缓存 | ||
| 60 | Cache::pull(Common::MANAGE_TOKEN . $manage['token']); | 56 | Cache::pull(Common::MANAGE_TOKEN . $manage['token']); |
| 61 | } | 57 | } |
| 62 | //生成新token | 58 | //生成新token |
| 63 | $token = md5(uniqid().$manage['id']); | 59 | $token = md5(uniqid().$manage['id']); |
| 64 | - //存储缓存 | ||
| 65 | - $manage['token'] = $token; | ||
| 66 | unset($manage['password']); | 60 | unset($manage['password']); |
| 67 | Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6); | 61 | Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6); |
| 68 | //更新用户信息 | 62 | //更新用户信息 |
| @@ -85,7 +79,7 @@ class LoginLogic extends BaseLogic | @@ -85,7 +79,7 @@ class LoginLogic extends BaseLogic | ||
| 85 | * @time :2023/9/7 16:30 | 79 | * @time :2023/9/7 16:30 |
| 86 | */ | 80 | */ |
| 87 | public function logout(){ | 81 | public function logout(){ |
| 88 | - Cache::pull(request()->header('token')); | 82 | + Cache::pull($this->request->header('token')); |
| 89 | return $this->success(); | 83 | return $this->success(); |
| 90 | } | 84 | } |
| 91 | 85 |
| @@ -18,7 +18,7 @@ class DomainInfoLogic extends BaseLogic | @@ -18,7 +18,7 @@ class DomainInfoLogic extends BaseLogic | ||
| 18 | 18 | ||
| 19 | public function getDomainInfo($project_id) | 19 | public function getDomainInfo($project_id) |
| 20 | { | 20 | { |
| 21 | - $project = app(ProjectLogic::class)->getInfo($project_id); | 21 | + $project = (new ProjectLogic())->getProjectInfo($project_id); |
| 22 | $domain = (!empty($project['deploy_optimize']['domain']) ? ((new \App\Models\Domain\DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ''); | 22 | $domain = (!empty($project['deploy_optimize']['domain']) ? ((new \App\Models\Domain\DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ''); |
| 23 | $info = $this->model->where('project_id', $project_id)->first(); | 23 | $info = $this->model->where('project_id', $project_id)->first(); |
| 24 | //不存在或时间过期了 重新获取信息 | 24 | //不存在或时间过期了 重新获取信息 |
| @@ -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 |
| @@ -143,9 +143,9 @@ class RankDataLogic extends BaseLogic | @@ -143,9 +143,9 @@ class RankDataLogic extends BaseLogic | ||
| 143 | $page = intval($this->request['page'] ?: 1); | 143 | $page = intval($this->request['page'] ?: 1); |
| 144 | $lang = $this->request['lang'] ?: ''; | 144 | $lang = $this->request['lang'] ?: ''; |
| 145 | $project_id = $this->user['project_id']; | 145 | $project_id = $this->user['project_id']; |
| 146 | - $project = app(ProjectLogic::class)->getInfo($project_id); | 146 | + $project = (new ProjectLogic())->getProjectInfo($project_id); |
| 147 | $api_no = $project['deploy_optimize']['api_no'] ?? ''; | 147 | $api_no = $project['deploy_optimize']['api_no'] ?? ''; |
| 148 | - $domain = (!empty($project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ''); | 148 | + $domain = $this->user['domain']; |
| 149 | $domain_arr = parse_url($domain); | 149 | $domain_arr = parse_url($domain); |
| 150 | $domain = $domain_arr['host'] ?? $domain_arr['path']; | 150 | $domain = $domain_arr['host'] ?? $domain_arr['path']; |
| 151 | //复制站点域名 | 151 | //复制站点域名 |
-
请 注册 或 登录 后发表评论