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