From fce99ae31a7015b21a7593fb5f95f054fa012c00 Mon Sep 17 00:00:00 2001 From: filesite Date: Sun, 5 May 2024 13:26:48 +0000 Subject: [PATCH] improve user login --- plugins/Common.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/Common.php b/plugins/Common.php index 4bc8166..f7d88b3 100644 --- a/plugins/Common.php +++ b/plugins/Common.php @@ -56,7 +56,15 @@ Class Common { //判断用户数据目录是否存在 public static function getUserDataDir($cellphone) { $rootDir = __DIR__ . '/../www/' . FSC::$app['config']['content_directory']; - $userDir = "{$rootDir}{$cellphone}"; + + $username = $cellphone; + + //账号映射,手机号码转换成4位数字的短账号 + if (!empty(FSC::$app['config']['tajia_user_map']) && !empty(FSC::$app['config']['tajia_user_map'][$username])) { + $username = FSC::$app['config']['tajia_user_map'][$username]; + } + + $userDir = "{$rootDir}{$username}"; return is_dir($userDir) ? $userDir : false; }