作者 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,6 +101,7 @@ class ServersIpController extends BaseController @@ -101,6 +101,7 @@ 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 + if(!isset($this->param['id'])){
104 $this->request->validate([ 105 $this->request->validate([
105 'ip'=>'required', 106 'ip'=>'required',
106 'servers_id'=>'required', 107 'servers_id'=>'required',
@@ -110,6 +111,7 @@ class ServersIpController extends BaseController @@ -110,6 +111,7 @@ class ServersIpController extends BaseController
110 'servers_id.required' => '服务器servers_id不能为空', 111 'servers_id.required' => '服务器servers_id不能为空',
111 'domain.required' => 'cname域名不能为空', 112 'domain.required' => 'cname域名不能为空',
112 ]); 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,10 +49,12 @@ class ServersIpLogic extends BaseLogic @@ -49,10 +49,12 @@ class ServersIpLogic extends BaseLogic
49 */ 49 */
50 public function saveServersIp(){ 50 public function saveServersIp(){
51 //验证域名是否唯一 51 //验证域名是否唯一
  52 + if(!isset($this->param['id'])){
52 $info = $this->model->read(['domain'=>$this->param['domain']]); 53 $info = $this->model->read(['domain'=>$this->param['domain']]);
53 if($info !== false){ 54 if($info !== false){
54 $this->fail('当前初始域名已存在'); 55 $this->fail('当前初始域名已存在');
55 } 56 }
  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'];
58 $this->model->edit($this->param,['id'=>$this->param['id']]); 60 $this->model->edit($this->param,['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,11 +55,10 @@ class RouteMap extends Base @@ -55,11 +55,10 @@ 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{ 58 + }
59 if(contains_russian($title)){ 59 if(contains_russian($title)){
60 $title = Translate::tran($title, 'en'); 60 $title = Translate::tran($title, 'en');
61 } 61 }
62 - }  
63 $i=1; 62 $i=1;
64 $sign = generateRoute($title); 63 $sign = generateRoute($title);
65 $length = strlen($sign); 64 $length = strlen($sign);