Skip to content

Commit 2415bb7

Browse files
committed
update v5.4.0
1 parent 3cd421d commit 2415bb7

File tree

1,671 files changed

+45493
-34816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,671 files changed

+45493
-34816
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@
1919
/template/uni-app/node_modules/
2020
/template/uni-app/unpackage/
2121
/template/uni-app/.hbuilderx/
22-

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ APP下载:http://app.crmeb.cn/bzv (苹果手机直接在APP Store里搜索CR
112112

113113
---
114114

115+
116+
115117
### 📲 核心功能
116118

117119
![输入图片说明](readme/pic/功能列表.jpg)

crmeb/.version

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
version=CRMEB-KY v5.3.0
2-
version_code=530
1+
version=CRMEB-KY v5.4.0
2+
version_code=540
33
platform=github
44
app_id=ze7x9rxsv09l6pvsyo
55
app_key=fuF7U9zaybLa5gageVQzxtxQMFnvU2OI

crmeb/app/Request.php

+22-51
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Request extends \think\Request
3434
* @var array
3535
*/
3636
protected $except = ['menu_path', 'api_url', 'unique_auth',
37-
'description', 'custom_form', 'content', 'tableField', 'url'];
37+
'description', 'custom_form', 'content', 'tableField', 'url', 'customCode'];
3838

3939
/**
4040
* 获取请求的数据
@@ -49,7 +49,7 @@ public function more(array $params, bool $suffix = false, bool $filter = true):
4949
$i = 0;
5050
foreach ($params as $param) {
5151
if (!is_array($param)) {
52-
$p[$suffix == true ? $i++ : $param] = $this->filterWord(is_string($this->param($param)) ? trim($this->param($param)) : $this->param($param), $filter && !in_array($param, $this->except));
52+
$p[$suffix == true ? $i++ : $param] = $this->param($param);
5353
} else {
5454
if (!isset($param[1])) $param[1] = null;
5555
if (!isset($param[2])) $param[2] = '';
@@ -61,70 +61,41 @@ public function more(array $params, bool $suffix = false, bool $filter = true):
6161
$keyName = $param[0];
6262
}
6363

64-
$p[$suffix == true ? $i++ : ($param[3] ?? $keyName)] = $this->filterWord(
65-
is_string($this->param($name, $param[1], $param[2])) ?
66-
trim($this->param($name, $param[1], $param[2])) :
67-
$this->param($name, $param[1], $param[2]),
68-
$filter && !in_array($keyName, $this->except));
64+
$p[$suffix == true ? $i++ : ($param[3] ?? $keyName)] = $this->param($name, $param[1], $param[2]);
6965
}
7066
}
67+
68+
if ($filter && $p) {
69+
$p = $this->filterArrayValues($p);
70+
}
71+
7172
return $p;
7273
}
7374

7475
/**
75-
* 过滤接受的参数
76+
* 过滤接数组中的字符串
7677
* @param $str
7778
* @param bool $filter
7879
* @return array|mixed|string|string[]
7980
*/
80-
public function filterWord($str, bool $filter = true)
81+
public function filterArrayValues($array)
8182
{
82-
if (!$str || !$filter) return $str;
83-
// 把数据过滤
84-
$farr = [
85-
"/<(\\/?)(script|i?frame|style|html|body|title|link|meta|object|\\?|\\%)([^>]*?)>/isU",
86-
"/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",
87-
'/phar/is',
88-
"/select|join|where|drop|like|modify|rename|insert|update|table|database|alter|truncate|\'|\/\*|\.\.\/|\.\/|union|into|load_file|outfile/is"
89-
];
90-
if (is_array($str)) {
91-
foreach ($str as &$v) {
92-
if (is_array($v)) {
93-
foreach ($v as &$vv) {
94-
if (!is_array($vv)) {
95-
$vv = $this->replaceWord($farr, $vv);
96-
}
97-
}
83+
$result = [];
84+
foreach ($array as $key => $value) {
85+
if (is_array($value)) {
86+
// 如果值是数组,递归调用 filterArrayValues
87+
$result[$key] = $this->filterArrayValues($value);
88+
} else {
89+
if (in_array($key, $this->except) || is_int($value) || is_null($value)) {
90+
$result[$key] = $value;
9891
} else {
99-
$v = $this->replaceWord($farr, $v);
92+
// 如果值是字符串,过滤特殊字符
93+
$result[$key] = filter_str($value);
10094
}
101-
}
102-
} else {
103-
$str = $this->replaceWord($farr, $str);
104-
}
105-
return $str;
106-
}
10795

108-
/**
109-
* 替换
110-
* @param $farr
111-
* @param $str
112-
* @return array|string|string[]|null
113-
* @author: 吴汐
114-
115-
* @date: 2023/9/19
116-
*/
117-
public function replaceWord($farr, $str)
118-
{
119-
if (filter_var($str, FILTER_VALIDATE_URL)) {
120-
$url = parse_url($str);
121-
if (!isset($url['scheme'])) return $str;
122-
$host = $url['scheme'] . '://' . $url['host'];
123-
$str = $host . preg_replace($farr, '', str_replace($host, '', $str));
124-
} else {
125-
$str = preg_replace($farr, '', $str);
96+
}
12697
}
127-
return $str;
98+
return $result;
12899
}
129100

130101
/**

crmeb/app/adminapi/controller/Common.php

+3-28
Original file line numberDiff line numberDiff line change
@@ -60,34 +60,6 @@ public function auth()
6060
'version' => $version
6161
]);
6262
$res = $res ? json_decode($res, true) : [];
63-
64-
//兼容test.
65-
if (!isset($res['data']['status']) || $res['data']['status'] !== 1) {
66-
$host = str_replace('test.', '', $host);
67-
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
68-
'domain_name' => $host,
69-
'label' => 34,
70-
'version' => $version
71-
]);
72-
$res = $res ? json_decode($res, true) : [];
73-
}
74-
75-
//如果是主域名兼容www.
76-
if (!isset($res['data']['status']) || $res['data']['status'] !== 1) {
77-
$host = str_replace('www.', '', $host);
78-
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
79-
'domain_name' => $host,
80-
'label' => 34,
81-
'version' => $version
82-
]);
83-
$res = $res ? json_decode($res, true) : [];
84-
}
85-
86-
//升级状态
87-
// /** @var UpgradeServices $upgradeServices */
88-
// $upgradeServices = app()->make(UpgradeServices::class);
89-
// $upgradeStatus = $upgradeServices->getUpgradeStatus();
90-
9163
$status = $res['data']['status'] ?? -9;
9264
switch ((int)$status) {
9365
case 1:
@@ -447,6 +419,9 @@ public function menusSearch()
447419
$configMenusList = $menusServices->getColumn([['id', 'in', $configTabIds]], 'menu_name as title,menu_path as path,id', 'id');
448420
// 将配置项列表中的菜单ID与配置项标签对应的菜单ID对应起来
449421
foreach ($configAllList as $item2) {
422+
if ($item2['menus_id'] == 0) {
423+
continue;
424+
}
450425
$menusList[] = [
451426
'title' => $configMenusList[$item2['menus_id']]['title'] . '-' . $item2['title'],
452427
'path' => $configMenusList[$item2['menus_id']]['path'] . '?tab_id=' . $item2['config_tab_id'],

0 commit comments

Comments
 (0)