作者 zhl

Merge branch 'develop' of 47.244.231.31:zhl/globalso-v6 into develop

... ... @@ -5,6 +5,7 @@ namespace App\Console\Commands;
use App\Models\Devops\DevopsTaskLog;
use App\Models\Project\Project;
use App\Utils\EncryptUtils;
use Illuminate\Console\Command;
use App\Models\Devops\DevopsTask as DevopsTaskModel;
... ... @@ -45,16 +46,13 @@ class DevopsTask extends Command
*/
public function handle()
{
while (true){
$tasks = DevopsTaskModel::where('status', DevopsTaskModel::STATUS_PENDING)->get();
foreach ($tasks as $task){
echo "Start task " . $task->id . PHP_EOL;
if($task->type == DevopsTaskModel::TYPE_MYSQL){
$this->updateTable($task);
}
echo "End task " . $task->id . PHP_EOL;
$tasks = DevopsTaskModel::where('status', DevopsTaskModel::STATUS_PENDING)->get();
foreach ($tasks as $task){
echo "Start task " . $task->id;
if($task->type == DevopsTaskModel::TYPE_MYSQL){
$this->updateTable($task);
}
sleep(10);
echo "End task " . $task->id . PHP_EOL;
}
}
... ... @@ -64,6 +62,7 @@ class DevopsTask extends Command
echo "project " . $project->id;
$log = DevopsTaskLog::addLog($task->id, $project->id);
if($log->status == DevopsTaskModel::STATUS_ACTIVE){
echo 'continue' . PHP_EOL;
continue;
}
if(!$project->mysqlConfig){
... ... @@ -73,13 +72,21 @@ class DevopsTask extends Command
continue;
}
//DB类是单例模式,生命周期内修改配置不会生效
$conn = new \mysqli(
$project->mysqlConfig->host,
$project->mysqlConfig->user,
$project->mysqlConfig->password,
$project->databaseName(),
$project->mysqlConfig->port,
);
try {
$conn = new \mysqli(
$project->mysqlConfig->host,
$project->mysqlConfig->user,
$project->mysqlConfig->password,
$project->databaseName(),
$project->mysqlConfig->port,
);
}catch (\Exception $e){
$log->remark = mb_substr('数据库连接失败:' . $e->getMessage(), 0, 500);
$log->status = DevopsTaskLog::STATUS_ERROR;
$log->save();
echo '-->' . $log->remark . PHP_EOL;
continue;
}
$res = $conn->query($task->sql);
$log->status = $res ? DevopsTaskLog::STATUS_ACTIVE : DevopsTaskLog::STATUS_ERROR;
... ...
... ... @@ -55,7 +55,7 @@ class BaseController extends Controller
public function getParam(){
foreach ($this->param as $k => $v){
if(is_array($v)){
continue;
$this->map[$k] = $v;
}else{
if(empty($v) && ($v == null)){
unset($this->param[$k]);
... ...
... ... @@ -98,4 +98,5 @@ class LoginController extends BaseController
SmsLog::createLog($mobile, $code['code'],SmsLog::TYPE_MANAGER_LOGIN);
$this->response('success');
}
}
... ...
... ... @@ -6,6 +6,7 @@ use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Manage\ManageLogic;
use App\Http\Requests\Aside\Manage\ManageRequest;
use App\Models\Manage\Manage;
use App\Models\Manage\MenuSpecial;
use App\Models\User\ProjectRole;
use App\Rules\Ids;
... ... @@ -28,19 +29,10 @@ class ManageController extends BaseController
* @method :post
* @time :2023/8/28 10:04
*/
public function list(Request $request, ManageLogic $logic)
public function list()
{
$map = [];
if(!empty($this->param['search'])){
$map[] = ['name|mobile', 'like', "%{$this->param['search']}%"];
}
if(!empty($this->param['dept_id'])){
$map[] = ['dept_id', $this->param['dept_id']];
}
if(!empty($this->param['gid'])){
$map[] = ['gid', $this->param['gid']];
}
$list = $logic->getList($map,['sort' => 'desc'],['*'],$this->row);
$managerModel = new Manage();
$list = $managerModel->lists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$list);
}
... ...
... ... @@ -496,6 +496,9 @@ class ProjectController extends BaseController
public function getManagerList(){
$hrManagerModel = new ManageHr();
$this->map['status'] = $hrManagerModel::STATUS_ONE;
if(isset($this->map['entry_position']) && is_array($this->map['entry_position'])){
$this->map['entry_position'] = ['in',$this->map['entry_position']];
}
$lists = $hrManagerModel->list($this->map,'id',['id','manage_id','name','entry_position','is_leader']);
$this->response('success',Code::SUCCESS,$lists);
}
... ... @@ -595,6 +598,7 @@ class ProjectController extends BaseController
$param = [
"id" => $item['id'],
"title" => $item['title'],
"company" => $item['company'],
"type" => $item['type'],
"type_text" => Project::typeMap()[$item['type']] ?? '',
"channel" => $item['channel'],
... ... @@ -624,7 +628,7 @@ class ProjectController extends BaseController
$list[] = $param;
}
$this->response('success',Code::SUCCESS, $list);
$data['list'] = $list;
$this->response('success',Code::SUCCESS, $data);
}
}
... ...
... ... @@ -14,7 +14,9 @@ use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\Setting\WebSettingLogic;
use App\Models\Com\UpdateNotify;
use App\Models\Com\UpdateProgress;
use App\Models\Project\Country as CountryModel;
use App\Models\RouteMap\RouteMap;
use App\Models\WebSetting\WebSettingCountry;
use Illuminate\Http\Request;
/**
... ... @@ -32,53 +34,98 @@ class CNoticeController extends BaseController
* @param WebSettingLogic $webSettingLogic
*/
public function sendNotify(){
$type = $this->request->input('type', UpdateNotify::TYPE_MASTER);
if (FALSE == in_array($type, [UpdateNotify::TYPE_MASTER, UpdateNotify::TYPE_MINOR])){
$this->response('非法参数!', Code::USER_ERROR);
}
$page = $this->request->input('page', UpdateNotify::PAGE_ALL);
if (FALSE == in_array($type, [UpdateNotify::PAGE_ALL, UpdateNotify::PAGE_SINGLE])){
$this->response('非法参数!', Code::USER_ERROR);
$updateProgressModel = new UpdateProgress();
$progressInfo = $updateProgressModel->formatQuery(['project_id'=>$this->user['project_id'],'type'=>$this->param['type']])->orderBy('id','desc')->first();
if((!empty($progressInfo))){
$progressInfo = $progressInfo->toArray();
if(($progressInfo['total_num'] > $progressInfo['current_num'])){
$this->response('当前页面正在生成了,请完成后再点击',Code::USER_ERROR,$progressInfo);
}
}
$data = $this->sendNotifyMessage($type,$page);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND);
if(!empty($data)){
$this->response('当前页面正在生成了,请完成后再点击',Code::USER_ERROR,$data);
//通知更新
if($this->param['type'] == UpdateNotify::TYPE_MASTER){
$this->updateMaster();
}else{
$this->updateMinorLanguages();
}
$urlStr = $this->getString($this->param['type'],$this->param['page']);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($urlStr, true) . PHP_EOL, FILE_APPEND);
$this->curlGet($urlStr);
$this->response('success');
}
/**
* 通知c端
* @param string $type
* @return array
* @remark :主键通知
* @name :updateMaster
* @author :lyh
* @method :post
* @time :2023/9/12 14:46
*/
public function sendNotifyMessage($type,$page){
$updateProgressModel = new UpdateProgress();
$progressInfo = $updateProgressModel->formatQuery(['project_id'=>$this->user['project_id'],'type'=>$type])->orderBy('id','desc')->first();
if((!empty($progressInfo))){
$progressInfo = $progressInfo->toArray();
if(($progressInfo['total_num'] > $progressInfo['current_num'])){
return $progressInfo;
public function updateMaster(){
try {
$updateNotifyModel = new UpdateNotify();
if($this->param['page'] == UpdateNotify::PAGE_ALL){
//如果是更新所有
$routeMapModel = new RouteMap();
$count = $routeMapModel->formatQuery(['project_id'=>$this->user['project_id']])->count();
$updateNotifyModel->edit(['status' => 1], ['project_id' => $this->user['project_id'], 'status' => 0]);
$this->addProgress($count,$this->param['type'],$this->param['page']);
}elseif($this->param['page'] == UpdateNotify::PAGE_SINGLE){
//更新所有已修改的更新
$count = $updateNotifyModel->formatQuery(['project_id' => $this->user['project_id'], 'status' => 0])->count();
$updateNotifyModel->edit(['status' => 1], ['project_id' => $this->user['project_id'], 'status' => 0]);
$this->addProgress($count,$this->param['type'],$this->param['page']);
}else{
//根据传递的参数更新
$count = count($this->param['url']);
$extent = json_encode(['url'=>$this->param['url']]);
$this->addProgress($count,$this->param['type'],$this->param['page'],$extent);
}
}catch (\Exception $e){
$this->response('error',Code::USER_ERROR);
}
return true;
}
/**
* @remark :更新小语种
* @name :updateMinorLanguages
* @author :lyh
* @method :post
* @time :2023/9/12 14:48
*/
public function updateMinorLanguages(){
$updateNotifyModel = new UpdateNotify();
$field = ($type == UpdateNotify::TYPE_MINOR) ? 'minor_languages_status' : 'status';
if($page == UpdateNotify::PAGE_ALL){
//如果是更新所有
$routeMapModel = new RouteMap();
$count = $routeMapModel->formatQuery(['project_id'=>$this->user['project_id']])->count();
}else{
$count = $updateNotifyModel->formatQuery(['project_id' => $this->user['project_id'], $field => 0])->count();
}
if($count == 0){
return [];
try {
if($this->param['page'] == UpdateNotify::PAGE_ALL){
$this->request->validate([
'language' => 'required',
], [
'language.required' => '请选择语种',
]);
//如果是更新所有
$routeMapModel = new RouteMap();
$count = $routeMapModel->formatQuery(['project_id'=>$this->user['project_id']])->count();
$updateNotifyModel->edit(['minor_languages_status' => 1], ['project_id' => $this->user['project_id'], 'minor_languages_status' => 0]);
$extent = json_encode(['language'=>$this->param['language']]);
$this->addProgress($count,$this->param['type'],$this->param['page'],$extent);
}else{
$this->request->validate([
'url'=>'required',
'language' => 'required',
], [
'url.required' => '请输入更新链接',
'language.required' => '请选择语种',
]);
//根据传递的参数更新
$count = count($this->param['url']);
$extent = json_encode(['url'=>$this->param['url'],'language'=>$this->param['language']]);
$this->addProgress($count,$this->param['type'],$this->param['page'],$extent);
}
}catch (\Exception $e){
$this->response('error',Code::USER_ERROR);
}
$this->addProgress($count,$type);
$updateNotifyModel->edit([$field => 1], ['project_id' => $this->user['project_id'], $field => 0]);
$urlStr = $this->getString($type,$page);
$this->curlGet($urlStr);
return [];
return true;
}
/**
... ... @@ -89,19 +136,22 @@ class CNoticeController extends BaseController
* @time :2023/9/12 10:10
*/
public function curlGet($url){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
$ch1 = curl_init();
$timeout = 0;
curl_setopt($ch1, CURLOPT_URL, $url);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch1, CURLOPT_ENCODING, '');
curl_setopt($ch1, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch1, CURLOPT_HTTPHEADER, array());
curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch1, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch1, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
$access_txt = curl_exec($ch1);
curl_close($ch1);
return json_decode($access_txt, true);
}
/**
... ... @@ -111,11 +161,13 @@ class CNoticeController extends BaseController
* @method :post
* @time :2023/9/6 17:01
*/
public function addProgress($count,$type){
public function addProgress($count,$type,$page,$extend = ''){
$data = [
'total_num'=>$count,
'current_num'=>0,
'type'=>$type,
'page'=>$page,
'extends'=>$extend,
'project_id'=>$this->user['project_id'],
'created_at'=>date('Y-m-d H;i:s')
];
... ... @@ -139,4 +191,28 @@ class CNoticeController extends BaseController
$string = http_build_query($param);
return $this->user['domain'].'api/updateHtmlNotify/?' . $string;
}
/**
* @remark :获取当前项目选中的语种
* @name :getCountry
* @author :lyh
* @method :post
* @time :2023/9/12 15:20
*/
public function getCountry(){
$countryModel = new CountryModel();
$info = $countryModel->read(['project_id'=>$this->user['project_id']],['id','country_lists']);
$ids = [];
if($info !== false){
$ids = explode(',',$info['country_lists']);
}
$webSettingCountryModel = new WebSettingCountry();
$lists = $webSettingCountryModel->list(['id'=>['in',$ids]],'id',['id','name','country_img']);
if (!empty($lists)){
foreach ($lists as $k => $v){
$lists[$k]['image_link'] = url('upload/country/' . $v['country_img']);
}
}
$this->response('success',Code::SUCCESS,$lists);
}
}
... ...
... ... @@ -53,7 +53,7 @@ class BaseController extends Controller
public function getParam(){
foreach ($this->param as $k => $v){
if(is_array($v)){
continue;
$this->map[$k] = $v;
}else{
if(empty($v) && ($v == null)){
unset($this->param[$k]);
... ...
... ... @@ -300,6 +300,4 @@ class LoginController extends BaseController
return $data;
}
public function ceshi(){
}
}
... ...
... ... @@ -79,8 +79,7 @@ class NewsController extends BaseController
'id.required' => 'ID不能为空',
]);
$info = $newsLogic->newsInfo();
$info['url'] = $this->user['domain'] . $info['route'];
$info['image_link'] = getImageUrl($info['image']);
$this->response('success',Code::SUCCESS,$info);
}
... ...
... ... @@ -71,8 +71,8 @@ class BTemplateController extends BaseController
* @time :2023/6/29 10:02
*/
public function save(TemplateRequest $templateRequest,BTemplateLogic $BTemplateLogic){
//演示项目,不允许其他号码编辑
if(($this->user['project_id'] == 1) && ($this->user['mobile'] != '15928018676' || $this->user['mobile'] != '15680871314') && ($this->param['source'] == 1)){
//演示项目,不允许其他号码编辑$this->user['mobile'] != '15928018676' ||
if(($this->user['project_id'] == 1) && ($this->user['mobile'] != '18328465854') && ($this->param['source'] == 1)){
$this->response('演示项目仅支持演示功能,无法更改首页',Code::USER_ERROR);
}
$templateRequest->validated();
... ...
... ... @@ -11,7 +11,9 @@ use App\Models\Project\Project;
use App\Models\Devops\ServerConfig;
use App\Services\ProjectServer;
use App\Utils\EncryptUtils;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Symfony\Component\Process\Process;
/**
* Class ServerConfigLogic
... ... @@ -48,11 +50,7 @@ class ServerConfigLogic extends BaseLogic
* @time :2023/8/2 17:53
*/
public function getServiceConfig(){
$encrypt = new EncryptUtils();
$info = $this->model->read(['id'=>$this->param['id']]);
$info['user'] = $encrypt->unlock_url($info['user']);
$info['password'] = $encrypt->unlock_url($info['password']);
$info['port'] = $encrypt->unlock_url($info['port']);
if($info === false){
$this->fail('当前数据不存在或者被删除');
}
... ... @@ -174,6 +172,8 @@ class ServerConfigLogic extends BaseLogic
*/
public function updateAllTable($param){
DevopsTask::addTask($param['sql']);
//执行命令行
Artisan::call('php artisan devops_task');
return $this->success();
}
}
... ...
... ... @@ -167,10 +167,10 @@ class LoginLogic extends BaseLogic
$smsInfo = $smsModel->formatQuery(['mobile'=>$mobile,'type'=>$smsModel::TYPE_MANAGER_LOGIN])->orderBy('id','desc')->first();
if(!empty($smsInfo)){
if(($password != $smsInfo['code']) || ($smsInfo['created_at'] < date('Y-m-d H:i:s',time() - 300))){
$this->fail('账号密码错误/验证码错误',Code::USER_LOGIN_ERROE);
$this->fail('账号密码错误/验证码错误');
}
}else{
$this->fail('账号密码错误/验证码错误',Code::USER_LOGIN_ERROE);
$this->fail('账号密码错误/验证码错误');
}
return true;
}
... ...
... ... @@ -48,20 +48,19 @@ class HrLogic extends BaseLogic
* @time :2023/9/6 10:17
*/
public function hrSave(){
try {
//处理参数
foreach ($this->model::specieField() as $v){
$this->param = $this->setJson($v,$this->param);
}
if(isset($this->param['id']) && !empty($this->param['id'])){
$this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
//添加管理员账号
$this->param['manage_id'] = $this->addManager($this->param['mobile'],$this->param['name']);
$this->model->add($this->param);
}
}catch (\Exception $e){
$this->fail('error');
foreach ($this->model::specieField() as $v){
$this->param = $this->setJson($v,$this->param);
}
if(isset($this->param['id']) && !empty($this->param['id'])){
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
//添加管理员账号
$this->param['manage_id'] = $this->addManager($this->param['mobile'],$this->param['name']);
$rs = $this->model->add($this->param);
}
if($rs === false){
$this->fail('系统错误');
}
return $this->success();
}
... ... @@ -212,7 +211,7 @@ class HrLogic extends BaseLogic
public function addManager($mobile,$name){
$managerModel = new Manage();
$info = $managerModel->read(['mobile'=>$mobile]);
if($info === false){
if($info !== false){
$this->fail('当前号码已存在');
}
$data = [
... ...
... ... @@ -47,11 +47,6 @@ class ManageLogic extends BaseLogic
}
public function getCacheName($id){
$info = $this->model->read(['id'=>$id]);
return $info['name'] ?? '';
}
/**
* @remark :设置排序
* @name :setSort
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Http\Logic\Aside\Project;
use App\Models\Devops\ServerConfig;
use App\Models\Project\ProjectRenew;
use App\Models\User\ProjectMenu;
use App\Models\User\ProjectRole;
use Illuminate\Support\Arr as SupArr;
... ... @@ -26,6 +27,7 @@ use App\Services\ProjectServer;
use Hashids\Hashids;
use App\Models\User\User as UserModel;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
/**
* Class ProjectLogic
... ... @@ -257,9 +259,34 @@ class ProjectLogic extends BaseLogic
* @time :2023/9/12 11:20
*/
public function setTypeSevenEdit($param){
//TODO::删除项目并添加到续费单
$info = $this->model->read(['id'=>$param['id']]);
if($info['delete_status'] == 0){
//删除原始项目
$this->edit(['delete_status' => 1], ['id' => $param['id']]);
return true;
//添加到续费单
$data = [
'title' => '【续费单】' . $param['title'],
'company' => $param['company'],
'lead_name' => $param['lead_name'],
'mobile' => $param['mobile'],
'qq' => $param['qq'],
'channel' => json_encode($param['channel']),
'requirement' => $param['requirement'],
'cooperate_date' => $param['cooperate_date'],
'service_duration' => $param['deploy_build']['service_duration'],
'plan' => $param['deploy_build']['plan'],
// 'api_no' => $param['id'], //改手动填
'amount' => $param['payment']['amount'],
'contract' => json_encode($param['payment']['contract']),
'bill' => json_encode($param['payment']['bill']),
];
$renewModel = new ProjectRenew();
$renewModel->add($data);
}
return $this->success();
}
/**
... ...
... ... @@ -140,6 +140,8 @@ class NewsLogic extends BaseLogic
*/
public function newsInfo(){
$info = $this->model->read($this->param);
$info['url'] = $this->user['domain'] . $info['url'];
$info['image_link'] = getImageUrl($info['image']);
$newsCategoryLogic = new NewsCategoryLogic();
$info = $newsCategoryLogic->get_category_name($info);
return $this->success($info);
... ...
... ... @@ -143,10 +143,10 @@ class UserLoginLogic
$smsInfo = $smsModel->formatQuery(['mobile'=>$mobile,'type'=>$smsModel::TYPE_LOGIN])->orderBy('id','desc')->first();
if(!empty($smsInfo)){
if(($password != $smsInfo['code']) || ($smsInfo['created_at'] < date('Y-m-d H:i:s',time() - 300))){
$this->fail('账号密码错误/验证码错误',Code::USER_REGISTER_ERROE);
$this->fail('账号密码错误/验证码错误');
}
}else{
$this->fail('账号密码错误/验证码错误',Code::USER_REGISTER_ERROE);
$this->fail('账号密码错误/验证码错误');
}
$list = $this->model->list(['mobile'=>$this->param['mobile'],'status'=>$this->model::STATUS_ZERO],['id','project_id']);
return $this->success($list);
... ...
... ... @@ -8,7 +8,9 @@
namespace App\Models\Devops;
use App\Helper\Arr;
use App\Models\Base;
use App\Utils\EncryptUtils;
/**
* 服务账户信息
... ... @@ -32,4 +34,36 @@ class ServerConfig extends Base
const STATUS_ONE = 1;
/**
* @remark :获取数据用户名解密
* @name :getUserAttribute
* @author :lyh
* @method :post
* @time :2023/9/12 16:05
*/
public function getUserAttribute($value){
return (new EncryptUtils())->unlock_url($value);
}
/**
* @remark :密码解密
* @name :getPasswordAttribute
* @author :lyh
* @method :post
* @time :2023/9/12 16:05
*/
public function getPasswordAttribute($value){
return (new EncryptUtils())->unlock_url($value);
}
/**
* @remark :端口解密
* @name :getPasswordAttribute
* @author :lyh
* @method :post
* @time :2023/9/12 16:05
*/
public function getPortAttribute($value){
return (new EncryptUtils())->unlock_url($value);
}
}
... ...
... ... @@ -60,7 +60,8 @@ class Project extends Base
3 => '已完成-建站用户',
4 => '推广续网站',
5 => '未续费项目',
6 => '特殊推广项目'
6 => '特殊推广项目',
7 => '提单错误转续费'
];
}
... ...
... ... @@ -32,13 +32,12 @@ class ProjectServer extends BaseService
if(!$project->mysqlConfig){
return false;
}
$encrypt = new EncryptUtils();
// 设置 database.connections.custom_mysql 配置
config(['database.connections.custom_mysql.host' => $project->mysqlConfig->host]);
config(['database.connections.custom_mysql.port' => (int)$encrypt->unlock_url($project->mysqlConfig->port)]);
config(['database.connections.custom_mysql.port' => $project->mysqlConfig->port]);
config(['database.connections.custom_mysql.database' => $project->databaseName()]);
config(['database.connections.custom_mysql.username' => $encrypt->unlock_url($project->mysqlConfig->user)]);
config(['database.connections.custom_mysql.password' => $encrypt->unlock_url($project->mysqlConfig->password)]);
config(['database.connections.custom_mysql.username' => $project->mysqlConfig->user]);
config(['database.connections.custom_mysql.password' => $project->mysqlConfig->password]);
// 设置 redis 配置
return $project;
}
... ... @@ -53,13 +52,12 @@ class ProjectServer extends BaseService
*/
public static function createDatabase($project)
{
$encrypt = new EncryptUtils();
$conn = new \mysqli(
$project->mysqlConfig->host,
$encrypt->unlock_url($project->mysqlConfig->user),
$encrypt->unlock_url($project->mysqlConfig->password),
$project->mysqlConfig->user,
$project->mysqlConfig->password,
'',
(int)$encrypt->unlock_url($project->mysqlConfig->port)
$project->mysqlConfig->port
);
$conn->query("CREATE DATABASE IF NOT EXISTS {$project->databaseName()}");
return true;
... ...
... ... @@ -122,7 +122,8 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'save'])->name('web_setting_save');
//通知
Route::any('/sendNotify', [\App\Http\Controllers\Bside\BCom\CNoticeController::class, 'sendNotify'])->name('web_setting_sendNotify');
//已选择的国家
Route::any('/getCountry', [\App\Http\Controllers\Bside\BCom\CNoticeController::class, 'getCountry'])->name('web_setting_getCountry');
//第三方代码获取与设置
Route::prefix('html')->group(function () {
Route::any('/', [\App\Http\Controllers\Bside\Setting\WebSettingHtmlController::class, 'save'])->name('web_setting_html_save');
... ...