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; }