优化接口以及后台页面样式

This commit is contained in:
2026-03-31 15:37:32 +08:00
parent 2868899253
commit 520e950dc5
28 changed files with 1241 additions and 311 deletions

View File

@@ -115,6 +115,24 @@ class Auth extends Api
}
$username = trim(strval($request->get('username', $request->post('username', ''))));
// 兼容querystring 中未编码的 '+' 会被解析为空格application/x-www-form-urlencoded 规则)
// 例如:/api/v1/temLogin?username=+607... 期望保留 '+',则从原始 querystring 提取并还原
if ($username !== '' && str_contains($username, ' ')) {
$qs = $request->queryString();
if (is_string($qs) && $qs !== '') {
foreach (explode('&', $qs) as $pair) {
if ($pair === '' || !str_contains($pair, '=')) {
continue;
}
[$k, $v] = explode('=', $pair, 2);
if (rawurldecode($k) === 'username') {
// 先把 %xx 解码;注意这里不把 '+' 当空格处理,从而保留 '+'
$username = trim(rawurldecode($v));
break;
}
}
}
}
if ($username === '') {
return $this->error(__('Parameter username can not be empty'));
}