diff --git a/conf/app.php b/conf/app.php index 908b468..c84836e 100644 --- a/conf/app.php +++ b/conf/app.php @@ -43,6 +43,9 @@ return array( 'contact' => 'FileSite视频网站订制联系:FileSite.io', ), + //md5加密前缀 + 'md5Prefix' => 'some_code_here', + //后台管理相关配置 'admin' => array( 'username' => 'filesite', diff --git a/controller/ApiController.php b/controller/ApiController.php index e14a0cf..9e50589 100644 --- a/controller/ApiController.php +++ b/controller/ApiController.php @@ -365,7 +365,7 @@ Class ApiController extends Controller { $ip = $this->getUserIp(); $logDir = __DIR__ . '/../runtime/admin/'; - $logFile = "{$logDir}{$ip}.cache"; + $logFile = "{$logDir}" . md5(FSC::$app['config']['md5Prefix'] . $ip) . ".cache"; try { if (file_exists($logFile)) { @@ -379,7 +379,7 @@ Class ApiController extends Controller { protected function saveAdmUserData($data) { $ip = $this->getUserIp(); $logDir = __DIR__ . '/../runtime/admin/'; - $logFile = "{$logDir}{$ip}.cache"; + $logFile = "{$logDir}" . md5(FSC::$app['config']['md5Prefix'] . $ip) . ".cache"; if (!is_dir($logDir)) { //try to mkdir @mkdir($logDir, 0700, true); }