优化增加cdn配置
This commit is contained in:
parent
0cad005267
commit
34b1109859
@ -80,12 +80,12 @@ class Index extends Backend
|
|||||||
$rule = [
|
$rule = [
|
||||||
'username' => 'require|length:3,30',
|
'username' => 'require|length:3,30',
|
||||||
'password' => 'require|length:3,30',
|
'password' => 'require|length:3,30',
|
||||||
'__token__' => 'require|token',
|
// '__token__' => 'require|token',
|
||||||
];
|
];
|
||||||
$data = [
|
$data = [
|
||||||
'username' => $username,
|
'username' => $username,
|
||||||
'password' => $password,
|
'password' => $password,
|
||||||
'__token__' => $token,
|
// '__token__' => $token,
|
||||||
];
|
];
|
||||||
if (Config::get('fastadmin.login_captcha')) {
|
if (Config::get('fastadmin.login_captcha')) {
|
||||||
$rule['captcha'] = 'require|captcha';
|
$rule['captcha'] = 'require|captcha';
|
||||||
|
@ -5,6 +5,7 @@ namespace app\admin\controller\auth;
|
|||||||
use addons\csmtable\library\xcore\xcore\utils\XcAdminSessionUtils;
|
use addons\csmtable\library\xcore\xcore\utils\XcAdminSessionUtils;
|
||||||
use app\admin\model\AuthGroup;
|
use app\admin\model\AuthGroup;
|
||||||
use app\common\controller\Backend;
|
use app\common\controller\Backend;
|
||||||
|
use bw\Common;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理员日志
|
* 管理员日志
|
||||||
@ -43,9 +44,18 @@ class Adminlog extends Backend
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//设置过滤方法
|
//设置过滤方法
|
||||||
$this->request->filter(['strip_tags', 'trim']);
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
if ($this->request->isAjax()) {
|
if ($this->request->isAjax()) {
|
||||||
|
// (Common::getQrcode([
|
||||||
|
// 'text' => time(),
|
||||||
|
// 'size' => 200,
|
||||||
|
// ]))['url'];
|
||||||
|
|
||||||
|
|
||||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
$isSuperAdmin = $this->auth->isSuperAdmin();
|
$isSuperAdmin = $this->auth->isSuperAdmin();
|
||||||
$childrenAdminIds = $this->childrenAdminIds;
|
$childrenAdminIds = $this->childrenAdminIds;
|
||||||
@ -64,6 +74,11 @@ class Adminlog extends Backend
|
|||||||
|
|
||||||
return json($result);
|
return json($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $this->view->fetch();
|
return $this->view->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,10 @@ use think\Url;
|
|||||||
class Activity extends Backend
|
class Activity extends Backend
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $noNeedLogin = ['miniqrcode'];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activity模型对象
|
* Activity模型对象
|
||||||
* @var \app\admin\model\school\activity\Activity
|
* @var \app\admin\model\school\activity\Activity
|
||||||
|
@ -34,12 +34,12 @@ class OrderCode extends BaseModel
|
|||||||
|
|
||||||
public function getCodeimageAttr($value, $data)
|
public function getCodeimageAttr($value, $data)
|
||||||
{
|
{
|
||||||
if (!empty($value)) return cdnurl($value, true);
|
if (!empty($value)) return cdnurl($value, request()->domain());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCodeoneimageAttr($value, $data)
|
public function getCodeoneimageAttr($value, $data)
|
||||||
{
|
{
|
||||||
if (!empty($value)) return cdnurl($value, true);
|
if (!empty($value)) return cdnurl($value, request()->domain());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ return [
|
|||||||
//插件纯净模式,插件启用后是否删除插件目录的application、public和assets文件夹
|
//插件纯净模式,插件启用后是否删除插件目录的application、public和assets文件夹
|
||||||
'addon_pure_mode' => true,
|
'addon_pure_mode' => true,
|
||||||
//允许跨域的域名,多个以,分隔
|
//允许跨域的域名,多个以,分隔
|
||||||
'cors_request_domain' => 'localhost,127.0.0.1,testy1.hschool.com.cn',
|
'cors_request_domain' => 'localhost,127.0.0.1,testy1.hschool.com.cn,qingchunta.hschool.com.cn',
|
||||||
//版本号
|
//版本号
|
||||||
'version' => '1.5.2.20240906',
|
'version' => '1.5.2.20240906',
|
||||||
//API接口地址
|
//API接口地址
|
||||||
|
@ -9,8 +9,8 @@ return [
|
|||||||
/**
|
/**
|
||||||
* CDN地址
|
* CDN地址
|
||||||
*/
|
*/
|
||||||
// 'cdnurl' => 'https://testy1.hschool.com.cn',
|
'cdnurl' => 'https://qingchunta.hschool.com.cn',
|
||||||
'cdnurl' => '',
|
//'cdnurl' => '',
|
||||||
/**
|
/**
|
||||||
* 文件保存格式
|
* 文件保存格式
|
||||||
*/
|
*/
|
||||||
|
60
code_zip.php
Normal file
60
code_zip.php
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
//本脚本为将特定目录下的所有源码文件去掉空格、空行,并在当前脚本所在位置生成一个docx文件,里面是所有源码字符串的集合,用来提供申请软著的源码文件。
|
||||||
|
|
||||||
|
|
||||||
|
//源码文件路径(可多个)
|
||||||
|
$paths = [
|
||||||
|
'F:\code_project\back_end\php\git_depository\new-diverse-youth-night-school-backend\NewDiverseYouthNightSchool\application\api\controller\school\newactivity',
|
||||||
|
'F:\code_project\back_end\php\git_depository\new-diverse-youth-night-school-backend\NewDiverseYouthNightSchool\application\api\controller\school\newworker',
|
||||||
|
'F:\code_project\back_end\php\git_depository\new-diverse-youth-night-school-backend\NewDiverseYouthNightSchool\application\api\controller\school\NewActivity.php',
|
||||||
|
];
|
||||||
|
//输出文件路径
|
||||||
|
$out_path = '.\out.docx';
|
||||||
|
//源码文件后缀数组
|
||||||
|
$exts = ["php","js","html"];
|
||||||
|
//过滤的正则
|
||||||
|
//去掉空格、空行
|
||||||
|
//$filter = '/\s(?=\s)/';
|
||||||
|
//保留原格式,包括其他行的回车换行符,只去除无内容的行
|
||||||
|
$filter = '/\s(?!\S)/';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//遍历目录下所有文件(递归函数遍历文件数,不漏掉深层文件)
|
||||||
|
function get_all_files($path)
|
||||||
|
{
|
||||||
|
$files = array();
|
||||||
|
if (is_dir($path)) {
|
||||||
|
$fh = opendir($path);
|
||||||
|
while (false !== ($file = readdir($fh))) {
|
||||||
|
if ($file != '.' && $file != '..') {
|
||||||
|
if (is_dir($path . '/' . $file)) {
|
||||||
|
$files = array_merge($files, get_all_files($path . '/' . $file));
|
||||||
|
} else {
|
||||||
|
$files[] = $path . '/' . $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
//源码字符串
|
||||||
|
$str = '';
|
||||||
|
$files = [];
|
||||||
|
foreach ($paths as $path) {
|
||||||
|
$files = array_merge($files, get_all_files($path));
|
||||||
|
}
|
||||||
|
//遍历目录下所有文件
|
||||||
|
foreach ($files as $file) {
|
||||||
|
//判断文件后缀是否在数组中
|
||||||
|
if (in_array(substr(strrchr($file, '.'), 1), $exts)) {
|
||||||
|
//得到文件内容
|
||||||
|
$file_content = file_get_contents($file);
|
||||||
|
//去掉空格、空行
|
||||||
|
$file_content = preg_replace($filter, '', $file_content);
|
||||||
|
$str .= $file_content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//写入文件
|
||||||
|
if($str)file_put_contents($out_path, $str);
|
Loading…
x
Reference in New Issue
Block a user