Merge pull request '统一使用真实IP获取方式' (#242) from dev into main
Reviewed-on: #242
This commit is contained in:
commit
ee6ab27c87
@ -62,7 +62,7 @@ class OperationLogMiddleware implements MiddlewareInterface
|
|||||||
$systemLog->url = $request->url(true);
|
$systemLog->url = $request->url(true);
|
||||||
$systemLog->type = $request->post()?'POST':'GET';
|
$systemLog->type = $request->post()?'POST':'GET';
|
||||||
$systemLog->params = json_encode($params, true);
|
$systemLog->params = json_encode($params, true);
|
||||||
$systemLog->ip = $request->getRemoteIp();
|
$systemLog->ip = $request->getRealIp();
|
||||||
// $systemLog->result = $response->getContent();
|
// $systemLog->result = $response->getContent();
|
||||||
$systemLog->save();
|
$systemLog->save();
|
||||||
return $handler($request);
|
return $handler($request);
|
||||||
|
2
app/common/cache/AdminAccountSafeCache.php
vendored
2
app/common/cache/AdminAccountSafeCache.php
vendored
@ -14,7 +14,7 @@ class AdminAccountSafeCache extends BaseCache
|
|||||||
public function __construct($prefix = 'admin_')
|
public function __construct($prefix = 'admin_')
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$ip = \request()->getLocalIp();
|
$ip = \request()->getRealIp();
|
||||||
// $this->key = $this->tagName . $ip;
|
// $this->key = $this->tagName . $ip;
|
||||||
$this->key = $prefix . $ip;
|
$this->key = $prefix . $ip;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user