mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-12 19:02:49 +00:00
update niucloud
This commit is contained in:
parent
9c5cd006fb
commit
e29a0030fc
@ -49,10 +49,10 @@ class Dict extends BaseAdminController
|
|||||||
*/
|
*/
|
||||||
public function add(){
|
public function add(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
["name",""],
|
["name",""],
|
||||||
["key",""],
|
["key",""],
|
||||||
["memo",""],
|
["memo",""],
|
||||||
|
["dictionary", ""]
|
||||||
]);
|
]);
|
||||||
// $this->validate($data, 'app\validate\dict\Dict.add');
|
// $this->validate($data, 'app\validate\dict\Dict.add');
|
||||||
$id = (new DictService())->add($data);
|
$id = (new DictService())->add($data);
|
||||||
@ -66,10 +66,9 @@ class Dict extends BaseAdminController
|
|||||||
*/
|
*/
|
||||||
public function edit($id){
|
public function edit($id){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
["name",""],
|
["name",""],
|
||||||
["key",""],
|
["key",""],
|
||||||
["memo",""],
|
["memo",""],
|
||||||
|
|
||||||
]);
|
]);
|
||||||
// $this->validate($data, 'app\validate\dict\Dict.edit');
|
// $this->validate($data, 'app\validate\dict\Dict.edit');
|
||||||
(new DictService())->edit($id, $data);
|
(new DictService())->edit($id, $data);
|
||||||
|
|||||||
@ -13,17 +13,6 @@ return [
|
|||||||
'status' => 1,
|
'status' => 1,
|
||||||
'is_show' => 0,
|
'is_show' => 0,
|
||||||
'children' => [
|
'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_name' => '插件管理',
|
||||||
'menu_key' => 'app_manage_store',
|
'menu_key' => 'app_manage_store',
|
||||||
@ -33,7 +22,7 @@ return [
|
|||||||
'router_path' => 'app_store',
|
'router_path' => 'app_store',
|
||||||
'view_path' => 'index/store',
|
'view_path' => 'index/store',
|
||||||
'methods' => 'get',
|
'methods' => 'get',
|
||||||
'sort' => 20,
|
'sort' => 40,
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'is_show' => 1
|
'is_show' => 1
|
||||||
],
|
],
|
||||||
@ -49,6 +38,19 @@ return [
|
|||||||
'sort' => 30,
|
'sort' => 30,
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'is_show' => 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
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function downloadAddon(string $addon, string $version) {
|
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 = [
|
$query = [
|
||||||
'authorize_code' => $this->auth_code,
|
'authorize_code' => $this->auth_code,
|
||||||
'addon_name' => $addon,
|
'addon_name' => $addon,
|
||||||
'addon_version' => $version,
|
'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), [
|
$response = (new CloudService())->request('HEAD','cloud/download?' . http_build_query($query), [
|
||||||
'headers' => ['Range' => 'bytes=0-']
|
'headers' => ['Range' => 'bytes=0-']
|
||||||
|
|||||||
@ -255,7 +255,6 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
|||||||
}
|
}
|
||||||
|
|
||||||
Cache::set('install_task', null);
|
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", []);
|
Cache::set("local_install_addons", []);
|
||||||
//执行命令
|
//执行命令
|
||||||
//执行插件安装方法
|
//执行插件安装方法
|
||||||
$class = "addon\\" . $this->addon . "\\" . 'Manage';
|
$class = "addon\\" . $this->addon . "\\" . 'Addon';
|
||||||
if (class_exists($class)) {
|
if (class_exists($class)) {
|
||||||
(new $class())->install();
|
(new $class())->install();
|
||||||
}
|
}
|
||||||
@ -529,7 +528,7 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
|||||||
public function uninstall()
|
public function uninstall()
|
||||||
{
|
{
|
||||||
//执行插件卸载方法
|
//执行插件卸载方法
|
||||||
$class = "addon\\" . $this->addon . "\\" . 'Manage';
|
$class = "addon\\" . $this->addon . "\\" . 'Addon';
|
||||||
if (class_exists($class)) {
|
if (class_exists($class)) {
|
||||||
(new $class())->uninstall();
|
(new $class())->uninstall();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class CoreWeappCloudService extends CoreCloudBaseService
|
|||||||
'do' => 1,
|
'do' => 1,
|
||||||
'timestamp' => time()
|
'timestamp' => time()
|
||||||
];
|
];
|
||||||
(new CloudService())->httpPost('cloud/weapp?' . http_build_query($query), [
|
$response = (new CloudService())->httpPost('cloud/weapp?' . http_build_query($query), [
|
||||||
'multipart' => [
|
'multipart' => [
|
||||||
[
|
[
|
||||||
'name' => 'file',
|
'name' => 'file',
|
||||||
@ -86,6 +86,8 @@ class CoreWeappCloudService extends CoreCloudBaseService
|
|||||||
// 删除临时文件
|
// 删除临时文件
|
||||||
del_target_dir(runtime_path() . 'backup' . DIRECTORY_SEPARATOR . 'weapp', true);
|
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'] ];
|
return ['key' => $query['timestamp'] ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ class CoreWechatConfigService extends BaseCoreService
|
|||||||
*/
|
*/
|
||||||
public function getWechatStaticInfo(){
|
public function getWechatStaticInfo(){
|
||||||
// $domain = request()->domain();
|
// $domain = request()->domain();
|
||||||
$wap_domain = (new CoreSysConfigService())->getSceneDomain()['wap_domain'] ?? '';
|
$wap_domain = (new CoreSysConfigService())->getSceneDomain()['wap_url'] ?? '';
|
||||||
$wap_domain_array = explode('/', $wap_domain);
|
$wap_domain_array = explode('/', $wap_domain);
|
||||||
if(count($wap_domain_array) > 2){
|
if(count($wap_domain_array) > 2){
|
||||||
$wap_domain = $wap_domain_array[0].'/'.$wap_domain_array[1].'/'.$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'),
|
'port' => env('redis.port', '6379'),
|
||||||
// 密码
|
// 密码
|
||||||
'password' => env('redis.redis_password', ''),
|
'password' => env('redis.redis_password', '123456'),
|
||||||
// 缓存有效期 0表示永久缓存
|
// 缓存有效期 0表示永久缓存
|
||||||
'expire' => 0 ,
|
'expire' => 0 ,
|
||||||
// 缓存前缀
|
// 缓存前缀
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'version' => '0.0.4',
|
'version' => '0.0.5',
|
||||||
'code' => '202310240001'
|
'code' => '202311150001'
|
||||||
];
|
];
|
||||||
|
|||||||
@ -224,7 +224,7 @@ class Alipay extends BasePay
|
|||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
//todo 这儿可以抛出错误
|
//todo 这儿可以抛出错误
|
||||||
return false;
|
throw new PayException($result['msg']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,4 +376,4 @@ class Alipay extends BasePay
|
|||||||
{
|
{
|
||||||
return ['url' => $params->getHeader('Location')[0]];
|
return ['url' => $params->getHeader('Location')[0]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace core\pay;
|
namespace core\pay;
|
||||||
|
|
||||||
|
use core\exception\PayException;
|
||||||
use core\loader\Storage;
|
use core\loader\Storage;
|
||||||
use Psr\Http\Message\MessageInterface;
|
use Psr\Http\Message\MessageInterface;
|
||||||
use Yansongda\Supports\Collection;
|
use Yansongda\Supports\Collection;
|
||||||
@ -158,12 +159,16 @@ abstract class BasePay extends Storage
|
|||||||
public function returnFormat($param)
|
public function returnFormat($param)
|
||||||
{
|
{
|
||||||
if ($param instanceof MessageInterface) {
|
if ($param instanceof MessageInterface) {
|
||||||
return $param->getBody()->getContents();
|
$return_value = $param->getBody()->getContents();
|
||||||
} else if ($param instanceof Collection) {
|
} else if ($param instanceof Collection) {
|
||||||
return $param->all();
|
$return_value = $param->all();
|
||||||
} else {
|
} 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)]);
|
$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']);
|
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