mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-12 11:09:23 +00:00
update v5.2.0
This commit is contained in:
parent
7cdb9866ca
commit
4512becd44
@ -1,4 +1,4 @@
|
|||||||
CRMEB v4.5 后端程序目录
|
CRMEB v5 后端程序目录
|
||||||
===============
|
===============
|
||||||
|
|
||||||
> 运行环境要求PHP7.1-7.4。
|
> 运行环境要求PHP7.1-7.4。
|
||||||
@ -8,12 +8,10 @@ CRMEB v4.5 后端程序目录
|
|||||||
## 一键安装
|
## 一键安装
|
||||||
上传你的代码,站点入口目录设置/public
|
上传你的代码,站点入口目录设置/public
|
||||||
在浏览器中输入你的域名或IP(例如:www.yourdomain.com),
|
在浏览器中输入你的域名或IP(例如:www.yourdomain.com),
|
||||||
安装程序会自动执行安装。期间系统会提醒你输入数据库信息以完成安装,安装完成后建议删除install目录下index.php文件或将其改名。
|
安装程序会自动执行安装。期间系统会提醒你输入数据库信息以完成安装,安装完成后建议删除install目录。
|
||||||
|
|
||||||
后台访问地址:
|
后台访问地址:
|
||||||
1.域名/admin
|
1.域名/admin
|
||||||
2.域名/index.php/admin
|
|
||||||
3.域名/index.php?s=/admin
|
|
||||||
公众号和H5首页访问地址:
|
公众号和H5首页访问地址:
|
||||||
1.域名/
|
1.域名/
|
||||||
|
|
||||||
@ -37,32 +35,39 @@ DEFAULT_TIMEZONE = Asia/Shanghai
|
|||||||
[DATABASE]
|
[DATABASE]
|
||||||
TYPE = mysql
|
TYPE = mysql
|
||||||
HOSTNAME = 127.0.0.1 #数据库连接地址
|
HOSTNAME = 127.0.0.1 #数据库连接地址
|
||||||
|
HOSTPORT = 3306 #数据库端口
|
||||||
DATABASE = test #数据库名称
|
DATABASE = test #数据库名称
|
||||||
USERNAME = username #数据库登录账号
|
USERNAME = username #数据库登录账号
|
||||||
PASSWORD = password #数据库登录密码
|
PASSWORD = password #数据库登录密码
|
||||||
HOSTPORT = 3306 #数据库端口
|
PREFIX = eb_
|
||||||
CHARSET = utf8
|
CHARSET = utf8mb4
|
||||||
DEBUG = true
|
DEBUG = true
|
||||||
|
|
||||||
[LANG]
|
[LANG]
|
||||||
default_lang = zh-cn
|
default_lang = zh-cn
|
||||||
|
|
||||||
|
[CACHE]
|
||||||
|
DRIVER = file #缓存类型,redis/file
|
||||||
|
CACHE_PREFIX = cache_xxxx: #缓存前缀
|
||||||
|
CACHE_TAG_PREFIX = cache_tag_xxxx: #缓存类型前缀
|
||||||
|
|
||||||
[REDIS]
|
[REDIS]
|
||||||
REDIS_HOSTNAME = 127.0.0.1 #redis链接地址
|
REDIS_HOSTNAME = 127.0.0.1 #redis链接地址
|
||||||
PORT = 6379 #端口号
|
PORT = 6379 #端口号
|
||||||
REDIS_PASSWORD = 123456 #密码
|
REDIS_PASSWORD = 123456 #密码
|
||||||
SELECT = 0 #数据库
|
SELECT = 0 #数据库
|
||||||
|
|
||||||
|
[QUEUE]
|
||||||
|
QUEUE_NAME = xxxx #队列前缀
|
||||||
~~~
|
~~~
|
||||||
3.修改目录权限(linux系统)777
|
3.修改目录权限(linux系统)777
|
||||||
/public
|
/crmeb
|
||||||
/runtime
|
/template
|
||||||
|
|
||||||
4.后台登录:
|
4.后台登录:
|
||||||
http://域名/admin
|
http://域名/admin
|
||||||
默认账号:admin 密码:crmeb.com
|
默认账号:admin 密码:crmeb.com
|
||||||
## 消息队列
|
|
||||||
```sh
|
|
||||||
php think queue:listen --queue
|
|
||||||
```
|
|
||||||
|
|
||||||
## 消息队列
|
## 消息队列
|
||||||
```sh
|
```sh
|
||||||
|
|||||||
@ -16,6 +16,7 @@ use crmeb\services\FormBuilder as Form;
|
|||||||
use app\services\other\UploadService;
|
use app\services\other\UploadService;
|
||||||
use think\facade\Log;
|
use think\facade\Log;
|
||||||
use think\facade\Route;
|
use think\facade\Route;
|
||||||
|
use think\facade\Config;
|
||||||
|
|
||||||
class DivisionAgentApplyServices extends BaseServices
|
class DivisionAgentApplyServices extends BaseServices
|
||||||
{
|
{
|
||||||
@ -245,6 +246,18 @@ class DivisionAgentApplyServices extends BaseServices
|
|||||||
public function downloadImage($url = '', $name = '', $type = 0, $timeout = 30, $w = 0, $h = 0)
|
public function downloadImage($url = '', $name = '', $type = 0, $timeout = 30, $w = 0, $h = 0)
|
||||||
{
|
{
|
||||||
if (!strlen(trim($url))) return '';
|
if (!strlen(trim($url))) return '';
|
||||||
|
if (!strlen(trim($name))) {
|
||||||
|
//TODO 获取要下载的文件名称
|
||||||
|
$downloadImageInfo = $this->getImageExtname($url);
|
||||||
|
$ext = $downloadImageInfo['ext_name'];
|
||||||
|
$name = $downloadImageInfo['file_name'];
|
||||||
|
if (!strlen(trim($name))) return '';
|
||||||
|
} else {
|
||||||
|
$ext = $this->getImageExtname($name)['ext_name'];
|
||||||
|
}
|
||||||
|
if (!in_array($ext, Config::get('upload.fileExt'))) {
|
||||||
|
throw new AdminException(400558);
|
||||||
|
}
|
||||||
//TODO 获取远程文件所采用的方法
|
//TODO 获取远程文件所采用的方法
|
||||||
if ($type) {
|
if ($type) {
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
@ -283,4 +296,25 @@ class DivisionAgentApplyServices extends BaseServices
|
|||||||
$data['is_exists'] = false;
|
$data['is_exists'] = false;
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取即将要下载的图片扩展名
|
||||||
|
* @param string $url
|
||||||
|
* @param string $ex
|
||||||
|
* @return array|string[]
|
||||||
|
*/
|
||||||
|
public function getImageExtname($url = '', $ex = 'jpg')
|
||||||
|
{
|
||||||
|
$_empty = ['file_name' => '', 'ext_name' => $ex];
|
||||||
|
if (!$url) return $_empty;
|
||||||
|
if (strpos($url, '?')) {
|
||||||
|
$_tarr = explode('?', $url);
|
||||||
|
$url = trim($_tarr[0]);
|
||||||
|
}
|
||||||
|
$arr = explode('.', $url);
|
||||||
|
if (!is_array($arr) || count($arr) <= 1) return $_empty;
|
||||||
|
$ext_name = trim($arr[count($arr) - 1]);
|
||||||
|
$ext_name = !$ext_name ? $ex : $ext_name;
|
||||||
|
return ['file_name' => md5($url) . '.' . $ext_name, 'ext_name' => $ext_name];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ use app\services\system\attachment\SystemAttachmentCategoryServices;
|
|||||||
use app\services\system\attachment\SystemAttachmentServices;
|
use app\services\system\attachment\SystemAttachmentServices;
|
||||||
use crmeb\exceptions\AdminException;
|
use crmeb\exceptions\AdminException;
|
||||||
use app\services\other\UploadService;
|
use app\services\other\UploadService;
|
||||||
|
use think\facade\Config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -288,7 +289,7 @@ class CopyTaobaoServices extends BaseServices
|
|||||||
} else {
|
} else {
|
||||||
$ext = $this->getImageExtname($name)['ext_name'];
|
$ext = $this->getImageExtname($name)['ext_name'];
|
||||||
}
|
}
|
||||||
if (!in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'JPG', 'JPEG', 'PNG', 'GIF'])) {
|
if (!in_array($ext, Config::get('upload.fileExt'))) {
|
||||||
throw new AdminException(400558);
|
throw new AdminException(400558);
|
||||||
}
|
}
|
||||||
//TODO 获取远程文件所采用的方法
|
//TODO 获取远程文件所采用的方法
|
||||||
|
|||||||
@ -14,6 +14,7 @@ use app\services\user\UserServices;
|
|||||||
use crmeb\exceptions\AdminException;
|
use crmeb\exceptions\AdminException;
|
||||||
use app\services\other\UploadService;
|
use app\services\other\UploadService;
|
||||||
use crmeb\services\app\WechatService;
|
use crmeb\services\app\WechatService;
|
||||||
|
use think\facade\Config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class WechatQrcodeServices
|
* Class WechatQrcodeServices
|
||||||
@ -172,6 +173,18 @@ class WechatQrcodeServices extends BaseServices
|
|||||||
public function downloadImage($url = '', $name = '', $type = 0, $timeout = 30, $w = 0, $h = 0)
|
public function downloadImage($url = '', $name = '', $type = 0, $timeout = 30, $w = 0, $h = 0)
|
||||||
{
|
{
|
||||||
if (!strlen(trim($url))) return '';
|
if (!strlen(trim($url))) return '';
|
||||||
|
if (!strlen(trim($name))) {
|
||||||
|
//TODO 获取要下载的文件名称
|
||||||
|
$downloadImageInfo = $this->getImageExtname($url);
|
||||||
|
$ext = $downloadImageInfo['ext_name'];
|
||||||
|
$name = $downloadImageInfo['file_name'];
|
||||||
|
if (!strlen(trim($name))) return '';
|
||||||
|
} else {
|
||||||
|
$ext = $this->getImageExtname($name)['ext_name'];
|
||||||
|
}
|
||||||
|
if (!in_array($ext, Config::get('upload.fileExt'))) {
|
||||||
|
throw new AdminException(400558);
|
||||||
|
}
|
||||||
//TODO 获取远程文件所采用的方法
|
//TODO 获取远程文件所采用的方法
|
||||||
if ($type) {
|
if ($type) {
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
@ -211,6 +224,27 @@ class WechatQrcodeServices extends BaseServices
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取即将要下载的图片扩展名
|
||||||
|
* @param string $url
|
||||||
|
* @param string $ex
|
||||||
|
* @return array|string[]
|
||||||
|
*/
|
||||||
|
public function getImageExtname($url = '', $ex = 'jpg')
|
||||||
|
{
|
||||||
|
$_empty = ['file_name' => '', 'ext_name' => $ex];
|
||||||
|
if (!$url) return $_empty;
|
||||||
|
if (strpos($url, '?')) {
|
||||||
|
$_tarr = explode('?', $url);
|
||||||
|
$url = trim($_tarr[0]);
|
||||||
|
}
|
||||||
|
$arr = explode('.', $url);
|
||||||
|
if (!is_array($arr) || count($arr) <= 1) return $_empty;
|
||||||
|
$ext_name = trim($arr[count($arr) - 1]);
|
||||||
|
$ext_name = !$ext_name ? $ex : $ext_name;
|
||||||
|
return ['file_name' => md5($url) . '.' . $ext_name, 'ext_name' => $ext_name];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫码完成后方法
|
* 扫码完成后方法
|
||||||
* @param $qrcodeInfo
|
* @param $qrcodeInfo
|
||||||
|
|||||||
@ -15,6 +15,7 @@ namespace crmeb\utils;
|
|||||||
use app\services\other\UploadService;
|
use app\services\other\UploadService;
|
||||||
use crmeb\exceptions\AdminException;
|
use crmeb\exceptions\AdminException;
|
||||||
use think\Image;
|
use think\Image;
|
||||||
|
use think\facade\Config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载图片到本地
|
* 下载图片到本地
|
||||||
@ -80,7 +81,7 @@ class DownloadImage
|
|||||||
} else {
|
} else {
|
||||||
$ext = $this->getImageExtname($name)['ext_name'];
|
$ext = $this->getImageExtname($name)['ext_name'];
|
||||||
}
|
}
|
||||||
if (!in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'JPG', 'JPEG', 'PNG', 'GIF'])) {
|
if (!in_array($ext, Config::get('upload.fileExt'))) {
|
||||||
throw new AdminException(400558);
|
throw new AdminException(400558);
|
||||||
}
|
}
|
||||||
if (strstr($url, 'http://') === false && strstr($url, 'https://') === false) {
|
if (strstr($url, 'http://') === false && strstr($url, 'https://') === false) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user