解决方法是避免使用文件管理器及scp的方法,在拷贝大文件时可以采用如下指令:
rsync -avP 源路径/ 目标路径/ |
Cloudreve 作者可能故意没有做全站分享文件搜索接口的开关,这就导致了某些项目或已分享的文件 由定向分享变成了全站共享,这是极其危险的!
既然官方没有预留开关,那我们就手动修改 网站的nginx配置文件,拦截掉某访问路径:
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改 #error_page 404 /404.html; #error_page 502 /502.html; #ERROR-PAGE-END #禁止搜索全站分享 location ~ /share/search(.*) { return 200 "{受GoogleAPI限制,暂关闭搜索接口。}"; #access_log /www/wwwlogs/c.qc.rs_purge_cache.log; } |
将以下命令 粘贴至 Windows PowerShell 回车,等待进度条滚完重启,别问为什么,问就是升级!
将Windows Server 2019评估转换为Windows Server 2019标准:
dism /online /set-edition:ServerStandard /productkey: N69G4-B89J2-4G8F4-WWYCC-J464C /accepteula
将Windows Server 2019评估转换为Windows Server 2019 Datacenter版本:
dism /online /set-edition:ServerDatacenter /productkey:WMDGN-G9PQG-XVVXX-R3X43-63DFG /accepteula
=============================================
OS Edition GVLK Key
Windows Server 2019 Datacenter WMDGN-G9PQG-XVVXX-R3X43-63DFG
Windows Server 2019 Standard N69G4-B89J2-4G8F4-WWYCC-J464C
Windows Server 2019 Essentials WVDHN-86M7X-466P6-VHXV7-YY726
Windows 10 Enterprise LTSC 2019 M7XTQ-FN8P6-TTKYV-9D4CC-J462D
Windows 10 Enterprise N LTSC 2019 92NFX-8DJQP-P6BBQ-THF9C-7CG2H
代码:
<?php
$device = $_GET['device'];//设备
if($device == null || $device == 'auto' || $device == 'AUTO'){
if(wp_is_mobile() == true){
$img_array = glob("Store/Pe/*.{gif,jpg,png}",GLOB_BRACE);
}else{
$img_array = glob("Store/Pc/*.{gif,jpg,png}",GLOB_BRACE);
}
}else{
if($device == 'pc' || $device == 'Pc' || $device == 'PC'){
$img_array = glob("Store/Pc/*.{gif,jpg,png}",GLOB_BRACE);
}else if($device == 'pe' || $device == 'Pe' || $device == 'PE'){
$img_array = glob("Store/Pe/*.{gif,jpg,png}",GLOB_BRACE);
}else{
$img_array = glob("Store/Pc/*.{gif,jpg,png}",GLOB_BRACE);
}
}
$img = array_rand($img_array);
header("Location:".$img_array[$img]);
//判断手机或者电脑
function wp_is_mobile() {
static $is_mobile = null;
if ( isset( $is_mobile ) ) {
return $is_mobile;
}
if ( empty($_SERVER['HTTP_USER_AGENT']) ) {
$is_mobile = false;
} elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false // many mobile devices (all iPhone, iPad, etc.)
|| strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false
|| strpos($_SERVER['HTTP_USER_AGENT'], 'Silk/') !== false
|| strpos($_SERVER['HTTP_USER_AGENT'], 'Kindle') !== false
|| strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== false
|| strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false
|| strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mobi') !== false ) {
$is_mobile = true;
} else {
$is_mobile = false;
}
return $is_mobile;
}
?>
将以上代码保存到网站根目录命名为api.php并在根目录创建一个Store文件夹里面含有Pc和Pe的子文件夹即可.
当下有个项目需要用到Base64编码解码工具,奈何后端decode时前端传入已经encode的base64字符串在后端decode后中文乱码! 层层步进追踪到底层代码发现自动给转为utf-16了,这里解决办法就是:
直接转为GBK转为UTF-8后调试发现中文已经可以正常decode;
roomname=new String(roomname.getBytes("GBK"),"UTF-8");
以上为解码时转换编码方式,编码与以上基本类似.
避坑: Base64对" "(空格)支持不友好,请使用String的replace(,);方法替换掉空格.