Browse Source

bug fix: can not switch back to the default dir

master
filesite 4 weeks ago
parent
commit
508913bf70
  1. 9
      plugins/Common.php
  2. 2
      themes/tajian/views/my/switchdir.php

9
plugins/Common.php

@ -376,7 +376,14 @@ Class Common {
array_merge($map, $tajian_user_map[$cellphone]) : array_push($map, $tajian_user_map[$cellphone]); array_merge($map, $tajian_user_map[$cellphone]) : array_push($map, $tajian_user_map[$cellphone]);
} }
return array_values(array_unique($map)); $dirs = array_values(array_unique($map));
//把自己的默认id插入到最前面,确保在切换目录的时候可选
if (!in_array($my_id, $dirs)) {
array_unshift($dirs, $my_id);
}
return $dirs;
} }
public static function getNicknameByDir($dir, $username){ public static function getNicknameByDir($dir, $username){

2
themes/tajian/views/my/switchdir.php

@ -32,7 +32,7 @@ eof;
} }
}else { }else {
echo <<<eof echo <<<eof
<li><a href="/site/logout">退出重新登录</a></li> <li>你还没有子账号,<a href="/my/createdir">马上创建</a></li>
eof; eof;
} }
?> ?>

Loading…
Cancel
Save