diff --git a/admin/cloud/template/oauth_qcos.htm b/admin/cloud/template/oauth_qcos.htm index 30f7a3e..041515b 100644 --- a/admin/cloud/template/oauth_qcos.htm +++ b/admin/cloud/template/oauth_qcos.htm @@ -112,7 +112,7 @@ } jQuery.getJSON('{BASESCRIPT}?mod=cloud&op=oauth&do=getBucket', { id: id, key: key,region:region,bz:bz }, function(json) { if(json.error){ - showmessage(json.error); + showmessage(json.error,'error',3000,1); }else{ if(json.length > 0) { var html = ''; @@ -148,4 +148,4 @@ } - \ No newline at end of file + diff --git a/core/class/io/io_QCOS.php b/core/class/io/io_QCOS.php index e32bb37..0f1b9fb 100644 --- a/core/class/io/io_QCOS.php +++ b/core/class/io/io_QCOS.php @@ -207,8 +207,12 @@ class io_Qcos extends io_api try { //请求成功 if ($list = $qcos->listBuckets()) { - foreach ($list['Buckets'][0] as $value) { - $re[] = $value['Name']; + if (isset($list['Buckets']) && !empty($list['Buckets'][0]['Bucket'])) { + foreach ($list['Buckets'][0]['Bucket'] as $value) { + $re[] = $value['Name']; + } + } else { + return array('error' => 'Bucket为空!'); } } else { return array(); diff --git a/core/class/table/table_resources.php b/core/class/table/table_resources.php index 2c1a1bb..552e444 100644 --- a/core/class/table/table_resources.php +++ b/core/class/table/table_resources.php @@ -885,16 +885,9 @@ class table_resources extends dzz_table //文件图标信息 $fileinfo['img'] = self::get_icosinfo_by_rid($fileinfo['rid']); if ($fileinfo['type'] == 'folder') { - $fileinfo['type'] = '文件夹'; if ($currentfolder = C::t('folder')->fetch($fileinfo['oid'])) { $fileinfo['isgroup'] = ($currentfolder['flag'] == 'organization') ? true : false; } - } elseif ($fileinfo['type'] == 'link') { - $fileinfo['type'] = lang('type_link'); - } elseif ($fileinfo['ext']) { - $fileinfo['type'] = getFileTypeName($fileinfo['type'], $fileinfo['ext']); - } else { - $fileinfo['type'] = lang('undefined_file_type'); } if ($contains) { //文件大小信息 @@ -911,6 +904,7 @@ class table_resources extends dzz_table } } + $fileinfo['type'] = getFileTypeName($fileinfo['type'], $fileinfo['ext']); } return $fileinfo; @@ -1058,4 +1052,4 @@ function get_resources_info_by_fid($fid) { return DB::fetch_first("select * from %t where oid = %d and `type` = 'folder' ", array($this->_table, $fid)); } -} \ No newline at end of file +}