作者 Your Name
@@ -59,8 +59,8 @@ class UpdateRoute extends Command @@ -59,8 +59,8 @@ class UpdateRoute extends Command
59 foreach ($list as $v){ 59 foreach ($list as $v){
60 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 60 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
61 ProjectServer::useProject($v['id']); 61 ProjectServer::useProject($v['id']);
62 - $this->getProduct();  
63 -// $this->setProductKeyword(); 62 +// $this->getProduct();
  63 + $this->setProductKeyword();
64 DB::disconnect('custom_mysql'); 64 DB::disconnect('custom_mysql');
65 } 65 }
66 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 66 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
@@ -23,8 +23,7 @@ define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/'); @@ -23,8 +23,7 @@ define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/');
23 if (!function_exists('generateRoute')) { 23 if (!function_exists('generateRoute')) {
24 function generateRoute($string) 24 function generateRoute($string)
25 { 25 {
26 - //TODO::html结尾,htm结尾,只处理.htm前面的内容  
27 - return trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-'); 26 + return str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-'));
28 } 27 }
29 } 28 }
30 29
@@ -101,15 +101,17 @@ class ServersIpController extends BaseController @@ -101,15 +101,17 @@ class ServersIpController extends BaseController
101 * @time :2024/6/24 16:24 101 * @time :2024/6/24 16:24
102 */ 102 */
103 public function save(ServersIpLogic $serversIpLogic){ 103 public function save(ServersIpLogic $serversIpLogic){
104 - $this->request->validate([  
105 - 'ip'=>'required',  
106 - 'servers_id'=>'required',  
107 - 'domain'=>'required'  
108 - ],[  
109 - 'ip.required' => 'ip不能为空',  
110 - 'servers_id.required' => '服务器servers_id不能为空',  
111 - 'domain.required' => 'cname域名不能为空',  
112 - ]); 104 + if(!isset($this->param['id'])){
  105 + $this->request->validate([
  106 + 'ip'=>'required',
  107 + 'servers_id'=>'required',
  108 + 'domain'=>'required'
  109 + ],[
  110 + 'ip.required' => 'ip不能为空',
  111 + 'servers_id.required' => '服务器servers_id不能为空',
  112 + 'domain.required' => 'cname域名不能为空',
  113 + ]);
  114 + }
113 $data = $serversIpLogic->saveServersIp(); 115 $data = $serversIpLogic->saveServersIp();
114 $this->response('success',Code::SUCCESS,$data); 116 $this->response('success',Code::SUCCESS,$data);
115 } 117 }
@@ -49,9 +49,11 @@ class ServersIpLogic extends BaseLogic @@ -49,9 +49,11 @@ class ServersIpLogic extends BaseLogic
49 */ 49 */
50 public function saveServersIp(){ 50 public function saveServersIp(){
51 //验证域名是否唯一 51 //验证域名是否唯一
52 - $info = $this->model->read(['domain'=>$this->param['domain']]);  
53 - if($info !== false){  
54 - $this->fail('当前初始域名已存在'); 52 + if(!isset($this->param['id'])){
  53 + $info = $this->model->read(['domain'=>$this->param['domain']]);
  54 + if($info !== false){
  55 + $this->fail('当前初始域名已存在');
  56 + }
55 } 57 }
56 if(isset($this->param['id']) && !empty($this->param['id'])){ 58 if(isset($this->param['id']) && !empty($this->param['id'])){
57 $id = $this->param['id']; 59 $id = $this->param['id'];
@@ -68,7 +68,7 @@ class UserLogic extends BaseLogic @@ -68,7 +68,7 @@ class UserLogic extends BaseLogic
68 $this->param = $this->editPassword($this->param); 68 $this->param = $this->editPassword($this->param);
69 $rs = $this->model->edit($this->param, ['id' => $this->param['id']]); 69 $rs = $this->model->edit($this->param, ['id' => $this->param['id']]);
70 } else { 70 } else {
71 - $this->param['password'] = base64_encode(md5($this->param['password'])); 71 + $this->param['password'] = base64_encode(md5($this->param['password'] ?? '123456'));
72 $rs = $this->model->add($this->param); 72 $rs = $this->model->add($this->param);
73 } 73 }
74 if ($rs === false) { 74 if ($rs === false) {
@@ -55,10 +55,9 @@ class RouteMap extends Base @@ -55,10 +55,9 @@ class RouteMap extends Base
55 public static function generateRoute($title, $source, $source_id, $project_id){ 55 public static function generateRoute($title, $source, $source_id, $project_id){
56 if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $title)){ 56 if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $title)){
57 $title = Translate::tran($title, 'en'); 57 $title = Translate::tran($title, 'en');
58 - }else{  
59 - if(contains_russian($title)){  
60 - $title = Translate::tran($title, 'en');  
61 - } 58 + }
  59 + if(contains_russian($title)){
  60 + $title = Translate::tran($title, 'en');
62 } 61 }
63 $i=1; 62 $i=1;
64 $sign = generateRoute($title); 63 $sign = generateRoute($title);