mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-02-27 10:00:25 +00:00
update admin
This commit is contained in:
parent
7a27c663fe
commit
6b524aefb5
@ -2,8 +2,21 @@
|
|||||||
return
|
return
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
'menu_name' => '应用中心',
|
'menu_name' => '概况',
|
||||||
'menu_key' => 'overview',
|
'menu_key' => 'overview',
|
||||||
|
'menu_type' => 1,
|
||||||
|
'icon' => 'element-Monitor',
|
||||||
|
'api_url' => '',
|
||||||
|
'router_path' => 'overview',
|
||||||
|
'view_path' => 'index/overview',
|
||||||
|
'methods' => '',
|
||||||
|
'sort' => 100,
|
||||||
|
'status' => 1,
|
||||||
|
'is_show' => 0,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'menu_name' => '应用中心',
|
||||||
|
'menu_key' => 'app_center',
|
||||||
'menu_type' => 0,
|
'menu_type' => 0,
|
||||||
'icon' => 'iconfont-icona-shouyediannao',
|
'icon' => 'iconfont-icona-shouyediannao',
|
||||||
'api_url' => '',
|
'api_url' => '',
|
||||||
|
|||||||
@ -216,17 +216,20 @@ class CoreAddonCloudService extends CoreCloudBaseService
|
|||||||
];
|
];
|
||||||
|
|
||||||
// 获取文件大小
|
// 获取文件大小
|
||||||
$response = (new CloudService())->request('HEAD','cloud/build_download?' . http_build_query($query), [
|
$response = (new CloudService())->request('HEAD','cloud/download?' . http_build_query($query), [
|
||||||
'headers' => ['Range' => 'bytes=0-']
|
'headers' => ['Range' => 'bytes=0-']
|
||||||
]);
|
]);
|
||||||
$length = $response->getHeader('Content-range');
|
$length = $response->getHeader('Content-range');
|
||||||
|
$length = (int)explode("/", $length[0])[1];
|
||||||
|
|
||||||
$temp_dir = runtime_path() . 'backup' . DIRECTORY_SEPARATOR . 'addon_download' . DIRECTORY_SEPARATOR . uniqid() . DIRECTORY_SEPARATOR;
|
$temp_dir = runtime_path() . 'backup' . DIRECTORY_SEPARATOR . 'addon_download' . DIRECTORY_SEPARATOR . uniqid() . DIRECTORY_SEPARATOR;
|
||||||
|
dir_mkdir($temp_dir);
|
||||||
|
|
||||||
$zip_file = $temp_dir . $addon . '.zip';
|
$zip_file = $temp_dir . $addon . '.zip';
|
||||||
$zip_resource = fopen($zip_file, 'W');
|
$zip_resource = fopen($zip_file, 'w');
|
||||||
|
|
||||||
$response = (new CloudService())->request('GET','cloud/download?' . http_build_query($query), [
|
$response = (new CloudService())->request('GET','cloud/download?' . http_build_query($query), [
|
||||||
'headers' => ['Range' => "bytes=0-${$length}"]
|
'headers' => ['Range' => "bytes=0-{$length}"]
|
||||||
]);
|
]);
|
||||||
fwrite($zip_resource, $response->getBody());
|
fwrite($zip_resource, $response->getBody());
|
||||||
fclose($zip_resource);
|
fclose($zip_resource);
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class CoreAuthService extends BaseNiucloudClient
|
|||||||
{
|
{
|
||||||
$auth_info = $this->httpGet('authinfo', ['code' => $this->code, 'secret' => $this->secret]);
|
$auth_info = $this->httpGet('authinfo', ['code' => $this->code, 'secret' => $this->secret]);
|
||||||
if(!empty($auth_info['data'])){
|
if(!empty($auth_info['data'])){
|
||||||
$auth_info['data']['address_type'] = $this->diffDomain($_SERVER['HTTP_HOST'], $auth_info['data']['site_address']);
|
$auth_info['data']['address_type'] = $this->diffDomain($auth_info['data']['site_address'], $_SERVER['HTTP_HOST']);
|
||||||
}
|
}
|
||||||
return $auth_info;
|
return $auth_info;
|
||||||
}
|
}
|
||||||
@ -40,6 +40,7 @@ class CoreAuthService extends BaseNiucloudClient
|
|||||||
public function diffDomain($domain, $child_domain){
|
public function diffDomain($domain, $child_domain){
|
||||||
$child_domain = str_replace('http://', '', $child_domain);
|
$child_domain = str_replace('http://', '', $child_domain);
|
||||||
$child_domain = str_replace('https://', '', $child_domain);
|
$child_domain = str_replace('https://', '', $child_domain);
|
||||||
|
|
||||||
if($domain == $child_domain)
|
if($domain == $child_domain)
|
||||||
return true;
|
return true;
|
||||||
if(strstr($child_domain, $domain) === false )
|
if(strstr($child_domain, $domain) === false )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user