mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-10 09:52:48 +00:00
fix
This commit is contained in:
parent
643eadfd14
commit
54510e953d
@ -89,13 +89,6 @@ class ExceptionHandle extends Handle
|
||||
'previous' => $e->getPrevious(),
|
||||
] : [];
|
||||
|
||||
// 添加自定义异常处理机制
|
||||
if (strpos($e->getMessage(), 'open_basedir') !== false) {
|
||||
return fail('OPEN_BASEDIR_ERROR');
|
||||
}
|
||||
if (strpos($e->getMessage(), 'Allowed memory size of') !== false) {
|
||||
return fail('PHP_SCRIPT_RUNNING_OUT_OF_MEMORY');
|
||||
}
|
||||
if ($e instanceof DbException) {
|
||||
return fail(get_lang('DATA_GET_FAIL').':'.$e->getMessage(), [
|
||||
'file' => $e->getFile(),
|
||||
@ -122,17 +115,28 @@ class ExceptionHandle extends Handle
|
||||
}
|
||||
|
||||
private function handleException(Throwable $e) {
|
||||
// 添加自定义异常处理机制
|
||||
if (strpos($e->getMessage(), 'open_basedir') !== false) {
|
||||
return fail('OPEN_BASEDIR_ERROR');
|
||||
}
|
||||
if (strpos($e->getMessage(), 'Allowed memory size of') !== false) {
|
||||
return fail('PHP_SCRIPT_RUNNING_OUT_OF_MEMORY');
|
||||
}
|
||||
if (preg_match('/^(fopen|file_get_contents|file_put_contents|include|require)\((.+?)\):.*Permission denied/', $e->getMessage(), $matches)) {
|
||||
$filePath = $matches[2]; // 提取出来的文件路径
|
||||
return fail("请检查文件{$filePath}是否存在或权限是否正确");
|
||||
}
|
||||
$trace = array_map(function ($class){
|
||||
return str_replace('\\', '/', $class);
|
||||
}, array_column($e->getTrace(), 'class'));
|
||||
$debug = env("APP_DEBUG", false);
|
||||
|
||||
foreach ($trace as $class) {
|
||||
if (preg_match('#^addon/([^/]+)/#', $class, $matches)) {
|
||||
return fail("{$matches[1]}插件内{$class}第{$e->getLine()}行出现异常,异常信息:" .$e->getMessage());
|
||||
return fail("{$matches[1]}插件内{$class}第{$e->getLine()}行出现异常,异常信息:" .$e->getMessage(),$debug?$e->getTrace():[]);
|
||||
}
|
||||
}
|
||||
|
||||
$debug = env("APP_DEBUG", false);
|
||||
|
||||
return fail("{$trace[0]}第{$e->getLine()}行出现异常,异常信息:" .$e->getMessage(), $debug ? $e->getTrace() : []);
|
||||
}
|
||||
|
||||
@ -52,14 +52,23 @@ class Request extends \think\Request
|
||||
*/
|
||||
public function paramFilter($param, bool $filter = true)
|
||||
{
|
||||
if (!$param || !$filter || !is_string($param)) return $param;
|
||||
// 把数据过滤
|
||||
if (!$param || !$filter || !is_string($param)) {
|
||||
return $param;
|
||||
}
|
||||
|
||||
// 过滤危险标签
|
||||
$filter_rule = [
|
||||
"/<(\\/?)(script|i?frame|style|html|body|title|link|metaf|alert|font|object|\\?|\\%)([^>]*?)>/isU",
|
||||
"/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",
|
||||
"/<(\\/?)(script|iframe|frame|style|html|body|title|link|meta|alert|font|object|\\?|\\%)([^>]*?)>/isU",
|
||||
"/(<[^>]*?)on[a-zA-Z]+\s*=[\s\"'][^\"']*?([\s\"'][^>]*?>)/isU",
|
||||
"/\\b(select|join|where|drop|like|modify|rename|insert|update|table|database|alter|truncate|\'|\/\*|\.\.\/|\.\/|union|into|load_file|outfile)\\b/is"
|
||||
];
|
||||
return preg_replace($filter_rule, '', $param);
|
||||
|
||||
$replace = [
|
||||
'', // 移除整个危险标签
|
||||
'$1$2', // 仅移除 onxxx 属性,保留标签
|
||||
''
|
||||
];
|
||||
return preg_replace($filter_rule, $replace, $param);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,6 +98,7 @@ class Request extends \think\Request
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
* @param string $username
|
||||
@ -136,6 +146,7 @@ class Request extends \think\Request
|
||||
return $this->header(system_name('api_token_name'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取场景
|
||||
* @return array|string
|
||||
|
||||
@ -12,4 +12,4 @@
|
||||
return [
|
||||
// 默认输出类型
|
||||
'default_return_type' => 'json',
|
||||
];
|
||||
];
|
||||
@ -228,6 +228,21 @@ class Addon extends BaseAdminController
|
||||
return success(( new AddonService() )->getShowMarketingTools());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 统一展示 安装的插件 应用 营销工具等。。
|
||||
* @return Response
|
||||
*/
|
||||
public function showCustomer()
|
||||
{
|
||||
return success((new AddonService())->showCustomer());
|
||||
}
|
||||
public function getSpecialMenuList()
|
||||
{
|
||||
return success('SUCCESS', (new AddonService())->getSpecialMenuList());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页应用标签
|
||||
* @description 获取首页应用标签
|
||||
|
||||
@ -75,7 +75,7 @@ class AddonDevelop extends BaseAdminController
|
||||
/**
|
||||
* 开发插件更新
|
||||
* @description 开发插件更新
|
||||
* @param string $id
|
||||
* @param string $key
|
||||
* @return Response
|
||||
*/
|
||||
public function edit(string $key)
|
||||
@ -101,7 +101,7 @@ class AddonDevelop extends BaseAdminController
|
||||
/**
|
||||
* 删除开发插件
|
||||
* @description 删除开发插件
|
||||
* @param $key
|
||||
* @param string $key
|
||||
* @return Response
|
||||
*/
|
||||
public function del(string $key)
|
||||
@ -114,7 +114,7 @@ class AddonDevelop extends BaseAdminController
|
||||
* 校验key是否被占用
|
||||
* @description 校验key是否被占用
|
||||
* @param $key
|
||||
* @return void
|
||||
* @return Response
|
||||
*/
|
||||
public function checkKey($key)
|
||||
{
|
||||
|
||||
@ -78,7 +78,7 @@ class Backup extends BaseAdminController
|
||||
/**
|
||||
* 恢复备份
|
||||
* @description 恢复备份
|
||||
* @return Response
|
||||
* @return array
|
||||
*/
|
||||
public function restoreBackup()
|
||||
{
|
||||
@ -107,7 +107,7 @@ class Backup extends BaseAdminController
|
||||
/**
|
||||
* 手动备份
|
||||
* @description 手动备份
|
||||
* @return Response
|
||||
* @return array
|
||||
*/
|
||||
public function manualBackup()
|
||||
{
|
||||
|
||||
@ -12,7 +12,11 @@
|
||||
namespace app\adminapi\controller\auth;
|
||||
|
||||
use app\service\admin\auth\AuthService;
|
||||
use app\service\admin\auth\AuthSiteService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\Response;
|
||||
|
||||
|
||||
@ -31,12 +35,7 @@ class Auth extends BaseAdminController
|
||||
*/
|
||||
public function authMenuList()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'status', 1 ],
|
||||
[ 'is_tree', 1 ],
|
||||
[ 'is_button', 1 ]
|
||||
]);
|
||||
return success(( new AuthService() )->getAuthMenuList($data[ 'status' ], $data[ 'is_tree' ], $data[ 'is_button' ]));
|
||||
return success((new AuthService())->getAuthMenuList(1, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
namespace app\adminapi\controller\channel;
|
||||
|
||||
use app\dict\channel\AppDict;
|
||||
use app\service\admin\channel\AppService;
|
||||
use app\service\admin\channel\H5Service;
|
||||
use core\base\BaseAdminController;
|
||||
@ -43,8 +44,117 @@ class App extends BaseAdminController
|
||||
$data = $this->request->params([
|
||||
['wechat_app_id', ""],
|
||||
['wechat_app_secret', ""],
|
||||
['android_app_key', ''],
|
||||
['application_id', ''],
|
||||
['uni_app_id', ''],
|
||||
['app_name', '']
|
||||
]);
|
||||
(new AppService())->setConfig($data);
|
||||
return success('SET_SUCCESS');
|
||||
}
|
||||
|
||||
public function versionList() {
|
||||
$data = $this->request->params([
|
||||
["platform",""],
|
||||
]);
|
||||
return success((new AppService())->getVersionPage($data));
|
||||
}
|
||||
|
||||
public function versionInfo($id) {
|
||||
return success((new AppService())->getVersionInfo($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加app版本
|
||||
* @description 添加app版本
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function add(){
|
||||
$data = $this->request->params([
|
||||
["version_code",""],
|
||||
["version_name",""],
|
||||
["version_desc",""],
|
||||
["platform",""],
|
||||
["is_forced_upgrade",0],
|
||||
["package_path", ""],
|
||||
["package_type", ""],
|
||||
["build", []],
|
||||
["cert", []],
|
||||
["upgrade_type", ""],
|
||||
]);
|
||||
$id = (new AppService())->addVersion($data);
|
||||
return success('ADD_SUCCESS', ['id' => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* app版本管理编辑
|
||||
* @description 编辑app版本
|
||||
* @param $id app版本id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function edit(int $id){
|
||||
$data = $this->request->params([
|
||||
["version_code",""],
|
||||
["version_name",""],
|
||||
["version_desc",""],
|
||||
["platform",""],
|
||||
["is_forced_upgrade",0],
|
||||
["package_path", ""],
|
||||
["package_type", ""],
|
||||
["build", []],
|
||||
["cert", []],
|
||||
["upgrade_type", ""],
|
||||
]);
|
||||
(new AppService())->editVersion($id, $data);
|
||||
return success('EDIT_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* app版本管理删除
|
||||
* @description 删除app版本
|
||||
* @param $id app版本id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function del(int $id){
|
||||
(new AppService())->delVersion($id);
|
||||
return success('DELETE_SUCCESS');
|
||||
}
|
||||
|
||||
public function appPlatform() {
|
||||
return success(AppDict::getAppPlatform());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取app生成日志
|
||||
*/
|
||||
public function buildLog(string $key) {
|
||||
return success((new AppService())->getBuildLog($key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布
|
||||
* @description 发布
|
||||
* @param $id app版本id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function release(int $id) {
|
||||
(new AppService())->release($id);
|
||||
return success('RELEASE_SUCCESS');
|
||||
}
|
||||
|
||||
public function generateSingCert() {
|
||||
$data = $this->request->params([
|
||||
['key_alias', ''],
|
||||
['key_password', ''],
|
||||
['store_password', ''],
|
||||
['limit', 30],
|
||||
['cn', ''],
|
||||
['o', ''],
|
||||
['ou', ''],
|
||||
['c', ''],
|
||||
['st', ''],
|
||||
['l', ''],
|
||||
]);
|
||||
return success(data:(new AppService())->generateSingCert($data));
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,6 +44,8 @@ class Config extends BaseAdminController
|
||||
$data = $this->request->params([
|
||||
['is_captcha', 0],
|
||||
['bg', ''],
|
||||
['login_logo', ''],
|
||||
['login_bg_img', ''],
|
||||
]);
|
||||
(new ConfigService())->setConfig($data);
|
||||
return success('MODIFY_SUCCESS');
|
||||
|
||||
@ -35,7 +35,7 @@ class Transfer extends BaseAdminController
|
||||
* 设置场景id
|
||||
* @description 设置场景id
|
||||
* @param $scene
|
||||
* @return void
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function setSceneId($scene){
|
||||
$data = $this->request->params([
|
||||
|
||||
@ -74,7 +74,7 @@ class Area extends BaseAdminController
|
||||
/**
|
||||
* 根据code获取地址信息
|
||||
* @description 根据code获取地址信息
|
||||
* @return void
|
||||
* @return Response
|
||||
*/
|
||||
public function areaByAreaCode(string $code) {
|
||||
return success((new AreaService())->getAreaByAreaCode($code));
|
||||
|
||||
@ -134,6 +134,7 @@ class Config extends BaseAdminController
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'key', '' ],
|
||||
[ 'amap_key', ''],
|
||||
[ 'is_open', 0 ], // 是否开启定位
|
||||
[ 'valid_time', 0 ] // 定位有效期/分钟,过期后将重新获取定位信息,0为不过期
|
||||
]);
|
||||
@ -187,6 +188,56 @@ class Config extends BaseAdminController
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置布局设置
|
||||
* @description 设置布局设置
|
||||
* @return Response
|
||||
*/
|
||||
public function setLayout()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'key', '' ],
|
||||
[ 'value', '' ],
|
||||
]);
|
||||
( new ConfigService() )->setLayout($data);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取布局设置
|
||||
* @description 获取布局设置
|
||||
* @return Response
|
||||
*/
|
||||
public function getLayout()
|
||||
{
|
||||
return success(data: ( new ConfigService() )->getLayout());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置色调设置
|
||||
* @description 设置色调设置
|
||||
* @return Response
|
||||
*/
|
||||
public function setThemeColor()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'key', '' ],
|
||||
[ 'value', '' ],
|
||||
]);
|
||||
( new ConfigService() )->setThemeColor($data);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取色调设置
|
||||
* @description 获取色调设置
|
||||
* @return Response
|
||||
*/
|
||||
public function getThemeColor()
|
||||
{
|
||||
return success(data: ( new ConfigService() )->getThemeColor());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取install.php配置
|
||||
* @return Response
|
||||
|
||||
@ -79,7 +79,7 @@ class Export extends BaseAdminController
|
||||
/**
|
||||
* 获取导出状态列表
|
||||
* @description 获取导出状态列表
|
||||
* @param string $type
|
||||
* @return Response
|
||||
*/
|
||||
public function getExportStatus()
|
||||
{
|
||||
|
||||
@ -94,6 +94,21 @@ class Role extends BaseAdminController
|
||||
return success('EDIT_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @description 修改状态
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function modifyStatus()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'role_id', '' ],
|
||||
[ 'status', '' ],
|
||||
]);
|
||||
( new RoleService() )->modifyStatus($data);
|
||||
return success('SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单个用户组
|
||||
* @description 删除单个用户组
|
||||
@ -107,19 +122,4 @@ class Role extends BaseAdminController
|
||||
return success('DELETE_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置角色状态
|
||||
* @description 设置角色状态
|
||||
* @param $role_id
|
||||
* @return Response
|
||||
*/
|
||||
public function modifyStatus($role_id)
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['status', RoleStatusDict::ON],
|
||||
]);
|
||||
(new RoleService())->modifyStatus($role_id, $data['status']);
|
||||
return success('DELETE_SUCCESS');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -14,13 +14,13 @@ namespace app\adminapi\controller\user;
|
||||
use app\dict\sys\UserDict;
|
||||
use app\service\admin\user\UserService;
|
||||
use core\base\BaseAdminController;
|
||||
use Exception;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
* 站点用户接口
|
||||
* @description 站点用户
|
||||
* 用户管理
|
||||
* Class User
|
||||
* @description 用户管理
|
||||
* @package app\adminapi\controller\user
|
||||
*/
|
||||
class User extends BaseAdminController
|
||||
{
|
||||
@ -37,28 +37,25 @@ class User extends BaseAdminController
|
||||
['role', ''],
|
||||
['create_time', []],
|
||||
]);
|
||||
|
||||
$list = (new UserService())->getPage($data);
|
||||
return success($list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户详情
|
||||
* @description 用户详情
|
||||
* @param $uid
|
||||
* @return Response
|
||||
*/
|
||||
public function info($uid)
|
||||
{
|
||||
if(!is_numeric($uid))
|
||||
{
|
||||
$uid = 0;
|
||||
}
|
||||
return success((new UserService())->getInfo($uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部用户
|
||||
* @description 获取全部用户
|
||||
* 获取用户列表
|
||||
* @description 获取用户列表
|
||||
* @return Response
|
||||
*/
|
||||
public function getUserAll()
|
||||
@ -73,92 +70,141 @@ class User extends BaseAdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
* @description 新增用户
|
||||
* 获取用户下拉框
|
||||
* @description 获取用户下拉框
|
||||
* @return Response
|
||||
* @throws Exception
|
||||
*/
|
||||
public function add()
|
||||
public function getUserSelect()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['username', '']
|
||||
]);
|
||||
$list = (new UserService())->getUserSelect($data);
|
||||
return success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户是否存在
|
||||
* @description 检查用户是否存在
|
||||
* @return Response
|
||||
* @throws \think\db\exception\DbException
|
||||
*/
|
||||
public function checkUserIsExist() {
|
||||
$data = $this->request->params([
|
||||
['username', ''],
|
||||
]);
|
||||
$is_exist = (new UserService())->checkUsername($data['username']);
|
||||
return success(data:$is_exist);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户
|
||||
* @description 添加用户
|
||||
* @return Response
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function add() {
|
||||
$data = $this->request->params([
|
||||
['username', ''],
|
||||
['password', ''],
|
||||
['mobile', ''],
|
||||
['real_name', ''],
|
||||
['head_img', ''],
|
||||
['status', UserDict::ON],
|
||||
['role_ids', []]
|
||||
]);
|
||||
$this->validate($data, 'app\validate\sys\User.add');
|
||||
$uid = (new UserService())->addUser($data);
|
||||
return success('ADD_SUCCESS', ['uid' => $uid]);
|
||||
(new UserService())->add($data);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
* @description 更新用户
|
||||
* 编辑用户
|
||||
* @description 编辑用户
|
||||
* @return Response
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function edit($uid)
|
||||
{
|
||||
public function edit($uid) {
|
||||
$data = $this->request->params([
|
||||
['password', ''],
|
||||
['mobile', ''],
|
||||
['real_name', ''],
|
||||
['head_img', ''],
|
||||
['status', UserDict::ON],
|
||||
['role_ids', []],
|
||||
['password', '']
|
||||
]);
|
||||
(new UserService())->editUser($uid, $data);
|
||||
return success('MODIFY_SUCCESS');
|
||||
(new UserService())->edit($uid, $data);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新字段
|
||||
* @description 更新字段
|
||||
* @param $uid
|
||||
* @param $field
|
||||
* @return Response
|
||||
*/
|
||||
public function modify($uid, $field)
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['value', ''],
|
||||
['field', $field]
|
||||
]);
|
||||
$data[$field] = $data['value'];
|
||||
// $this->validate($data, 'app\validate\sys\User.modify');
|
||||
(new UserService())->modify($uid, $field, $data['value']);
|
||||
return success('MODIFY_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单个用户
|
||||
* @description 删除单个用户
|
||||
* 删除用户
|
||||
* @description 删除用户
|
||||
* @param $uid
|
||||
* @return Response
|
||||
*/
|
||||
public function del($uid)
|
||||
{
|
||||
public function del($uid) {
|
||||
(new UserService())->del($uid);
|
||||
return success('DELETE_SUCCESS');
|
||||
return success("DELETE_SUCCESS");
|
||||
}
|
||||
|
||||
/**
|
||||
* 锁定用户
|
||||
* @description 锁定用户
|
||||
* 获取用户站点创建限制
|
||||
* @description 获取用户站点创建限制
|
||||
* @param $uid
|
||||
* @return Response
|
||||
*/
|
||||
public function lock($uid)
|
||||
{
|
||||
(new UserService())->lock($uid);
|
||||
return success('MODIFY_SUCCESS');
|
||||
public function getUserCreateSiteLimit($uid){
|
||||
return success(data:(new UserService())->getUserCreateSiteLimit($uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁用户
|
||||
* @description 解锁用户
|
||||
* 获取用户站点创建限制
|
||||
* @description 获取用户站点创建限制
|
||||
* @param $id
|
||||
* @return Response
|
||||
*/
|
||||
public function unlock($uid)
|
||||
{
|
||||
(new UserService())->unlock($uid);
|
||||
return success('MODIFY_SUCCESS');
|
||||
public function getUserCreateSiteLimitInfo($id){
|
||||
return success(data:(new UserService())->getUserCreateSiteLimitInfo($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户站点创建限制
|
||||
* @description 添加用户站点创建限制
|
||||
* @param $uid
|
||||
* @return Response
|
||||
*/
|
||||
public function addUserCreateSiteLimit($uid){
|
||||
$data = $this->request->params([
|
||||
['uid', 0],
|
||||
['group_id', 0],
|
||||
['num', 1],
|
||||
['month', 1],
|
||||
]);
|
||||
(new UserService())->addUserCreateSiteLimit($data);
|
||||
return success('SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑用户站点创建限制
|
||||
* @description 编辑用户站点创建限制
|
||||
* @param $id
|
||||
* @return Response
|
||||
*/
|
||||
public function editUserCreateSiteLimit($id){
|
||||
$data = $this->request->params([
|
||||
['num', 1],
|
||||
['month', 1],
|
||||
]);
|
||||
(new UserService())->editUserCreateSiteLimit($id, $data);
|
||||
return success('SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户站点创建限制
|
||||
* @description 删除用户站点创建限制
|
||||
* @param $id
|
||||
* @return Response
|
||||
*/
|
||||
public function delUserCreateSiteLimit($id){
|
||||
(new UserService())->delUserCreateSiteLimit($id);
|
||||
return success('SUCCESS');
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,5 +56,45 @@ class Config extends BaseAdminController
|
||||
return success('SET_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置微信小程序域名
|
||||
* @description 设置微信小程序域名
|
||||
* @return Response
|
||||
*/
|
||||
public function setDomain() {
|
||||
$data = $this->request->params([
|
||||
['requestdomain', ''],
|
||||
['wsrequestdomain', ''],
|
||||
['uploaddomain', ''],
|
||||
['downloaddomain', ''],
|
||||
['udpdomain', ''],
|
||||
['tcpdomain', '']
|
||||
]);
|
||||
(new WeappConfigService())->setDomain($data);
|
||||
return success('SET_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信小程序隐私协议
|
||||
* @description 获取微信小程序隐私协议
|
||||
* @return Response
|
||||
*/
|
||||
public function getPrivacySetting() {
|
||||
return success((new WeappConfigService())->getPrivacySetting());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置微信小程序隐私协议
|
||||
* @description 设置微信小程序隐私协议
|
||||
* @return Response
|
||||
*/
|
||||
public function setPrivacySetting() {
|
||||
$data = $this->request->params([
|
||||
['setting_list', []],
|
||||
['owner_setting', []],
|
||||
['sdk_privacy_info_list', []]
|
||||
]);
|
||||
(new WeappConfigService())->setPrivacySetting($data);
|
||||
return success('SET_SUCCESS');
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ class Delivery extends BaseAdminController
|
||||
/**
|
||||
* 查询小程序是否已开通发货信息管理服务
|
||||
* @description 查询小程序是否已开通发货信息管理服务
|
||||
* @return bool
|
||||
* @return \think\Response
|
||||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function getIsTradeManaged()
|
||||
|
||||
@ -53,7 +53,8 @@ class Version extends BaseAdminController
|
||||
public function add()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['desc', '']
|
||||
['desc', ''],
|
||||
['version', '']//特殊指定版本号
|
||||
]);
|
||||
return success(data:(new WeappVersionService())->add($data));
|
||||
}
|
||||
|
||||
@ -42,7 +42,8 @@ class Config extends BaseAdminController
|
||||
['token', ''],
|
||||
['encoding_aes_key', ''],
|
||||
['qr_code', ''],
|
||||
['encryption_type', '']
|
||||
['encryption_type', ''],
|
||||
['base_uri', '']
|
||||
]);
|
||||
$this->validate($data, 'app\validate\channel\Wechat.set');
|
||||
(new WechatConfigService())->setWechatConfig($data);
|
||||
|
||||
@ -27,6 +27,7 @@ class AdminCheckRole
|
||||
{
|
||||
$check_role_service = new AuthService();
|
||||
$check_role_service->checkRole($request);
|
||||
|
||||
//处理用户的权限
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@ use app\Request;
|
||||
use app\service\admin\user\UserLogService;
|
||||
use Closure;
|
||||
use ReflectionClass;
|
||||
use think\facade\Log;
|
||||
use think\facade\Route;
|
||||
|
||||
/**
|
||||
* admin用户操作日志
|
||||
@ -29,20 +31,28 @@ class AdminLog
|
||||
//写入日志
|
||||
if ($request->method() != 'GET') {
|
||||
$path = $request->rule()->getRoute();
|
||||
if(strstr($path,'@')){
|
||||
$arr = explode('@', $path);
|
||||
$controller = $arr[0] ?? "";
|
||||
$action = $arr[1] ?? "";
|
||||
}else{
|
||||
//暂时只有APP目录下使用这样的路由定义
|
||||
list($controllerStr, $action) = explode('/', $path, 2);
|
||||
list($module, $controller) = explode('.', $controllerStr, 2);
|
||||
// 拼接完整类名(根据 TP 命名空间规则调整)
|
||||
$controllerClass = "app\\adminapi\\controller\\{$module}\\{$controller}";
|
||||
$controller = $controllerClass;
|
||||
try {
|
||||
if (strstr($path, '@')) {
|
||||
$arr = explode('@', $path);
|
||||
$controller = $arr[0] ?? "";
|
||||
$action = $arr[1] ?? "";
|
||||
} else {
|
||||
//暂时只有APP目录下使用这样的路由定义
|
||||
list($controllerStr, $action) = explode('/', $path, 2);
|
||||
$parts = preg_split('/[\.\\\\]/', $controllerStr, 2);
|
||||
list($module, $controller) = $parts;
|
||||
if (count($parts) >= 2) {
|
||||
// 拼接完整类名(根据 TP 命名空间规则调整)
|
||||
$controllerClass = "app\\adminapi\\controller\\{$module}\\{$controller}";
|
||||
$controller = $controllerClass;
|
||||
}
|
||||
}
|
||||
$operation = $this->extractDescFromAnnotation($controller, $action);
|
||||
} catch (\Exception $e) {
|
||||
$operation = "";
|
||||
Log::write('获取路由描述错误:path' . $path . ' error' . $e->getMessage());
|
||||
}
|
||||
|
||||
$operation = $this->extractDescFromAnnotation($controller, $action);
|
||||
$data = [
|
||||
'uid' => $request->uid(),
|
||||
'username' => $request->username(),
|
||||
@ -79,7 +89,7 @@ class AdminLog
|
||||
$docComment = $method->getDocComment();
|
||||
|
||||
if (preg_match('/@description\s+(.+)/', $docComment, $matches)) {
|
||||
return (empty($controller_desc) ? "" : $controller_desc.'-').$matches[1];
|
||||
return (empty($controller_desc) ? "" : $controller_desc . '-') . $matches[1];
|
||||
}
|
||||
|
||||
return '';
|
||||
|
||||
@ -27,13 +27,13 @@ Route::group(function () {
|
||||
Route::get('addon/:id', 'addon.Addon/info');
|
||||
|
||||
//安装插件
|
||||
Route::post('addon/install/:addon', 'addon.Addon/install');
|
||||
Route::post('addon/install/:addon', 'addon.Addon/install')->pattern(['addon' => '[\w|\,]+']);
|
||||
//云安装插件
|
||||
Route::post('addon/cloudinstall/:addon', 'addon.Addon/cloudInstall');
|
||||
Route::post('addon/cloudinstall/:addon', 'addon.Addon/cloudInstall')->pattern(['addon' => '[\w|\,]+']);
|
||||
// 云编译进度
|
||||
Route::get('addon/cloudinstall/:addon', 'addon.Addon/cloudInstallLog');
|
||||
Route::get('addon/cloudinstall/:addon', 'addon.Addon/cloudInstallLog')->pattern(['addon' => '[\w|\,]+']);
|
||||
//插件安装检测安装环境
|
||||
Route::get('addon/install/check/:addon', 'addon.Addon/installCheck');
|
||||
Route::get('addon/install/check/:addon', 'addon.Addon/installCheck')->pattern(['addon' => '[\w|\,]+']);
|
||||
// 获取安装任务
|
||||
Route::get('addon/installtask', 'addon.Addon/getInstallTask');
|
||||
//下载插件
|
||||
@ -77,6 +77,9 @@ Route::group(function () {
|
||||
Route::post('addon_develop/download/:key', 'addon.AddonDevelop/download');
|
||||
//插件标识黑名单
|
||||
Route::get('addon_develop/key/blacklist', 'addon.AddonDevelop/keyBlackList');
|
||||
// 获取应用列表
|
||||
Route::get('addon/showCustomer', 'addon.Addon/showCustomer');
|
||||
Route::get('addon/special_menu', 'addon.Addon/getSpecialMenuList');
|
||||
})->middleware([
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
@ -89,8 +92,7 @@ Route::group(function () {
|
||||
Route::group(function () {
|
||||
//获取已安装插件列表
|
||||
Route::get('addon/list/install', 'addon.Addon/getInstallList');
|
||||
// 获取应用列表
|
||||
Route::get('addon/list/showapp', 'addon.Addon/showApp');
|
||||
// 获取营销列表
|
||||
Route::get('addon/list/showApp', 'addon.Addon/showApp');
|
||||
Route::get('showMarketing', 'addon.Addon/showMarketing');
|
||||
|
||||
});
|
||||
|
||||
@ -31,4 +31,4 @@ Route::group('aliapp', function () {
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
AdminLog::class
|
||||
]);
|
||||
]);
|
||||
@ -16,4 +16,4 @@ $is_demo = env('system.is_demo', 0);
|
||||
if ($is_demo && !Request::isGet()) {
|
||||
//加载插件路由
|
||||
throw new CommonException("演示数据不能进行修改");
|
||||
}
|
||||
}
|
||||
@ -52,4 +52,4 @@ Route::group('applet', function () {
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
AdminLog::class
|
||||
]);
|
||||
]);
|
||||
@ -24,12 +24,15 @@ Route::group('auth', function () {
|
||||
/***************************************************** 授权信息 ****************************************************/
|
||||
//授权用户站点菜单
|
||||
Route::get('authmenu', 'auth.Auth/authMenuList');
|
||||
//授权用户站点应用
|
||||
Route::get('authaddon', 'auth.Auth/getAuthAddonList');
|
||||
//授权用户信息
|
||||
Route::get('get', 'auth.Auth/get');
|
||||
//授权用户信息
|
||||
Route::put('edit', 'auth.Auth/edit');
|
||||
//授权用户信息
|
||||
Route::put('modify/:field', 'auth.Auth/modify');
|
||||
//授权用户信息
|
||||
Route::put('edit', 'auth.Auth/edit');
|
||||
|
||||
})->middleware([
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
|
||||
@ -33,6 +33,24 @@ Route::group('channel', function () {
|
||||
Route::get('app/config', 'channel.App/get');
|
||||
//设置手机端配置
|
||||
Route::put('app/config', 'channel.App/set');
|
||||
// 获取app版本列表
|
||||
Route::get('app/version', 'channel.App/versionList');
|
||||
// 获取app版本详情
|
||||
Route::get('app/version/:id', 'channel.App/versionInfo');
|
||||
// 添加app版本
|
||||
Route::post('app/version', 'channel.App/add');
|
||||
// 编辑app版本
|
||||
Route::put('app/version/:id', 'channel.App/edit');
|
||||
// 删除app版本
|
||||
Route::delete('app/version/:id', 'channel.App/del');
|
||||
// 获取app平台
|
||||
Route::get('app/platfrom', 'channel.App/appPlatform');
|
||||
// 获取app生成日志
|
||||
Route::get('app/build/log/:key', 'channel.App/buildLog');
|
||||
// 发布
|
||||
Route::put('app/version/:id/release', 'channel.App/release');
|
||||
// 生成证书
|
||||
Route::post('app/generate_sing_cert', 'channel.App/generateSingCert');
|
||||
|
||||
})->middleware([
|
||||
AdminCheckToken::class,
|
||||
|
||||
@ -149,9 +149,9 @@ Route::group('member', function() {
|
||||
//全部会员等级
|
||||
Route::get('level/all', 'member.MemberLevel/getAll');
|
||||
// 获取会员权益内容
|
||||
Route::get('benefits/content', 'member.Member/getMemberBenefitsContent');
|
||||
Route::post('benefits/content', 'member.Member/getMemberBenefitsContent');
|
||||
// 获取会员礼包内容
|
||||
Route::get('gifts/content', 'member.Member/getMemberGiftsContent');
|
||||
Route::post('gifts/content', 'member.Member/getMemberGiftsContent');
|
||||
/***************************************************** 会员签到 ****************************************************/
|
||||
//签到设置
|
||||
Route::put('sign/config', 'member.MemberSign/setSign');
|
||||
|
||||
@ -39,8 +39,6 @@ Route::group('sys', function() {
|
||||
Route::put('role/:role_id', 'sys.Role/edit');
|
||||
//删除用户组
|
||||
Route::delete('role/:role_id', 'sys.Role/del');
|
||||
// 修改用户组状态
|
||||
Route::put('role/status', 'sys.Role/modifyStatus');
|
||||
/***************************************************** 菜单 ****************************************************/
|
||||
//菜单新增
|
||||
Route::post('menu', 'sys.Menu/add');
|
||||
@ -67,8 +65,6 @@ Route::group('sys', function() {
|
||||
|
||||
Route::get('menu/system_menu', 'sys.Menu/getSystem');
|
||||
|
||||
Route::get('menu/addon_menu/all', 'sys.Menu/getAllAddonMenu');
|
||||
|
||||
Route::get('menu/addon_menu/:app_key', 'sys.Menu/getAddonMenu');
|
||||
|
||||
Route::get('menu/dir/:addon', 'sys.Menu/getMenuByTypeDir');
|
||||
@ -99,6 +95,16 @@ Route::group('sys', function() {
|
||||
// 开发者key
|
||||
Route::get('config/developer_token', 'sys.Config/getDeveloperToken');
|
||||
|
||||
// 布局设置
|
||||
Route::get('config/layout', 'sys.Config/getLayout');
|
||||
// 布局设置
|
||||
Route::put('config/layout', 'sys.Config/setLayout');
|
||||
|
||||
// 色调设置
|
||||
Route::get('config/themecolor', 'sys.Config/getThemeColor');
|
||||
// 色调设置
|
||||
Route::put('config/themecolor', 'sys.Config/setThemeColor');
|
||||
|
||||
/***************************************************** 图片上传 ****************************************************/
|
||||
//附件图片上传
|
||||
Route::post('image', 'upload.Upload/image');
|
||||
@ -342,6 +348,8 @@ Route::group('sys', function() {
|
||||
Route::get('web/website', 'sys.Config/getWebsite');
|
||||
// 获取版权信息
|
||||
Route::get('web/copyright', 'sys.Config/getCopyright');
|
||||
// 查询布局设置
|
||||
Route::get('web/layout', 'sys.Config/getLayout');
|
||||
// 获取install.php配置
|
||||
Route::get('install/config', 'sys.Config/getInstallConfig');
|
||||
});
|
||||
|
||||
@ -24,6 +24,12 @@ Route::group('weapp', function() {
|
||||
Route::get('config', 'weapp.Config/get');
|
||||
//设置微信配置
|
||||
Route::put('config', 'weapp.Config/set');
|
||||
//设置微信域名
|
||||
Route::put('domain', 'weapp.Config/setDomain');
|
||||
// 设置微信隐私协议
|
||||
Route::put('privacysetting', 'weapp.Config/setPrivacySetting');
|
||||
// 获取微信隐私协议
|
||||
Route::get('privacysetting', 'weapp.Config/getPrivacySetting');
|
||||
|
||||
/***************************************************** 订阅消息 ****************************************************/
|
||||
//同步订阅消息
|
||||
@ -41,6 +47,7 @@ Route::group('weapp', function() {
|
||||
Route::get('upload/:key', 'weapp.Version/uploadLog');
|
||||
|
||||
|
||||
|
||||
/***************************************************** 小程序发货信息管理服务 ****************************************************/
|
||||
|
||||
// 查询小程序是否已开通发货信息管理服务
|
||||
|
||||
@ -12,4 +12,4 @@
|
||||
return [
|
||||
// 默认输出类型
|
||||
'default_return_type' => 'json',
|
||||
];
|
||||
];
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
namespace app\api\controller\channel;
|
||||
|
||||
use app\service\api\channel\AppService;
|
||||
use app\service\api\login\LoginService;
|
||||
use app\service\api\wechat\WechatAppService;
|
||||
use core\base\BaseController;
|
||||
@ -53,10 +54,20 @@ class App extends BaseController
|
||||
'mobile' => 'mobile'
|
||||
]);
|
||||
|
||||
// 校验手机验证码(电脑端扫码)
|
||||
// 校验手机验证码
|
||||
( new LoginService() )->checkMobileCode($data[ 'mobile' ]);
|
||||
|
||||
$wechat_app_service = new WechatAppService();
|
||||
return success($wechat_app_service->register($data[ 'openid' ], $data[ 'mobile' ], $data[ 'nickname' ], $data[ 'avatar' ], $data[ 'avatar' ]));
|
||||
}
|
||||
|
||||
public function getNewVersion()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'version_code', '' ], // 当前版本
|
||||
[ 'platform', '' ], // 请求平台
|
||||
]);
|
||||
$app_service = new AppService();
|
||||
return success(data:$app_service->getNewVersion($data));
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ class Pay extends BaseApiController
|
||||
['openid', '']
|
||||
]);
|
||||
|
||||
return success('SUCCESS',(new PayService())->pay($data['type'], $data['trade_type'], $data['trade_id'], $data['return_url'], $data['quit_url'], $data['buyer_id'], $data['voucher'], $data['openid']));
|
||||
return success('SUCCESS',(new PayService())->pay($data['type'], $data['trade_type'], (int)$data['trade_id'], $data['return_url'], $data['quit_url'], $data['buyer_id'], $data['voucher'], $data['openid']));
|
||||
}
|
||||
|
||||
public function info($trade_type, $trade_id)
|
||||
|
||||
@ -13,10 +13,6 @@ namespace app\api\controller\pay;
|
||||
|
||||
use app\service\api\pay\PayService;
|
||||
use core\base\BaseApiController;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
* 微信服务端通信以及网页授权
|
||||
@ -27,7 +23,7 @@ class Transfer extends BaseApiController
|
||||
|
||||
/**
|
||||
* 确认收款
|
||||
* @return Response
|
||||
* @return void
|
||||
*/
|
||||
public function confirm($transfer_no)
|
||||
{
|
||||
|
||||
@ -29,7 +29,7 @@ class Config extends BaseApiController
|
||||
*/
|
||||
public function getCopyright()
|
||||
{
|
||||
return success(( new ConfigService() )->getCopyright());
|
||||
return success((new ConfigService())->getCopyright());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -38,7 +38,7 @@ class Config extends BaseApiController
|
||||
*/
|
||||
public function getSceneDomain()
|
||||
{
|
||||
return success(( new ConfigService() )->getSceneDomain());
|
||||
return success((new ConfigService())->getSceneDomain());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -47,7 +47,7 @@ class Config extends BaseApiController
|
||||
*/
|
||||
public function site()
|
||||
{
|
||||
return success(( new ConfigService() )->getWebSite());
|
||||
return success((new ConfigService())->getWebSite());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,10 +56,10 @@ class Config extends BaseApiController
|
||||
public function getWapIndexList()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'title', '' ],
|
||||
[ 'key', '' ] // 多个查询,逗号隔开
|
||||
['title', ''],
|
||||
['key', ''] // 多个查询,逗号隔开
|
||||
]);
|
||||
return success(( new ConfigService() )->getWapIndexList($data));
|
||||
return success((new ConfigService())->getWapIndexList($data));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,7 +68,7 @@ class Config extends BaseApiController
|
||||
*/
|
||||
public function getMap()
|
||||
{
|
||||
return success(( new ConfigService() )->getMap());
|
||||
return success((new ConfigService())->getMap());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,35 +78,39 @@ class Config extends BaseApiController
|
||||
public function init()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'url', '' ],
|
||||
[ 'openid', '' ]
|
||||
['url', ''],
|
||||
['openid', '']
|
||||
]);
|
||||
$config_service = new ConfigService();
|
||||
|
||||
$res = [];
|
||||
$res[ 'tabbar_list' ] = ( new DiyConfigService() )->getBottomList();
|
||||
$res[ 'map_config' ] = ( new ConfigService() )->getMap();
|
||||
$res[ 'site_info' ] = ( new ConfigService() )->getWebSite();
|
||||
$res[ 'member_level' ] = ( new MemberLevelService() )->getList();
|
||||
$res[ 'login_config' ] = ( new MemberConfigService() )->getLoginConfig($data[ 'url' ]);
|
||||
$res[ 'theme_list' ] = ( new DiyService() )->getDiyTheme();
|
||||
$openid_field = match ( $this->request->getChannel() ) {
|
||||
$res['tabbar_list'] = (new DiyConfigService())->getBottomList();
|
||||
$res['map_config'] = $config_service->getMap();
|
||||
$res['site_info'] = $config_service->getWebSite();
|
||||
$res[ 'site_info' ]['wap_url'] = $config_service->getSceneDomain()['wap_url'];
|
||||
$res['member_level'] = (new MemberLevelService())->getList();
|
||||
$res['login_config'] = (new MemberConfigService())->getLoginConfig($data['url']);
|
||||
$res['theme_list'] = (new DiyService())->getDiyTheme();
|
||||
$res['app_config'] = $config_service->getAppConfig();
|
||||
$res['copyright'] = $config_service->getCopyright();
|
||||
$openid_field = match ($this->request->getChannel()) {
|
||||
'wechat' => 'wx_openid',
|
||||
'weapp' => 'weapp_openid',
|
||||
default => ''
|
||||
};
|
||||
// 根据来源查询是否已经存在用户, 如果存在则快捷登录时不再弹出授权弹框
|
||||
// 根据来源查询是否绑定手机号, 如果绑定并且开启强制绑定则快捷登录时不再弹出绑定手机弹窗
|
||||
$res[ 'member_exist' ] = 0;
|
||||
$res[ 'member_mobile_exist' ] = 0;
|
||||
if (!empty($data[ 'openid' ])) {
|
||||
if (!empty($openid_field)){
|
||||
$res[ 'member_exist' ] = ( new MemberService() )->getCount([ [ $openid_field, '=', $data[ 'openid' ] ] ]) > 0 ? 1 : 0;
|
||||
$res['member_exist'] = 0;
|
||||
$res['member_mobile_exist'] = 0;
|
||||
if (!empty($data['openid'])) {
|
||||
if (!empty($openid_field)) {
|
||||
$res['member_exist'] = (new MemberService())->getCount([[$openid_field, '=', $data['openid']]]) > 0 ? 1 : 0;
|
||||
|
||||
$res[ 'member_mobile_exist' ] = ( new MemberService() )->getCount([ [ $openid_field, '=', $data[ 'openid' ] ], [ 'mobile', '<>', '' ] ]) > 0 ? 1 : 0;
|
||||
$res['member_mobile_exist'] = (new MemberService())->getCount([[$openid_field, '=', $data['openid']], ['mobile', '<>', '']]) > 0 ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
( new MemberService() )->initMemberData();
|
||||
(new MemberService())->initMemberData();
|
||||
|
||||
event('initWap');
|
||||
return success($res);
|
||||
@ -119,20 +123,20 @@ class Config extends BaseApiController
|
||||
public function getMemberMobileExist()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'openid', '' ]
|
||||
['openid', '']
|
||||
]);
|
||||
|
||||
$openid_field = match ( $this->request->getChannel() ) {
|
||||
$openid_field = match ($this->request->getChannel()) {
|
||||
'wechat' => 'wx_openid',
|
||||
'weapp' => 'weapp_openid',
|
||||
default => ''
|
||||
};
|
||||
|
||||
// 根据来源查询是否绑定手机号, 如果绑定并且开启强制绑定则快捷登录时不再弹出绑定手机弹窗
|
||||
$res[ 'member_mobile_exist' ] = 0;
|
||||
if (!empty($data[ 'openid' ])) {
|
||||
$res['member_mobile_exist'] = 0;
|
||||
if (!empty($data['openid'])) {
|
||||
if (!empty($openid_field)) {
|
||||
$res['member_mobile_exist'] = (new MemberService())->getCount([ [ $openid_field, '=', $data['openid'] ], ['mobile', '<>', ''] ]) > 0 ? 1 : 0;
|
||||
$res['member_mobile_exist'] = (new MemberService())->getCount([[$openid_field, '=', $data['openid']], ['mobile', '<>', '']]) > 0 ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ namespace app\api\controller\wechat;
|
||||
|
||||
use app\service\api\login\LoginService;
|
||||
use app\service\api\wechat\WechatAuthService;
|
||||
use app\service\api\wechat\WechatConfigService;
|
||||
use core\base\BaseController;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
@ -140,6 +141,16 @@ class Wechat extends BaseController
|
||||
return success($wechat_auth_service->scanLogin());
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查微信公众号是否配置
|
||||
* @return Response
|
||||
*/
|
||||
public function checkWechatConfig()
|
||||
{
|
||||
return success('SUCCESS', (new WechatConfigService())->checkWechatConfig());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新openid
|
||||
* @return Response
|
||||
|
||||
@ -23,4 +23,4 @@ Route::group('addon', function () {
|
||||
Route::get('list/install', 'addon.Addon/getInstallList');
|
||||
|
||||
})->middleware(ApiLog::class)
|
||||
->middleware(ApiCheckToken::class, false);
|
||||
->middleware(ApiCheckToken::class, false);
|
||||
@ -24,4 +24,4 @@ Route::group('auth', function () {
|
||||
|
||||
})->middleware(ApiChannel::class)
|
||||
->middleware(ApiCheckToken::class, true)
|
||||
->middleware(ApiLog::class);
|
||||
->middleware(ApiLog::class);
|
||||
@ -29,9 +29,9 @@ Route::any('weapp/serve', 'weapp.Serve/serve')
|
||||
->middleware(ApiCheckToken::class)
|
||||
->middleware(ApiLog::class);
|
||||
|
||||
Route::group(function() {
|
||||
Route::post('niucloud/notify', function() {
|
||||
return ( new CoreNotifyService() )->notify();
|
||||
Route::group(function () {
|
||||
Route::post('niucloud/notify', function () {
|
||||
return (new CoreNotifyService())->notify();
|
||||
});
|
||||
|
||||
});
|
||||
@ -73,6 +73,9 @@ Route::group(function () {
|
||||
// app通过wx code登录
|
||||
Route::post('wxapp/login', 'channel.App/wechatLogin');
|
||||
|
||||
// 获取App新的版本
|
||||
Route::get('app/newversion', 'channel.App/getNewVersion');
|
||||
|
||||
//登录
|
||||
Route::get('login', 'login.Login/login');
|
||||
//第三方绑定
|
||||
@ -153,6 +156,7 @@ Route::group(function () {
|
||||
Route::get('task/growth', 'sys.Task/growth');
|
||||
// 获取积分任务
|
||||
Route::get('task/point', 'sys.Task/point');
|
||||
|
||||
})->middleware(ApiChannel::class)
|
||||
->middleware(ApiCheckToken::class)
|
||||
->middleware(ApiLog::class);
|
||||
@ -169,4 +173,4 @@ Route::group(function () {
|
||||
->middleware(ApiCheckToken::class, true)
|
||||
->middleware(ApiLog::class);
|
||||
//加载插件路由
|
||||
( new DictLoader("Route") )->load([ 'app_type' => 'api' ]);
|
||||
(new DictLoader("Route"))->load(['app_type' => 'api']);
|
||||
|
||||
30
niucloud/app/command/RefreshBottom.php
Normal file
30
niucloud/app/command/RefreshBottom.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare (strict_types=1);
|
||||
namespace app\command;
|
||||
|
||||
use app\upgrade\v156\Upgrade;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
|
||||
class RefreshBottom extends Command
|
||||
{
|
||||
public function configure()
|
||||
{
|
||||
// 指令配置
|
||||
$this->setName('refresh:bottom')
|
||||
->setDescription('升级156版本底部导航异常,刷新底部导航。');
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务
|
||||
* @return void
|
||||
*/
|
||||
protected function execute(Input $input, Output $output)
|
||||
{
|
||||
$output->writeln('开始处理');
|
||||
(new Upgrade())->handle();
|
||||
$output->writeln('刷新完成,请重新发布小程序');
|
||||
|
||||
}
|
||||
}
|
||||
26
niucloud/app/command/Resetpassword.php
Normal file
26
niucloud/app/command/Resetpassword.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\command;
|
||||
|
||||
use app\service\admin\auth\LoginService;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
|
||||
class Resetpassword extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
// 指令配置
|
||||
$this->setName('reset')
|
||||
->setDescription('the reset administrator password command');
|
||||
}
|
||||
|
||||
protected function execute(Input $input, Output $output)
|
||||
{
|
||||
LoginService::resetAdministratorPassword();
|
||||
// 指令输出
|
||||
$output->writeln('password reset success');
|
||||
}
|
||||
}
|
||||
27
niucloud/app/command/refreshAreaCommand.php
Normal file
27
niucloud/app/command/refreshAreaCommand.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\command;
|
||||
|
||||
use app\job\refreshArea;
|
||||
use app\service\admin\auth\LoginService;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
|
||||
class refreshAreaCommand extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
// 指令配置
|
||||
$this->setName('refreshArea')
|
||||
->setDescription('更新地区命令');
|
||||
}
|
||||
|
||||
protected function execute(Input $input, Output $output)
|
||||
{
|
||||
(new refreshArea())->execute($output);
|
||||
// 指令输出
|
||||
$output->writeln('地区更新成功');
|
||||
}
|
||||
}
|
||||
@ -774,7 +774,7 @@ function project_path()
|
||||
/**
|
||||
* 图片转base64
|
||||
* @param string $path
|
||||
* @param $is_delete `转换后是否删除原图`
|
||||
* @param $is_delete 转换后是否删除原图
|
||||
* @return string
|
||||
*/
|
||||
function image_to_base64(string $path, $is_delete = false)
|
||||
@ -897,7 +897,7 @@ function file_copy(string $source_file, string $to_file)
|
||||
function qrcode($url, $page, $data, $dir = '', $channel = 'h5', $style = ['is_transparent' => true], $outfile = true)
|
||||
{
|
||||
if ($outfile) {
|
||||
$dir = $dir ? : 'upload' . '/' . 'qrcode/';//二维码默认存储位置
|
||||
$dir = $dir ?: 'upload' . '/' . 'qrcode' ;//二维码默认存储位置
|
||||
if (!is_dir($dir) && !mkdir($dir, 0777, true) && !is_dir($dir)) {
|
||||
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
|
||||
}
|
||||
@ -1051,9 +1051,9 @@ function get_last_time($time = null)
|
||||
|
||||
/**
|
||||
* 检查目录及其子目录的权限
|
||||
* @param $dir `要检查的目录路径`
|
||||
* @param $dir 要检查的目录路径
|
||||
* @param $data
|
||||
* @param $exclude_dir `排除排除无需检测的的文件夹`
|
||||
* @param $exclude_dir 排除排除无需检测的的文件夹
|
||||
* @return array|array[]|mixed
|
||||
*/
|
||||
function checkDirPermissions($dir, $data = [], $exclude_dir = [])
|
||||
@ -1116,8 +1116,8 @@ function checkDirPermissions($dir, $data = [], $exclude_dir = [])
|
||||
|
||||
/**
|
||||
* 下载网络图片
|
||||
* @param $img_url `图片URL`
|
||||
* @param $file_name `本地保存位置`
|
||||
* @param $img_url 图片URL
|
||||
* @param $file_name 本地保存位置
|
||||
* @return bool
|
||||
*/
|
||||
function downloadImage($img_url, $file_name)
|
||||
|
||||
@ -39,4 +39,4 @@ class AppletlDict
|
||||
self::OFF => get_lang('dict_applet.channel_wechat'),//下架
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -21,4 +21,4 @@ class CashOutTypeDict
|
||||
public const MEMBER_CASH_OUT = 'member_cash_out';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
56
niucloud/app/dict/channel/AppDict.php
Normal file
56
niucloud/app/dict/channel/AppDict.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\dict\channel;
|
||||
|
||||
class AppDict
|
||||
{
|
||||
// ********** 平台类型 **************
|
||||
const ANDROID = 'android';
|
||||
|
||||
const IOS = 'ios';
|
||||
|
||||
public static function getAppPlatform() {
|
||||
return [
|
||||
self::ANDROID => 'Android',
|
||||
// self::IOS => 'ios'
|
||||
];
|
||||
}
|
||||
|
||||
public static function getAppPlatformName($platform) {
|
||||
$app_platform = self::getAppPlatform();
|
||||
return $app_platform[$platform] ?? '';
|
||||
}
|
||||
|
||||
// ********** 版本状态 **************
|
||||
|
||||
const STATUS_UPLOAD_SUCCESS = 'upload_success';
|
||||
|
||||
const STATUS_CREATE_FAIL = 'create_fail';
|
||||
|
||||
const STATUS_PUBLISHED = 'published';
|
||||
|
||||
const STATUS_CREATING = 'creating';
|
||||
|
||||
public static function getStatus() {
|
||||
return [
|
||||
self::STATUS_UPLOAD_SUCCESS => '上传成功',
|
||||
self::STATUS_CREATE_FAIL => '创建失败',
|
||||
self::STATUS_PUBLISHED => '已发布',
|
||||
self::STATUS_CREATING => '创建中'
|
||||
];
|
||||
}
|
||||
|
||||
public static function getStatusName($status) {
|
||||
return self::getStatus()[$status] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
@ -41,4 +41,4 @@ class CertDict
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -40,4 +40,4 @@ class ReplyDict
|
||||
self::STATUS_OFF => get_lang('dict_wechat_reply.status_off'),//关闭
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -61,4 +61,4 @@ class WechatDict
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -26,8 +26,10 @@ class CommonActiveDict
|
||||
const EXCHANGE = 'exchange';// 积分商城 积
|
||||
const MANJIANSONG = 'manjiansong'; // 满减送 满减
|
||||
const NEWCOMER_DISCOUNT = 'newcomer_discount'; // 新人专享 新
|
||||
const FRIEND_HELP = 'friend_help'; // 好友助力 友
|
||||
const PINTUAN = 'pintuan'; // 新人专享 新
|
||||
const SECKILL = 'seckill'; // 秒杀 秒
|
||||
const RELAY = 'relay'; // 接龙 接
|
||||
|
||||
public static function getActiveShort($active = '')
|
||||
{
|
||||
@ -72,6 +74,16 @@ class CommonActiveDict
|
||||
'active_name' => get_lang('common_active_short.pintuan_name'),
|
||||
'bg_color' => '#FF1C77'
|
||||
],
|
||||
self::RELAY => [
|
||||
'name' => get_lang('common_active_short.relay_short'),
|
||||
'active_name' => get_lang('common_active_short.relay_name'),
|
||||
'bg_color' => '#0EB108'
|
||||
],
|
||||
self::FRIEND_HELP => [
|
||||
'name' => get_lang('common_active_short.friend_help_short'),
|
||||
'active_name' => get_lang('common_active_short.friend_help_name'),
|
||||
'bg_color' => '#F20C8A'
|
||||
],
|
||||
];
|
||||
return !empty($active) ? $data[$active] ?? [] : $data;
|
||||
}
|
||||
|
||||
@ -80,41 +80,41 @@ class PagesDict
|
||||
if (!empty($wap_index_list)) {
|
||||
foreach ($wap_index_list as $k => $v) {
|
||||
|
||||
$link_list = LinkDict::getLink([ 'addon' => $v[ 'key' ] ]);
|
||||
$link_list = LinkDict::getLink(['addon' => $v['key']]);
|
||||
$link = [];
|
||||
foreach ($link_list as $ck => $cv) {
|
||||
if ($cv[ 'addon_info' ][ 'key' ] == $v[ 'key' ]) {
|
||||
foreach ($cv[ 'child_list' ] as $tk => $tv) {
|
||||
if (isset($cv[ 'type' ]) && $cv[ 'type' ] == 'folder') {
|
||||
if (!empty($tv[ 'child_list' ])) {
|
||||
foreach ($tv[ 'child_list' ] as $child_k => $child_v) {
|
||||
if ($child_v[ 'url' ] == $v[ 'url' ]) {
|
||||
if ($cv['addon_info']['key'] == $v['key']) {
|
||||
foreach ($cv['child_list'] as $tk => $tv) {
|
||||
if (isset($cv['type']) && $cv['type'] == 'folder') {
|
||||
if (!empty($tv['child_list'])) {
|
||||
foreach ($tv['child_list'] as $child_k => $child_v) {
|
||||
if ($child_v['url'] == $v['url']) {
|
||||
$link = [
|
||||
"parent" => $ck,
|
||||
"name" => $child_v[ 'name' ],
|
||||
"title" => $child_v[ 'title' ],
|
||||
"url" => $child_v[ 'url' ]
|
||||
"name" => $child_v['name'],
|
||||
"title" => $child_v['title'],
|
||||
"url" => $child_v['url']
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($tv[ 'url' ] == $v[ 'url' ]) {
|
||||
} else if ($tv['url'] == $v['url']) {
|
||||
$link = [
|
||||
"parent" => $ck,
|
||||
"name" => $tv[ 'name' ],
|
||||
"title" => $tv[ 'title' ],
|
||||
"url" => $tv[ 'url' ]
|
||||
"name" => $tv['name'],
|
||||
"title" => $tv['title'],
|
||||
"url" => $tv['url']
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$default_index_value[ 'list' ][] = [
|
||||
"title" => $v[ 'title' ],
|
||||
$default_index_value['list'][] = [
|
||||
"title" => $v['title'],
|
||||
"link" => $link,
|
||||
"imageUrl" => $v[ 'icon' ],
|
||||
"imageUrl" => $v['icon'],
|
||||
"label" => [
|
||||
"control" => false,
|
||||
"text" => "热门",
|
||||
@ -150,7 +150,16 @@ class PagesDict
|
||||
'imgHeight' => '',
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
'isShow' => true,
|
||||
'designNav' => [
|
||||
'title' => '',
|
||||
'key' => ''
|
||||
]
|
||||
],
|
||||
"copyright" => [
|
||||
'control' => true,
|
||||
'isShow' => false,
|
||||
'textColor' =>'#ccc'
|
||||
],
|
||||
"template" => [
|
||||
'textColor' => "#303133",
|
||||
@ -225,7 +234,16 @@ class PagesDict
|
||||
'imgHeight' => '',
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
'isShow' => true,
|
||||
'designNav' => [
|
||||
'title' => '',
|
||||
'key' => ''
|
||||
]
|
||||
],
|
||||
"copyright" => [
|
||||
'control' => true,
|
||||
'isShow' => false,
|
||||
'textColor' =>'#ccc'
|
||||
],
|
||||
"template" => [
|
||||
'textColor' => "#303133",
|
||||
@ -694,7 +712,16 @@ class PagesDict
|
||||
'imgHeight' => 403,
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
'isShow' => true,
|
||||
'designNav' => [
|
||||
'title' => '',
|
||||
'key' => ''
|
||||
],
|
||||
],
|
||||
"copyright" => [
|
||||
'control' => true,
|
||||
'isShow' => false,
|
||||
'textColor' =>'#ccc'
|
||||
],
|
||||
"template" => [
|
||||
'textColor' => "#303133",
|
||||
@ -1147,19 +1174,19 @@ class PagesDict
|
||||
]
|
||||
];
|
||||
|
||||
if (!empty($params[ 'addon' ])) {
|
||||
$pages = ( new DictLoader("UniappPages") )->load($params);
|
||||
if (!empty($params['addon'])) {
|
||||
$pages = (new DictLoader("UniappPages"))->load($params);
|
||||
} else {
|
||||
$pages = ( new DictLoader("UniappPages") )->load($system_pages);
|
||||
$pages = (new DictLoader("UniappPages"))->load($system_pages);
|
||||
}
|
||||
|
||||
if (!empty($params[ 'type' ])) {
|
||||
if (!empty($pages[ $params[ 'type' ] ])) {
|
||||
$temp = $pages[ $params[ 'type' ] ];
|
||||
if (isset($params[ 'mode' ]) && !empty($params[ 'mode' ])) {
|
||||
if (!empty($params['type'])) {
|
||||
if (!empty($pages[$params['type']])) {
|
||||
$temp = $pages[$params['type']];
|
||||
if (isset($params['mode']) && !empty($params['mode'])) {
|
||||
foreach ($temp as $k => $v) {
|
||||
if ($params[ 'mode' ] != $v[ 'mode' ]) {
|
||||
unset($temp[ $k ]);
|
||||
if ($params['mode'] != $v['mode']) {
|
||||
unset($temp[$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,14 +25,14 @@ class TemplateDict
|
||||
*/
|
||||
public static function getTemplate($params = [])
|
||||
{
|
||||
$other_template_data = ( new DictLoader("DiyFormTemplate") )->load([]);
|
||||
$other_template_data = (new DictLoader("DiyFormTemplate"))->load([]);
|
||||
$template = self::template();
|
||||
$data = array_merge($other_template_data, $template);
|
||||
if (!empty($params) && !empty($params[ 'type' ])) {
|
||||
if (!empty($params[ 'template_key' ])) {
|
||||
return $data[ $params[ 'type' ] ][ $params[ 'template_key' ] ] ?? [];
|
||||
if (!empty($params) && !empty($params['type'])) {
|
||||
if (!empty($params['template_key'])) {
|
||||
return $data[$params['type']][$params['template_key']] ?? [];
|
||||
}
|
||||
return $data[ $params[ 'type' ] ] ?? [];
|
||||
return $data[$params['type']] ?? [];
|
||||
}
|
||||
|
||||
return $data;
|
||||
@ -79,7 +79,16 @@ class TemplateDict
|
||||
],
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
'isShow' => true,
|
||||
'designNav' => [
|
||||
'title' => '',
|
||||
'key' => ''
|
||||
]
|
||||
],
|
||||
"copyright" => [
|
||||
'control' => true,
|
||||
'isShow' => false,
|
||||
'textColor' =>'#ccc'
|
||||
],
|
||||
"popWindow" => [
|
||||
"imgUrl" => "",
|
||||
@ -724,7 +733,16 @@ class TemplateDict
|
||||
],
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
'isShow' => true,
|
||||
'designNav' => [
|
||||
'title' => '',
|
||||
'key' => ''
|
||||
]
|
||||
],
|
||||
"copyright" => [
|
||||
'control' => true,
|
||||
'isShow' => false,
|
||||
'textColor' =>'#ccc'
|
||||
],
|
||||
"popWindow" => [
|
||||
"imgUrl" => "",
|
||||
|
||||
@ -35,4 +35,4 @@ class MemberAccountChangeTypeDict
|
||||
return $account_change_type[$type] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -34,4 +34,4 @@ class MemberDict extends ChannelDict
|
||||
self::OFF => get_lang('dict_member.status_off'),//无效
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -24,7 +24,6 @@ class MemberRegisterChannelDict extends ChannelDict
|
||||
|
||||
public static function getType($type = '')
|
||||
{
|
||||
|
||||
$data = ChannelDict::getType($type);
|
||||
$data[self::MANUAL] = get_lang('dict_member.register_manual');//手动添加
|
||||
if (empty($type)) {
|
||||
@ -33,4 +32,4 @@ class MemberRegisterChannelDict extends ChannelDict
|
||||
return $data[$type] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
62
niucloud/app/dict/menu/MenuDict.php
Normal file
62
niucloud/app/dict/menu/MenuDict.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\dict\menu;
|
||||
|
||||
|
||||
/**
|
||||
* 菜单类
|
||||
* Class MenuDict
|
||||
* @package app\dict\sys
|
||||
*/
|
||||
class MenuDict
|
||||
{
|
||||
|
||||
public const ADDON_CHILD_MENU_DICT_SYSTEM_TOOL = 'system_tool';
|
||||
public const ADDON_CHILD_MENU_DICT_MARKING_TOOL = 'marketing_tool';
|
||||
public const ADDON_CHILD_MENU_DICT_MARKING_ACTIVE = 'marketing_active';
|
||||
public const ADDON_CHILD_MENU_DICT_ADDON_TOOL = 'addon_tool';
|
||||
|
||||
/**
|
||||
* 站点应用管理特殊子菜单
|
||||
* @return array
|
||||
*/
|
||||
public static function getAddonChildMenu()
|
||||
{
|
||||
//注意 sort 倒序排序使用
|
||||
return [
|
||||
self::ADDON_CHILD_MENU_DICT_SYSTEM_TOOL => [
|
||||
'key' => self::ADDON_CHILD_MENU_DICT_SYSTEM_TOOL,
|
||||
'name' => get_lang('dict_addon_menu.system_tool'),
|
||||
'short_name' => get_lang('dict_addon_menu.system_tool_short'),
|
||||
'sort' => 97
|
||||
],
|
||||
self::ADDON_CHILD_MENU_DICT_MARKING_TOOL => [
|
||||
'key' => self::ADDON_CHILD_MENU_DICT_MARKING_TOOL,
|
||||
'name' => get_lang('dict_addon_menu.marking_tool'),
|
||||
'short_name' => get_lang('dict_site.marking_tool_short'),
|
||||
'sort' => 99
|
||||
],
|
||||
self::ADDON_CHILD_MENU_DICT_MARKING_ACTIVE => [
|
||||
'key' => self::ADDON_CHILD_MENU_DICT_MARKING_ACTIVE,
|
||||
'name' => get_lang('dict_addon_menu.marking_active'),
|
||||
'short_name' => get_lang('dict_addon_menu.marking_active_short'),
|
||||
'sort' => 100
|
||||
],
|
||||
self::ADDON_CHILD_MENU_DICT_ADDON_TOOL => [
|
||||
'key' => self::ADDON_CHILD_MENU_DICT_ADDON_TOOL,
|
||||
'name' => get_lang('dict_addon_menu.addon_tool'),
|
||||
'short_name' => get_lang('dict_addon_menu.addon_tool_short'),
|
||||
'sort' => 98
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -1073,37 +1073,37 @@ return [
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'menu_name' => '营销管理',
|
||||
'menu_key' => 'active',
|
||||
'menu_short_name' => '营销',
|
||||
'parent_key' => '',
|
||||
'menu_type' => '0',
|
||||
'icon' => 'iconfont iconyingxiao2',
|
||||
'api_url' => '',
|
||||
'router_path' => 'app/marketing',
|
||||
'view_path' => '',
|
||||
'methods' => '',
|
||||
'sort' => '87',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '营销列表',
|
||||
'menu_key' => 'marketing_list',
|
||||
'menu_short_name' => '营销列表',
|
||||
'menu_type' => '1',
|
||||
'icon' => 'iconfont iconmanage-apply',
|
||||
'api_url' => 'marketing/list',
|
||||
'router_path' => 'app/marketing',
|
||||
'view_path' => 'app/marketing',
|
||||
'methods' => 'get',
|
||||
'sort' => '160',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
],
|
||||
],
|
||||
// [
|
||||
// 'menu_name' => '营销管理',
|
||||
// 'menu_key' => 'active',
|
||||
// 'menu_short_name' => '营销',
|
||||
// 'parent_key' => '',
|
||||
// 'menu_type' => '0',
|
||||
// 'icon' => 'iconfont iconyingxiao2',
|
||||
// 'api_url' => '',
|
||||
// 'router_path' => 'app/marketing',
|
||||
// 'view_path' => '',
|
||||
// 'methods' => '',
|
||||
// 'sort' => '87',
|
||||
// 'status' => '1',
|
||||
// 'is_show' => '1',
|
||||
// 'children' => [
|
||||
// [
|
||||
// 'menu_name' => '营销列表',
|
||||
// 'menu_key' => 'marketing_list',
|
||||
// 'menu_short_name' => '营销列表',
|
||||
// 'menu_type' => '1',
|
||||
// 'icon' => 'iconfont iconmanage-apply',
|
||||
// 'api_url' => 'marketing/list',
|
||||
// 'router_path' => 'app/marketing',
|
||||
// 'view_path' => 'app/marketing',
|
||||
// 'methods' => 'get',
|
||||
// 'sort' => '160',
|
||||
// 'status' => '1',
|
||||
// 'is_show' => '1',
|
||||
// ],
|
||||
// ],
|
||||
// ],
|
||||
[
|
||||
'menu_name' => '核销管理',
|
||||
'menu_key' => 'verify',
|
||||
@ -1225,7 +1225,7 @@ return [
|
||||
'menu_name' => '签到管理',
|
||||
'menu_key' => 'sign',
|
||||
'menu_short_name' => '签到管理',
|
||||
'parent_key' => 'active',
|
||||
'parent_key' => 'addon',
|
||||
'menu_type' => '0',
|
||||
'icon' => 'element FolderChecked',
|
||||
'api_url' => '',
|
||||
@ -1290,8 +1290,8 @@ return [
|
||||
'menu_type' => '0',
|
||||
'icon' => 'iconfont iconyingyong21',
|
||||
'api_url' => '',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'router_path' => 'app/index',
|
||||
'view_path' => 'app/index',
|
||||
'methods' => '',
|
||||
'sort' => '86',
|
||||
'status' => '1',
|
||||
@ -1307,7 +1307,7 @@ return [
|
||||
'router_path' => 'app/index',
|
||||
'view_path' => 'app/index',
|
||||
'methods' => 'get',
|
||||
'sort' => '130',
|
||||
'sort' => '999',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
@ -1783,6 +1783,64 @@ return [
|
||||
'sort' => '0',
|
||||
'status' => '1',
|
||||
'is_show' => '0',
|
||||
],
|
||||
[
|
||||
'menu_name' => 'App端',
|
||||
'menu_key' => 'channel_app',
|
||||
'menu_short_name' => 'App端',
|
||||
'menu_type' => '1',
|
||||
'icon' => '',
|
||||
'api_url' => '',
|
||||
'router_path' => 'channel/app',
|
||||
'view_path' => 'channel/app/access',
|
||||
'methods' => '',
|
||||
'sort' => '50',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => 'App端配置',
|
||||
'menu_key' => 'channel_app_config',
|
||||
'menu_short_name' => 'app端配置',
|
||||
'menu_type' => '1',
|
||||
'icon' => '',
|
||||
'api_url' => 'channel/app/config',
|
||||
'router_path' => 'channel/app/config',
|
||||
'view_path' => 'channel/app/config',
|
||||
'methods' => 'get',
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '0',
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '设置app端配置',
|
||||
'menu_key' => 'set_channel_app_config',
|
||||
'menu_short_name' => '设置app端配置',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'channel/app/config',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'put',
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'menu_name' => 'APP版本管理',
|
||||
'menu_key' => 'app_version_list',
|
||||
'menu_short_name' => '版本管理',
|
||||
'menu_type' => '1',
|
||||
'icon' => '',
|
||||
'api_url' => 'channel/app/version',
|
||||
'router_path' => 'channel/app/version',
|
||||
'view_path' => 'channel/app/version',
|
||||
'methods' => 'get',
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '0',
|
||||
]
|
||||
],
|
||||
],
|
||||
@ -2998,7 +3056,7 @@ return [
|
||||
'is_show' => '1',
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '插件管理',
|
||||
'menu_name' => '应用管理',
|
||||
'menu_key' => 'app_store',
|
||||
'menu_short_name' => '应用',
|
||||
'menu_type' => '1',
|
||||
@ -3557,7 +3615,7 @@ return [
|
||||
'methods' => '',
|
||||
'sort' => '101',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
'is_show' => '0',
|
||||
],
|
||||
[
|
||||
'menu_name' => '升级记录',
|
||||
|
||||
@ -56,4 +56,4 @@ class OnlinePayDict
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -58,4 +58,4 @@ class OnlineRefundDict
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -16,7 +16,6 @@ use app\dict\common\ChannelDict;
|
||||
class PayChannelDict
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* 支付渠道类型
|
||||
* @return array
|
||||
@ -49,5 +48,4 @@ class PayChannelDict
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -24,4 +24,4 @@ class ScanDict
|
||||
const WECHAT_LOGIN = 'wechat_login';//微信登录
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -59,4 +59,4 @@ class ScheduleDict
|
||||
self::MONTH => get_lang('dict_schedule.month'),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -41,4 +41,4 @@ class AgreementDict
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -40,6 +40,9 @@ class ConfigKeyDict
|
||||
|
||||
public const SMS = 'SMS';//短信配置
|
||||
public const PINTUAN_ORDER_CONFIG = 'PINTUAN_ORDER_CONFIG';//拼团订单配置
|
||||
public const FRIEND_HELP_CONFIG = 'FRIEND_HELP_CONFIG';//拼团订单配置
|
||||
public const RELAY_ORDER_CONFIG = 'RELAY_ORDER_CONFIG';//接龙订单配置
|
||||
public const FRIEND_HELP_ORDER_CONFIG = 'FRIEND_HELP_ORDER_CONFIG';//接龙订单配置
|
||||
|
||||
public const APP = 'app';
|
||||
}
|
||||
|
||||
@ -78,4 +78,4 @@ class DateDict
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -49,4 +49,4 @@ class ExportDict
|
||||
return $type_list;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -35,6 +35,10 @@ class FileDict
|
||||
|
||||
public const EXCEL = 'excel';//excel导入
|
||||
|
||||
public const APP_PACKAGE = 'app_package';//应用包
|
||||
|
||||
public const ANDROID_CERT = 'android_cert';//android证书
|
||||
|
||||
/**
|
||||
* 附件类型
|
||||
* @return array
|
||||
@ -74,8 +78,11 @@ class FileDict
|
||||
self::IMAGE,//图片上传
|
||||
self::VIDEO,//视频上传
|
||||
self::AUDIO,//视频上传
|
||||
self::DOCUMENT,//文件上传
|
||||
self::APPLET,//小程序包上传
|
||||
self::EXCEL,//excel导入
|
||||
self::APP_PACKAGE,//应用包
|
||||
self::ANDROID_CERT,//android证书
|
||||
];
|
||||
}
|
||||
|
||||
@ -91,4 +98,4 @@ class FileDict
|
||||
self::SMALL,//图片上传
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,4 +27,4 @@ class MenuTypeDict
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -29,4 +29,4 @@ class MethodDict
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -58,4 +58,4 @@ class PosterDict
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -30,4 +30,4 @@ class RoleStatusDict
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -29,4 +29,4 @@ class UserDict
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -30,4 +30,4 @@ class VerifyDict
|
||||
return $type_list;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,7 @@ $system_event = [
|
||||
/**
|
||||
* 系统事件
|
||||
*/
|
||||
'AppInit' => [ 'app\listener\system\AppInitListener' ],
|
||||
'AppInit' => ['app\listener\system\AppInitListener'],
|
||||
'HttpRun' => [],
|
||||
'HttpEnd' => [],
|
||||
'LogLevel' => [],
|
||||
@ -20,26 +20,26 @@ $system_event = [
|
||||
* 会员相关事件
|
||||
*/
|
||||
//会员注册事件
|
||||
'MemberRegister' => [ 'app\listener\member\MemberRegisterListener' ],
|
||||
'MemberRegister' => ['app\listener\member\MemberRegisterListener'],
|
||||
//会员登录事件
|
||||
'MemberLogin' => [ 'app\listener\member\MemberLoginListener' ],
|
||||
'MemberLogin' => ['app\listener\member\MemberLoginListener'],
|
||||
//会员账户变化事件
|
||||
'MemberAccount' => [ 'app\listener\member\MemberAccountListener' ],
|
||||
'MemberAccount' => ['app\listener\member\MemberAccountListener'],
|
||||
//扫码事件
|
||||
'Scan' => [ 'app\listener\scan\ScanListener' ],
|
||||
'Scan' => ['app\listener\scan\ScanListener'],
|
||||
/**
|
||||
* 支付相关事件
|
||||
*/
|
||||
'PayCreate' => [ 'app\listener\pay\PayCreateListener' ],
|
||||
'PayCreate' => ['app\listener\pay\PayCreateListener'],
|
||||
//支付成功
|
||||
'PaySuccess' => [ 'app\listener\pay\PaySuccessListener' ],
|
||||
'PaySuccess' => ['app\listener\pay\PaySuccessListener'],
|
||||
//退款成功
|
||||
'RefundSuccess' => [ 'app\listener\pay\RefundSuccessListener' ],
|
||||
'RefundSuccess' => ['app\listener\pay\RefundSuccessListener'],
|
||||
//转账成功
|
||||
'TransferSuccess' => [ 'app\listener\pay\TransferSuccessListener' ],
|
||||
'TransferSuccess' => ['app\listener\pay\TransferSuccessListener'],
|
||||
// 任务失败统一回调,有四种定义方式
|
||||
'queue_failed' => [
|
||||
[ 'app\listener\job\QueueFailedLoggerListener', 'report' ],
|
||||
['app\listener\job\QueueFailedLoggerListener', 'report'],
|
||||
],
|
||||
//系统应用管理加载
|
||||
'AppManage' => [
|
||||
@ -47,6 +47,18 @@ $system_event = [
|
||||
],
|
||||
//协议类型加载
|
||||
'AgreementType' => [],
|
||||
//站点首页加载
|
||||
'SiteIndex' => [
|
||||
'app\listener\system\SiteIndexListener'
|
||||
],
|
||||
// 站点端布局
|
||||
'SiteLayout' => [
|
||||
'app\listener\system\SiteLayout'
|
||||
],
|
||||
//平台首页加载
|
||||
'AdminIndex' => [
|
||||
'app\listener\system\AdminIndexListener'
|
||||
],
|
||||
'BottomNavigation' => [
|
||||
'app\listener\system\BottomNavigationListener'
|
||||
],
|
||||
@ -100,23 +112,31 @@ $system_event = [
|
||||
'StatField' => [],
|
||||
|
||||
// 获取海报数据
|
||||
'GetPosterType' => [ 'app\listener\system\PosterType' ],
|
||||
'GetPosterData' => [ 'app\listener\system\Poster' ],
|
||||
'GetPosterType' => ['app\listener\system\PosterType'],
|
||||
'GetPosterData' => ['app\listener\system\Poster'],
|
||||
|
||||
// 小程序授权变更事件
|
||||
'WeappAuthChangeAfter' => ['app\listener\system\WeappAuthChangeAfter'],
|
||||
'ShowApp' => [
|
||||
'app\listener\system\ShowAppListener'
|
||||
],
|
||||
'ShowMarketing' => [
|
||||
'app\listener\system\ShowMarketingListener'
|
||||
],
|
||||
'ShowCustomer' => [
|
||||
'app\listener\system\ShowCustomerListener'
|
||||
],
|
||||
//获取微信转账场景配置
|
||||
'GetWechatTransferTradeScene' => [
|
||||
'app\listener\transfer\TransferCashOutListener'
|
||||
],
|
||||
//主题色
|
||||
'ThemeColor' => [ 'app\listener\diy\ThemeColorListener' ],
|
||||
'ThemeColor' => ['app\listener\diy\ThemeColorListener'],
|
||||
'AfterCashApply' => ['app\listener\member\cash\AfterCashApplyListener'],
|
||||
'AfterCashRefuse' => ['app\listener\member\cash\AfterCashRefuseListener'],
|
||||
'AfterCashFinish' => ['app\listener\member\cash\AfterCashFinishListener'],
|
||||
],
|
||||
'subscribe' => [
|
||||
],
|
||||
];
|
||||
return ( new DictLoader("Event") )->load($system_event);
|
||||
return (new DictLoader("Event"))->load($system_event);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
196
niucloud/app/job/refreshArea.php
Normal file
196
niucloud/app/job/refreshArea.php
Normal file
File diff suppressed because one or more lines are too long
@ -27,16 +27,12 @@ class AutoClearPosterAndQrcode extends BaseJob
|
||||
// 清理海报目录
|
||||
$dir = 'upload/poster';
|
||||
$dir = public_path($dir);
|
||||
Log::write('AutoClearPosterAndQrcode尝试清理海报目录: ' . $dir);
|
||||
$res = $this->clearDirectory($dir);
|
||||
Log::write('AutoClearPosterAndQrcode海报目录清理结果: ' . ($res ? '成功' : '失败'));
|
||||
|
||||
// 清理二维码目录
|
||||
$qrcode_dir = 'upload/qrcode';
|
||||
$qrcode_dir = public_path($qrcode_dir);
|
||||
Log::write('AutoClearPosterAndQrcode尝试清理二维码目录: ' . $qrcode_dir);
|
||||
$res = $this->clearDirectory($qrcode_dir);
|
||||
Log::write('AutoClearPosterAndQrcode二维码目录清理结果: ' . ($res ? '成功' : '失败'));
|
||||
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
||||
31
niucloud/app/job/sys/AddonInstall.php
Normal file
31
niucloud/app/job/sys/AddonInstall.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\job\sys;
|
||||
|
||||
use app\service\core\addon\CoreAddonInstallService;
|
||||
use core\base\BaseJob;
|
||||
|
||||
/**
|
||||
* 队列异步执行插件安装任务
|
||||
*/
|
||||
class AddonInstall extends BaseJob
|
||||
{
|
||||
public function doJob($addon, $task)
|
||||
{
|
||||
(new CoreAddonInstallService($addon))->executeTask($task);
|
||||
}
|
||||
|
||||
public function failed($data)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -57,6 +57,7 @@ return [
|
||||
|
||||
//用户管理
|
||||
'USER_NOT_EXIST' => '用户不存在',
|
||||
'ADMIN_NOT_ALLOW_EDIT_ROLE' => '超级管理员不允许改动权限',
|
||||
'USERNAME_REPEAT' => '用户名重复',
|
||||
|
||||
|
||||
|
||||
@ -19,4 +19,4 @@
|
||||
*
|
||||
*/
|
||||
use core\dict\DictLoader;
|
||||
return (new DictLoader("Lang"))->load(["lang_type" =>"zh-cn"]);
|
||||
return (new DictLoader("Lang"))->load(["lang_type" =>"zh-cn"]);
|
||||
@ -24,6 +24,7 @@ return [
|
||||
'ADD_FAIL' => '添加失败',
|
||||
'ADD_SUCCESS' => '添加成功',
|
||||
'UPLOAD_FAIL' => '上传失败',
|
||||
'RELEASE_SUCCESS' => '发布成功',
|
||||
'ATTACHMENT_DELETE_FAIL' => '附件删除失败',
|
||||
'DATA_NOT_EXIST' => '数据不存在',
|
||||
'DOWNLOAD_FAIL' => '下载失败',
|
||||
@ -65,6 +66,7 @@ return [
|
||||
'NOT_EXIST_UPGRADE_CONTENT' => '没有获取到可以升级的内容',
|
||||
'CLOUD_BUILD_AUTH_CODE_NOT_FOUND' => '请先填写授权码',
|
||||
'TASK_CYCLE_ERROR' => '任务周期填写错误',
|
||||
'UPGRADE_TASK_EXIST' => '有正在执行的升级任务,可以展开正在升级的任务,也可以在开发>更新缓存中清除缓存重新开始升级',
|
||||
//登录注册重置账号....
|
||||
|
||||
'LOGIN_SUCCESS' => '登录成功',
|
||||
@ -77,6 +79,7 @@ return [
|
||||
'OLD_PASSWORD_ERROR' => '原始密码不正确',
|
||||
'MOBILE_LOGIN_UNOPENED' => '手机号登录注册未开启',
|
||||
'APP_TYPE_NOT_EXIST' => '无效的登录端口',
|
||||
"USER_NOT_ALLOW_DEL" => "该用户是一些站点的管理员不允许删除",
|
||||
"SUPER_ADMIN_NOT_ALLOW_DEL" => "超级管理员不允许删除",
|
||||
|
||||
//用户组权限
|
||||
@ -96,6 +99,7 @@ return [
|
||||
'USER_NOT_EXIST' => '用户不存在',
|
||||
'ADMIN_NOT_ALLOW_EDIT_ROLE' => '超级管理员不允许改动权限',
|
||||
'USERNAME_REPEAT' => '账号重复',
|
||||
'MOBILE_REPEAT' => '手机号重复',
|
||||
|
||||
//角色管理
|
||||
'USER_ROLE_NOT_EXIST' => '角色不存在',
|
||||
@ -134,8 +138,6 @@ return [
|
||||
'NOTICE_SMS_NOT_OPEN' => '短信未启用',
|
||||
'NOTICE_TEMPLATE_IS_NOT_EXIST' => '消息不存在',
|
||||
|
||||
'WEB_ADV_POSITION_NOT_EXIST' => '广告位不存在',
|
||||
|
||||
//会员相关
|
||||
'MOBILE_IS_EXIST' => '当前手机号已绑定账号',
|
||||
'ACCOUNT_INSUFFICIENT' => '账户余额不足',
|
||||
@ -216,9 +218,9 @@ return [
|
||||
'WEAPP_NOT_EXIST' => '微信小程序未配置完善',
|
||||
'WEAPP_EMPOWER_NOT_EXIST' => '微信小程序授信信息不存在',
|
||||
'WEAPP_EMPOWER_TEL_NOT_EXIST' => '微信小程序授信手机号不存在',
|
||||
'CURR_SITE_IS_NOT_OPEN_SSL' => '微信小程序请求地址只支持https请先配置ssl',
|
||||
'WECHAT_MINI_PROGRAM_CODE_GENERATION_FAILED' => '微信小程序码生成失败',
|
||||
|
||||
|
||||
//支付相关(todo 注意:7段不共享)
|
||||
'ALIPAY_TRANSACTION_NO_NOT_EXIST' => '无效的支付交易号',
|
||||
'PAYMENT_METHOD_NOT_SUPPORT' => '您选择到支付方式不受业务支持',
|
||||
@ -284,6 +286,8 @@ return [
|
||||
// 授权相关
|
||||
'AUTH_NOT_EXISTS' => '未获取到授权信息',
|
||||
|
||||
/********************************************************* home端专用 **************************************/
|
||||
|
||||
// 云服务
|
||||
'CLOUD_WEAPP_COMPILE_NOT_EXIST' => '未找到微信小程序编译包',
|
||||
'WEAPP_APPID_EMPTY' => '还没有配置微信小程序',
|
||||
@ -323,6 +327,14 @@ return [
|
||||
'DIRECTORY' => '目录',
|
||||
'WAS_NOT_CREATED' => '创建失败',
|
||||
|
||||
/********************************************************* 微信开放平台 **************************************/
|
||||
'WECHAT_OPLATFORM_NOT_EXIST' => '未配置微信开放平台',
|
||||
'WEAPP_EXIST' => '该小程序已经授权给其他站点',
|
||||
'WECHAT_EXIST' => '该公众号已经授权给其他站点',
|
||||
'NOT_YET_PRESENT_TEMPLATE_LIBRARY' => '平台尚未上传小程序到模板库',
|
||||
'WEAPP_VERSION_NOT_EXIST' => '未获取到小程序版本提交记录',
|
||||
'NOT_ALLOWED_CANCEL_AUDIT' => '只有审核中的才可以撤回',
|
||||
|
||||
'PRINTER_NOT_EXIST' => '打印机不存在',
|
||||
/*******************************************牛云短信 start ********************************************************/
|
||||
'NIU_SMS_ENABLE_FAILED' => '需登录账号并配置签名后才能启用牛云短信',
|
||||
|
||||
@ -472,5 +472,23 @@ return [
|
||||
'pintuan_name' => '拼团',
|
||||
'seckill_short' => '秒',
|
||||
'seckill_name' => '秒杀',
|
||||
'relay_short' => '接',
|
||||
'relay_name' => '接龙',
|
||||
'friend_help_short' => '友',
|
||||
'friend_help_name' => '好友助力',
|
||||
],
|
||||
//应用菜单下 特殊菜单定义
|
||||
'dict_addon_menu' => [
|
||||
'system_tool_short' => '系统',
|
||||
'system_tool' => '系统工具',
|
||||
|
||||
'marking_tool_short' => '工具',
|
||||
'marking_tool' => '营销工具',
|
||||
|
||||
'marking_active_short' => '活动',
|
||||
'marking_active' => '营销活动',
|
||||
|
||||
'addon_tool_short' => '插件',
|
||||
'addon_tool' => '应用插件',
|
||||
]
|
||||
];
|
||||
|
||||
@ -87,4 +87,4 @@ class ThemeColorListener
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
31
niucloud/app/listener/member/cash/AfterCashApplyListener.php
Normal file
31
niucloud/app/listener/member/cash/AfterCashApplyListener.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\listener\member\cash;
|
||||
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
*
|
||||
* Class AfterCashApplyListener
|
||||
* @package app\listener\member\cash
|
||||
*/
|
||||
class AfterCashApplyListener
|
||||
{
|
||||
public function handle($params)
|
||||
{
|
||||
$member_id = $params['member_id'];
|
||||
$data = $params['data'];
|
||||
Log::write("发起提现后事件接收参数 member_id:{$member_id} data:" . json_encode($data, 256));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\listener\member\cash;
|
||||
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
*提现完成后事件
|
||||
* Class AfterCashFinishListener
|
||||
* @package app\listener\member\cash
|
||||
*/
|
||||
class AfterCashFinishListener
|
||||
{
|
||||
public function handle($params)
|
||||
{
|
||||
$cash_out = $params['cash_out'];
|
||||
Log::write("提现完成后事件接收参数 data:".json_encode($cash_out,256));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\listener\member\cash;
|
||||
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
*提现被拒绝后事件
|
||||
* Class AfterCashRefuseListener
|
||||
* @package app\listener\member\cash
|
||||
*/
|
||||
class AfterCashRefuseListener
|
||||
{
|
||||
public function handle($params)
|
||||
{
|
||||
$cash_out = $params['cash_out'];
|
||||
Log::write("拒绝提现后事件接收参数 data:" . json_encode($cash_out, 256));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,7 @@ class WechatQrcodeListener extends BaseNoticeTemplate
|
||||
|
||||
public function handle(array $params)
|
||||
{
|
||||
if ('wechat' == $params['channel'] || $params['channel'] == 'h5') {
|
||||
if ('wechat' == $params['channel'] || $params['channel'] == 'h5' || $params['channel'] == 'app') {
|
||||
$page = $params['page'];
|
||||
$url = $params['url'];
|
||||
$data = $params['data'];
|
||||
@ -33,7 +33,7 @@ class WechatQrcodeListener extends BaseNoticeTemplate
|
||||
$url .= '?'.implode('&', $scene);
|
||||
}
|
||||
ob_start();//开启缓冲区
|
||||
\core\util\QRcode::png($url, $path, QR_ECLEVEL_L, 4, 1);
|
||||
\core\util\QRcode::png($url, $path, QR_ECLEVEL_L, 10, 1);
|
||||
if($outfile === false){
|
||||
$img = ob_get_contents();//获取缓冲区内容
|
||||
$path = 'data:image/png;base64,' . base64_encode($img);//转base64
|
||||
@ -44,4 +44,4 @@ class WechatQrcodeListener extends BaseNoticeTemplate
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,4 +41,4 @@ class ScanListener
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
niucloud/app/listener/system/AdminIndexListener.php
Normal file
30
niucloud/app/listener/system/AdminIndexListener.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\listener\system;
|
||||
|
||||
/**
|
||||
* 平台首页加载事件
|
||||
* Class AdminIndexListenerIndex
|
||||
* @package app\listener\system
|
||||
*/
|
||||
class AdminIndexListener
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
return [
|
||||
[
|
||||
"name" => get_lang("dict_admin_index.system"),
|
||||
"view_path" => "index/index"
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -49,4 +49,4 @@ class AppManageListener
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
75
niucloud/app/listener/system/ShowCustomerListener.php
Normal file
75
niucloud/app/listener/system/ShowCustomerListener.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\listener\system;
|
||||
|
||||
use app\dict\menu\MenuDict;
|
||||
|
||||
/**
|
||||
* 查询营销列表
|
||||
* Class ShowAppListener
|
||||
* @package app\listener\system
|
||||
*/
|
||||
class ShowCustomerListener
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
// 应用:app、addon 待定
|
||||
// 营销:marketing
|
||||
// 工具:tool
|
||||
return [
|
||||
// 应用
|
||||
MenuDict::ADDON_CHILD_MENU_DICT_SYSTEM_TOOL => [
|
||||
[
|
||||
'title' => '核销管理',
|
||||
'desc' => '管理核销员及核销记录',
|
||||
'icon' => 'static/resource/images/marketing/verifier.png',
|
||||
'key' => 'verify',
|
||||
'url' => '/marketing/verify/index',
|
||||
],
|
||||
[
|
||||
'title' => '万能表单',
|
||||
'desc' => '适用于各种应用场景,满足多样化的业务需求',
|
||||
'icon' => 'static/resource/images/diy_form/icon.png',
|
||||
'key' => 'diy_form',
|
||||
'url' => '/diy_form/list',
|
||||
],
|
||||
[
|
||||
'title' => '小票打印',
|
||||
'desc' => '支持打印机添加,便捷创建小票打印模板',
|
||||
'icon' => 'static/resource/images/tool/printer_icon.png',
|
||||
'key' => 'printer_management',
|
||||
'url' => '/printer/list',
|
||||
],
|
||||
[
|
||||
'title' => '数据导出',
|
||||
'desc' => '展示导出文件,支持删除与下载',
|
||||
'icon' => 'static/resource/images/tool/export_icon.png',
|
||||
'key' => 'setting_export',
|
||||
'url' => '/setting/export',
|
||||
],
|
||||
],
|
||||
// 工具
|
||||
MenuDict::ADDON_CHILD_MENU_DICT_MARKING_TOOL => [
|
||||
],
|
||||
// 营销
|
||||
MenuDict::ADDON_CHILD_MENU_DICT_MARKING_ACTIVE => [
|
||||
[
|
||||
'title' => '签到管理',
|
||||
'desc' => '客户每日签到发放奖励',
|
||||
'icon' => 'static/resource/images/marketing/sign.png',
|
||||
'key' => 'sign',
|
||||
'url' => '/marketing/sign/config',
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
49
niucloud/app/model/sys/AppVersion.php
Normal file
49
niucloud/app/model/sys/AppVersion.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\sys;
|
||||
|
||||
use app\dict\channel\AppDict;
|
||||
use core\base\BaseModel;
|
||||
use think\db\Query;
|
||||
|
||||
class AppVersion extends BaseModel
|
||||
{
|
||||
protected $pk = 'id';
|
||||
|
||||
//类型
|
||||
protected $type = [
|
||||
'release_time' => 'timestamp',
|
||||
];
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'app_version';
|
||||
|
||||
public function searchPlatformAttr(Query $query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('platform', $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function getPlatformNameAttr($value, $data)
|
||||
{
|
||||
return AppDict::getAppPlatformName($data['platform']);
|
||||
}
|
||||
|
||||
public function getStatusNameAttr($value, $data)
|
||||
{
|
||||
return AppDict::getStatusName($data['status']);
|
||||
}
|
||||
}
|
||||
@ -45,19 +45,6 @@ class SysNoticeLog extends BaseModel
|
||||
// 设置JSON数据返回数组
|
||||
protected $jsonAssoc = true;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
*/
|
||||
public function getContentAttr($value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$temp = json_decode($value, true);
|
||||
}
|
||||
return $temp ?? $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 名称
|
||||
|
||||
@ -14,6 +14,7 @@ namespace app\model\sys;
|
||||
use app\dict\sys\UserDict;
|
||||
use core\base\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
use think\model\relation\HasMany;
|
||||
|
||||
/**
|
||||
* 系统用户模型
|
||||
@ -56,22 +57,11 @@ class SysUser extends BaseModel
|
||||
*/
|
||||
protected $defaultSoftDelete = 0;
|
||||
|
||||
/**
|
||||
* 状态字段转化
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return mixed
|
||||
*/
|
||||
public function getStatusNameAttr($value, $data)
|
||||
{
|
||||
if (empty($data[ 'status' ])) return '';
|
||||
return UserDict::getStatus()[ $data[ 'status' ] ] ?? '';
|
||||
}
|
||||
|
||||
|
||||
public function getCreateTimeAttr($value, $data)
|
||||
{
|
||||
return $data[ 'create_time' ] ? get_date_by_time($data[ 'create_time' ]) : '';
|
||||
return $data['create_time'] ? get_date_by_time($data['create_time']) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,6 +90,18 @@ class SysUser extends BaseModel
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色状态
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
*/
|
||||
public function getStatusNameAttr($value, $data)
|
||||
{
|
||||
if (empty($data['status'])) return '';
|
||||
return UserDict::getStatus()[$data['status']] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否删除搜索器
|
||||
* @param $query
|
||||
@ -117,14 +119,14 @@ class SysUser extends BaseModel
|
||||
*/
|
||||
public function searchCreateTimeAttr($query, $value, $data)
|
||||
{
|
||||
$start_time = empty($value[ 0 ]) ? 0 : strtotime($value[ 0 ]);
|
||||
$end_time = empty($value[ 1 ]) ? 0 : strtotime($value[ 1 ]);
|
||||
$start_time = empty($value[0]) ? 0 : strtotime($value[0]);
|
||||
$end_time = empty($value[1]) ? 0 : strtotime($value[1]);
|
||||
if ($start_time > 0 && $end_time > 0) {
|
||||
$query->whereBetweenTime('sys_user.create_time', $start_time, $end_time);
|
||||
} else if ($start_time > 0 && $end_time == 0) {
|
||||
$query->where([ [ 'sys_user.create_time', '>=', $start_time ] ]);
|
||||
$query->where([['sys_user.create_time', '>=', $start_time]]);
|
||||
} else if ($start_time == 0 && $end_time > 0) {
|
||||
$query->where([ [ 'sys_user.create_time', '<=', $end_time ] ]);
|
||||
$query->where([['sys_user.create_time', '<=', $end_time]]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,14 +138,14 @@ class SysUser extends BaseModel
|
||||
*/
|
||||
public function searchLastTimeAttr($query, $value, $data)
|
||||
{
|
||||
$start_time = empty($value[ 0 ]) ? 0 : strtotime($value[ 0 ]);
|
||||
$end_time = empty($value[ 1 ]) ? 0 : strtotime($value[ 1 ]);
|
||||
$start_time = empty($value[0]) ? 0 : strtotime($value[0]);
|
||||
$end_time = empty($value[1]) ? 0 : strtotime($value[1]);
|
||||
if ($start_time > 0 && $end_time > 0) {
|
||||
$query->whereBetweenTime('sys_user.last_time', $start_time, $end_time);
|
||||
} else if ($start_time > 0 && $end_time == 0) {
|
||||
$query->where([ [ 'sys_user.last_time', '>=', $start_time ] ]);
|
||||
$query->where([['sys_user.last_time', '>=', $start_time]]);
|
||||
} else if ($start_time == 0 && $end_time > 0) {
|
||||
$query->where([ [ 'sys_user.last_time', '<=', $end_time ] ]);
|
||||
$query->where([['sys_user.last_time', '<=', $end_time]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ class AddonDevelopService extends BaseAdminService
|
||||
/**
|
||||
* 下载
|
||||
* @param string $key
|
||||
* @return array|string|string[]|\think\response\File
|
||||
* @return \think\response\File
|
||||
*/
|
||||
public function download(string $key){
|
||||
return (new CoreAddonDevelopBuildService())->download($key);
|
||||
|
||||
@ -13,8 +13,10 @@ namespace app\service\admin\addon;
|
||||
|
||||
|
||||
use app\dict\addon\AddonDict;
|
||||
use app\dict\menu\MenuDict;
|
||||
use app\model\addon\Addon;
|
||||
use app\model\sys\SysMenu;
|
||||
use app\service\admin\auth\AuthService;
|
||||
use app\service\core\addon\CoreAddonCloudService;
|
||||
use app\service\core\addon\CoreAddonDownloadService;
|
||||
use app\service\core\addon\CoreAddonInstallService;
|
||||
@ -273,6 +275,112 @@ class AddonService extends BaseAdminService
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
*/
|
||||
public function showCustomer($is_sort=true)
|
||||
{
|
||||
$show_list = event('ShowCustomer', []);
|
||||
$addon_type_list = MenuDict::getAddonChildMenu();
|
||||
$return = [];
|
||||
foreach ($show_list as $item) {
|
||||
foreach ($addon_type_list as $key => $value) {
|
||||
if (!isset($return[$key])) {
|
||||
$return[$key] = [
|
||||
'title' => $value['name'],
|
||||
'sort' => $value['sort'],
|
||||
'list' => [],
|
||||
];
|
||||
}
|
||||
$return[$key]['list'] = array_merge($return[$key]['list'], $item[$key] ?? []);
|
||||
}
|
||||
}
|
||||
|
||||
//防止有未实现对应事件的插件额外做一次查询 未实现的直接放到 addon_tool 里面
|
||||
$keys = [];
|
||||
foreach ($return as $item) {
|
||||
foreach ($item['list'] as $value) {
|
||||
$keys[] = $value['key'];
|
||||
}
|
||||
}
|
||||
$addon_list = $this->getAddonList([]);
|
||||
$menu_model = (new SysMenu());
|
||||
$addon_urls = $menu_model
|
||||
->where([['addon', 'in', array_column($addon_list, 'key')], ['addon', 'not in', $keys], ['is_show', '=', 1], ['menu_type', '=', 1]])
|
||||
->order('id asc')
|
||||
->group('addon')
|
||||
->column('router_path', 'addon');
|
||||
if (!empty($addon_list)) {
|
||||
foreach ($addon_list as $k => $v) {
|
||||
if (in_array($v['key'], $keys)) {
|
||||
continue;
|
||||
}
|
||||
$url = $addon_urls[$v['key']] ?? '';
|
||||
$return['addon_tool']['list'][] = [
|
||||
'title' => $v['title'],
|
||||
'desc' => $v['desc'],
|
||||
'icon' => $v['icon'],
|
||||
'key' => $v['key'],
|
||||
'url' => $url ? '/' . $url : ''
|
||||
];
|
||||
}
|
||||
}
|
||||
if($is_sort){
|
||||
usort($return, function (array $a, array $b) {
|
||||
$sortA = isset($a['sort']) ? (int)$a['sort'] : 0;
|
||||
$sortB = isset($b['sort']) ? (int)$b['sort'] : 0;
|
||||
return $sortB <=> $sortA;
|
||||
});
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
//生成菜单数据
|
||||
public function getSpecialMenuList()
|
||||
{
|
||||
$auth_menu_list = (new AuthService())->getAuthMenuList('all',1);
|
||||
$auth_menu_list = array_column($auth_menu_list, null, 'menu_key');
|
||||
$auth_menu_list = $auth_menu_list['addon']['children'] ?? [];
|
||||
$list = $this->showCustomer(false);//获取对应的需要展示的key
|
||||
$addon_menu_list = MenuDict::getAddonChildMenu();
|
||||
$menu_list = [];
|
||||
foreach ($addon_menu_list as $item) {
|
||||
$menu_key_list = array_column($list[$item['key']]['list'] ?? [], 'key');
|
||||
$temp_menu = [
|
||||
'app_type'=>'admin',
|
||||
'menu_name' => $item['name'],
|
||||
'menu_key' => $item['key'],
|
||||
'menu_short_name' => $item['short_name'],
|
||||
'parent_key' => 'addon',
|
||||
'menu_type' => '0',
|
||||
'icon' => 'iconfont iconzhuangxiu3',
|
||||
'api_url' => '',
|
||||
'router_path' => 'app/index',
|
||||
'view_path' => 'app/index',
|
||||
'methods' => 'get',
|
||||
'sort' => $item['sort'],
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
];
|
||||
$children = [];
|
||||
foreach ($auth_menu_list as $datum_item) {
|
||||
if (in_array($datum_item['menu_key'], $menu_key_list)) {
|
||||
$children[] = $datum_item;
|
||||
}
|
||||
}
|
||||
$temp_menu['children'] = $children;
|
||||
$menu_list[] = $temp_menu;
|
||||
}
|
||||
usort($menu_list, function (array $a, array $b) {
|
||||
$sortA = isset($a['sort']) ? (int)$a['sort'] : 0;
|
||||
$sortB = isset($b['sort']) ? (int)$b['sort'] : 0;
|
||||
return $sortB <=> $sortA;
|
||||
});
|
||||
return [
|
||||
'parent_key' => 'addon',
|
||||
'list' => $menu_list
|
||||
];
|
||||
}
|
||||
|
||||
private function getAllAddonAndTool()
|
||||
{
|
||||
$markting_list = $this->getMarketing() ?? [];
|
||||
|
||||
@ -38,6 +38,8 @@ class ConfigService extends BaseAdminService
|
||||
{
|
||||
$info = (new CoreConfigService())->getConfig(ConfigKeyDict::ADMIN_LOGIN)['value'] ?? [];
|
||||
return [
|
||||
'login_logo' => '',
|
||||
'login_bg_img' => '',
|
||||
'is_captcha' => $info['is_captcha'] ?? 0,//是否启用验证码
|
||||
'bg' => $info['bg'] ?? config('install.admin_login_bg'),//平台登录端 背景
|
||||
];
|
||||
@ -53,6 +55,8 @@ class ConfigService extends BaseAdminService
|
||||
$config = [
|
||||
'is_captcha' => $data['is_captcha'] ?? 0,//是否启用验证码
|
||||
'bg' => $data['bg'] ?? '',//平台登录端 背景
|
||||
'login_logo' => $data['login_logo'] ?? '',//平台登录端 背景
|
||||
'login_bg_img' => $data['login_bg_img'] ?? '',//平台登录端 背景
|
||||
];
|
||||
(new CoreConfigService())->setConfig(ConfigKeyDict::ADMIN_LOGIN, $config);
|
||||
return true;
|
||||
|
||||
@ -47,4 +47,4 @@ class CaptchaService extends BaseAdminService
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -11,11 +11,12 @@
|
||||
|
||||
namespace app\service\admin\channel;
|
||||
|
||||
use app\dict\sys\ConfigKeyDict;
|
||||
use app\dict\channel\AppDict;
|
||||
use app\model\sys\AppVersion;
|
||||
use app\service\core\channel\CoreAppCloudService;
|
||||
use app\service\core\channel\CoreAppService;
|
||||
use app\service\core\channel\CoreH5Service;
|
||||
use app\service\core\sys\CoreConfigService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\CommonException;
|
||||
|
||||
/**
|
||||
* 配置服务层
|
||||
@ -24,6 +25,13 @@ use core\base\BaseAdminService;
|
||||
*/
|
||||
class AppService extends BaseAdminService
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new AppVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置app信息
|
||||
* @param array $value
|
||||
@ -41,4 +49,133 @@ class AppService extends BaseAdminService
|
||||
public function getConfig(){
|
||||
return (new CoreAppService())->getConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DbException
|
||||
*/
|
||||
public function getVersionPage(array $where = [])
|
||||
{
|
||||
$order = 'id desc';
|
||||
$search_model = $this->model->where([ [ 'id' ,">", 0 ] ])->withSearch(["platform"], $where)->append(['platform_name', 'status_name'])->field("*")->order($order);
|
||||
$list = $this->pageQuery($search_model);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return AppVersion|array|mixed|\think\Model
|
||||
*/
|
||||
public function getVersionInfo($id) {
|
||||
return $this->model->where([ ['id', '=', $id] ])->findOrEmpty()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加版本
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
*/
|
||||
public function addVersion(array $data) {
|
||||
$not_release = $this->model->where([['release_time', '=', 0]])->findOrEmpty();
|
||||
if (!$not_release->isEmpty()) throw new CommonException("当前已存在未发布的版本");
|
||||
|
||||
$last_version = $this->model->where([['id', '>', 0]])->order('id desc')->findOrEmpty();
|
||||
if (!$last_version->isEmpty() && $data['version_code'] <= $last_version['version_code']) throw new CommonException("版本号必须高于上一版本设置的值");
|
||||
|
||||
|
||||
$model = [
|
||||
'version_code' => $data['version_code'],
|
||||
'version_name' => $data['version_name'],
|
||||
'version_desc' => $data['version_desc'],
|
||||
'platform' => $data['platform'],
|
||||
'is_forced_upgrade' => $data['is_forced_upgrade'],
|
||||
'package_path' => $data['package_path'],
|
||||
'upgrade_type' => $data['upgrade_type'],
|
||||
];
|
||||
|
||||
if ($data['package_type'] == 'cloud') {
|
||||
$task_key = (new CoreAppCloudService())->appCloudBuid($data);
|
||||
$model['task_key'] = $task_key['key'];
|
||||
$model['status'] = AppDict::STATUS_CREATING;
|
||||
} else {
|
||||
$model['status'] = AppDict::STATUS_UPLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
$res = $this->model->create($model);
|
||||
return $res->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑版本
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @return true
|
||||
*/
|
||||
public function editVersion(int $id, array $data)
|
||||
{
|
||||
$last_version = $this->model->where([ ['id', '<>', $id]])->order('id desc')->findOrEmpty();
|
||||
if (!$last_version->isEmpty() && $data['version_code'] <= $last_version['version_code']) throw new CommonException("版本号必须高于上一版本设置的值");
|
||||
|
||||
|
||||
$model = [
|
||||
'version_code' => $data['version_code'],
|
||||
'version_name' => $data['version_name'],
|
||||
'version_desc' => $data['version_desc'],
|
||||
'platform' => $data['platform'],
|
||||
'is_forced_upgrade' => $data['is_forced_upgrade'],
|
||||
'package_path' => $data['package_path'],
|
||||
'upgrade_type' => $data['upgrade_type'],
|
||||
];
|
||||
|
||||
if ($data['package_type'] == 'cloud') {
|
||||
$task_key = (new CoreAppCloudService())->appCloudBuid($data);
|
||||
$model['task_key'] = $task_key['key'];
|
||||
$model['status'] = AppDict::STATUS_CREATING;
|
||||
} else {
|
||||
$model['status'] = AppDict::STATUS_UPLOAD_SUCCESS;
|
||||
}
|
||||
$this->model->where([['id', '=', $id]])->update($model);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除app版本
|
||||
* @param int $id
|
||||
* @return bool
|
||||
*/
|
||||
public function delVersion(int $id)
|
||||
{
|
||||
$model = $this->model->where([['id', '=', $id]])->find();
|
||||
$res = $model->delete();
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function getBuildLog(string $key) {
|
||||
$result = (new CoreAppCloudService())->getAppCompileLog($key);
|
||||
if ($result['status'] == 'fail') {
|
||||
$this->model->update(['status' => AppDict::STATUS_CREATE_FAIL, 'fail_reason' => $result['fail_reason'], 'update_time' => time() ], ['task_key' => $key]);
|
||||
}
|
||||
if ($result['status'] == 'success') {
|
||||
$this->model->update(['status' => AppDict::STATUS_UPLOAD_SUCCESS, 'package_path' => $result['file_path'], 'update_time' => time() ], ['task_key' => $key]);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布
|
||||
* @param string $key
|
||||
* @return void
|
||||
*/
|
||||
public function release(int $id) {
|
||||
$version = $this->model->where([['id', '=', $id]])->findOrEmpty();
|
||||
if ($version->isEmpty()) throw new CommonException("版本不存在");
|
||||
if ($version['status'] != AppDict::STATUS_UPLOAD_SUCCESS) throw new CommonException("版本未上传成功");
|
||||
|
||||
$this->model->update(['release_time' => time(), 'status' => AppDict::STATUS_PUBLISHED], ['id' => $id]);
|
||||
}
|
||||
|
||||
public function generateSingCert($data) {
|
||||
return (new CoreAppCloudService())->generateSingCert($data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -779,7 +779,7 @@ class DiyService extends BaseAdminService
|
||||
*/
|
||||
public function getDiyTheme()
|
||||
{
|
||||
$addon_list = ( new CoreAddonService() )->getInstallAddonList();
|
||||
$addon_list = ( new CoreAddonService() )->getInstallAddonList(false);
|
||||
$apps = [];
|
||||
foreach ($addon_list as $k => $v) {
|
||||
if ($v[ 'type' ] == 'app') {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user