one($id); if (!$upload) { return false; } if ($upload['save_type'] == 1) { return false; } if (!$upload['yun']) { return false; } $config = Dever::db('upload/yun')->one($upload['yun']); if (!$config) { return false; } return $config; } public function view($file) { $data = parse_url($file); $path = ltrim($data['path'], '/'); $temp = explode('/', $path); $config = $this->get($temp[0]); if (!$config) { return $file; } return Dever::load('upload/lib/yun')->getMethod($config['type'])->view($config, $file); } public function getMethod($type) { if ($type == 1) { $method = 'oss'; } else { $method = 'qiniu'; } return Dever::load('upload/lib/view/' . $method); } }