mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-12 10:52:48 +00:00
update niucloud
This commit is contained in:
parent
9c5cd006fb
commit
e29a0030fc
@ -52,7 +52,7 @@ class Dict extends BaseAdminController
|
||||
["name",""],
|
||||
["key",""],
|
||||
["memo",""],
|
||||
|
||||
["dictionary", ""]
|
||||
]);
|
||||
// $this->validate($data, 'app\validate\dict\Dict.add');
|
||||
$id = (new DictService())->add($data);
|
||||
@ -69,7 +69,6 @@ class Dict extends BaseAdminController
|
||||
["name",""],
|
||||
["key",""],
|
||||
["memo",""],
|
||||
|
||||
]);
|
||||
// $this->validate($data, 'app\validate\dict\Dict.edit');
|
||||
(new DictService())->edit($id, $data);
|
||||
|
||||
@ -13,17 +13,6 @@ return [
|
||||
'status' => 1,
|
||||
'is_show' => 0,
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '应用管理',
|
||||
'menu_key' => 'app_manage_index',
|
||||
'menu_type' => 1,
|
||||
'icon' => '',
|
||||
'api_url' => '',
|
||||
'router_path' => '',
|
||||
'view_path' => 'index/app_manage',
|
||||
'methods' => 'get',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'menu_name' => '插件管理',
|
||||
'menu_key' => 'app_manage_store',
|
||||
@ -33,7 +22,7 @@ return [
|
||||
'router_path' => 'app_store',
|
||||
'view_path' => 'index/store',
|
||||
'methods' => 'get',
|
||||
'sort' => 20,
|
||||
'sort' => 40,
|
||||
'status' => 1,
|
||||
'is_show' => 1
|
||||
],
|
||||
@ -49,6 +38,19 @@ return [
|
||||
'sort' => 30,
|
||||
'status' => 1,
|
||||
'is_show' => 1
|
||||
],
|
||||
[
|
||||
'menu_name' => '应用管理',
|
||||
'menu_key' => 'app_manage_index',
|
||||
'menu_type' => 1,
|
||||
'icon' => '',
|
||||
'api_url' => '',
|
||||
'router_path' => '',
|
||||
'view_path' => 'index/app_manage',
|
||||
'methods' => 'get',
|
||||
'sort' => 10,
|
||||
'status' => 1,
|
||||
'is_show' => 0
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
@ -212,13 +212,18 @@ class CoreAddonCloudService extends CoreCloudBaseService
|
||||
* @return void
|
||||
*/
|
||||
public function downloadAddon(string $addon, string $version) {
|
||||
$action_token = (new CoreModuleService())->getActionToken('download', ['data' => ['app_key' => $addon, 'version' => $version]]);
|
||||
if (isset($action_token['code']) && $action_token['code'] != 1) {
|
||||
if ($action_token['code'] == 401) $action_token = (new CoreModuleService())->getActionToken('download', ['data' => ['app_key' => $addon, 'version' => $version]]);
|
||||
if ($action_token['code'] != 1) throw new CommonException($action_token['msg']);
|
||||
}
|
||||
|
||||
$query = [
|
||||
'authorize_code' => $this->auth_code,
|
||||
'addon_name' => $addon,
|
||||
'addon_version' => $version,
|
||||
// 'token' => (new CoreModuleService())->getActionToken('download', ['app_key' => $addon, 'version' => $version])
|
||||
'token' => $action_token['data']['token'] ?? ''
|
||||
];
|
||||
|
||||
// 获取文件大小
|
||||
$response = (new CloudService())->request('HEAD','cloud/download?' . http_build_query($query), [
|
||||
'headers' => ['Range' => 'bytes=0-']
|
||||
|
||||
@ -255,7 +255,6 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
||||
}
|
||||
|
||||
Cache::set('install_task', null);
|
||||
Cache::set($this->cache_key . '_install_check', null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -406,7 +405,7 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
||||
Cache::set("local_install_addons", []);
|
||||
//执行命令
|
||||
//执行插件安装方法
|
||||
$class = "addon\\" . $this->addon . "\\" . 'Manage';
|
||||
$class = "addon\\" . $this->addon . "\\" . 'Addon';
|
||||
if (class_exists($class)) {
|
||||
(new $class())->install();
|
||||
}
|
||||
@ -529,7 +528,7 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
||||
public function uninstall()
|
||||
{
|
||||
//执行插件卸载方法
|
||||
$class = "addon\\" . $this->addon . "\\" . 'Manage';
|
||||
$class = "addon\\" . $this->addon . "\\" . 'Addon';
|
||||
if (class_exists($class)) {
|
||||
(new $class())->uninstall();
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ class CoreWeappCloudService extends CoreCloudBaseService
|
||||
'do' => 1,
|
||||
'timestamp' => time()
|
||||
];
|
||||
(new CloudService())->httpPost('cloud/weapp?' . http_build_query($query), [
|
||||
$response = (new CloudService())->httpPost('cloud/weapp?' . http_build_query($query), [
|
||||
'multipart' => [
|
||||
[
|
||||
'name' => 'file',
|
||||
@ -86,6 +86,8 @@ class CoreWeappCloudService extends CoreCloudBaseService
|
||||
// 删除临时文件
|
||||
del_target_dir(runtime_path() . 'backup' . DIRECTORY_SEPARATOR . 'weapp', true);
|
||||
|
||||
if (isset($response['code']) && $response['code'] == 0) throw new CommonException($response['msg']);
|
||||
|
||||
return ['key' => $query['timestamp'] ];
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ class CoreWechatConfigService extends BaseCoreService
|
||||
*/
|
||||
public function getWechatStaticInfo(){
|
||||
// $domain = request()->domain();
|
||||
$wap_domain = (new CoreSysConfigService())->getSceneDomain()['wap_domain'] ?? '';
|
||||
$wap_domain = (new CoreSysConfigService())->getSceneDomain()['wap_url'] ?? '';
|
||||
$wap_domain_array = explode('/', $wap_domain);
|
||||
if(count($wap_domain_array) > 2){
|
||||
$wap_domain = $wap_domain_array[0].'/'.$wap_domain_array[1].'/'.$wap_domain_array[2];
|
||||
|
||||
@ -31,7 +31,7 @@ return [
|
||||
// 端口
|
||||
'port' => env('redis.port', '6379'),
|
||||
// 密码
|
||||
'password' => env('redis.redis_password', ''),
|
||||
'password' => env('redis.redis_password', '123456'),
|
||||
// 缓存有效期 0表示永久缓存
|
||||
'expire' => 0 ,
|
||||
// 缓存前缀
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'version' => '0.0.4',
|
||||
'code' => '202310240001'
|
||||
'version' => '0.0.5',
|
||||
'code' => '202311150001'
|
||||
];
|
||||
|
||||
@ -224,7 +224,7 @@ class Alipay extends BasePay
|
||||
];
|
||||
} else {
|
||||
//todo 这儿可以抛出错误
|
||||
return false;
|
||||
throw new PayException($result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace core\pay;
|
||||
|
||||
use core\exception\PayException;
|
||||
use core\loader\Storage;
|
||||
use Psr\Http\Message\MessageInterface;
|
||||
use Yansongda\Supports\Collection;
|
||||
@ -158,12 +159,16 @@ abstract class BasePay extends Storage
|
||||
public function returnFormat($param)
|
||||
{
|
||||
if ($param instanceof MessageInterface) {
|
||||
return $param->getBody()->getContents();
|
||||
$return_value = $param->getBody()->getContents();
|
||||
} else if ($param instanceof Collection) {
|
||||
return $param->all();
|
||||
$return_value = $param->all();
|
||||
} else {
|
||||
return $param;
|
||||
$return_value = $param;
|
||||
}
|
||||
if(isset($return_value['code'])){
|
||||
throw new PayException($return_value['message']);
|
||||
}
|
||||
return $return_value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -67,6 +67,7 @@ trait AccessToken
|
||||
{
|
||||
$access_token_info = $this->httpGet('auth', ['code' => $this->code, 'secret' => $this->secret, 'token' => $this->createToken(), 'redirect_uri' => $this->getDomain(false)]);
|
||||
if (isset($access_token_info['code']) && $access_token_info['code'] != 1) throw new NiucloudException($access_token_info['msg']);
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user