perf: 签到设置,有些客户服务器安全体系会拦截 curl -sSL 关键字,优化为base64返回

This commit is contained in:
weifs 2024-02-22 11:02:32 +08:00
parent 96438604ee
commit 8d121d4056
2 changed files with 6 additions and 0 deletions

View File

@ -389,6 +389,9 @@ class SystemController extends AbstractController
$setting['edit'] = $setting['edit'] ?: 'close';
$setting['modes'] = is_array($setting['modes']) ? $setting['modes'] : [];
$setting['cmd'] = "curl -sSL '" . Base::fillUrl("api/public/checkin/install?key={$setting['key']}") . "' | sh";
if (Base::judgeClientVersion('0.34.67')) {
$setting['cmd'] = base64_encode($setting['cmd']);
}
//
return Base::retSuccess('success', $setting ?: json_decode('{}'));
}

View File

@ -157,6 +157,9 @@ export default {
$A.messageSuccess('修改成功');
}
this.formData = data;
try {
this.formData.cmd = atob(this.formData.cmd);
} catch (error) {}
this.formDatum_bak = $A.cloneJSON(this.formData);
}).catch(({msg}) => {
if (save) {