Browse Source

improve dir data get

master
filesite 6 months ago
parent
commit
2583c4e5dc
  1. 15
      plugins/Common.php

15
plugins/Common.php

@ -222,7 +222,6 @@ Class Common { @@ -222,7 +222,6 @@ Class Common {
$dirs_after_delete = $friends_dirs;
if (in_array($share_dir, $friends_dirs)) {
$dirs_after_delete = array_diff($friends_dirs, array($share_dir));
$dirs_after_delete = array_values($dirs_after_delete);
}else {
return true;
}
@ -333,6 +332,16 @@ Class Common { @@ -333,6 +332,16 @@ Class Common {
return $username;
}
public static function dictToArray($dict) {
$arr = array();
foreach($dict as $key => $value) {
array_push($arr, $value);
}
return $arr;
}
//从自己的目录里获取收藏夹映射关系
//返回:数组
public static function getMyDirs($cellphone, $username){
@ -351,7 +360,9 @@ Class Common { @@ -351,7 +360,9 @@ Class Common {
if (file_exists($cache_filename)) {
$mapContent = file_get_contents($cache_filename);
$map = json_decode($mapContent);
$map = array_values($map);
if (is_object($map)) {
$map = self::dictToArray($map);
}
}
}

Loading…
Cancel
Save