mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-02-27 10:00:25 +00:00
update niucloud
This commit is contained in:
parent
e827f909aa
commit
00f6383d37
21
niucloud/addon/hello_world/admin/src/layout/hellow/index.vue
Normal file
21
niucloud/addon/hello_world/admin/src/layout/hellow/index.vue
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<template>
|
||||||
|
<el-container class="w-screen h-screen">
|
||||||
|
<el-header>
|
||||||
|
<layout-header />
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<router-view></router-view>
|
||||||
|
</el-main>
|
||||||
|
<el-footer>
|
||||||
|
<div class="w-full h-full bg-[#f7f7f7] flex items-center justify-center">
|
||||||
|
Footer
|
||||||
|
</div>
|
||||||
|
</el-footer>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import layoutHeader from '@/layout/default/components/header/index.vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@ -9,6 +9,7 @@ return [
|
|||||||
|
|
||||||
//应用管理
|
//应用管理
|
||||||
'AppManage' => ['addon\hello_world\app\listener\AppManageListener'],
|
'AppManage' => ['addon\hello_world\app\listener\AppManageListener'],
|
||||||
|
'SiteLayout' => ['addon\hello_world\app\listener\SiteLayout']
|
||||||
],
|
],
|
||||||
|
|
||||||
'subscribe' => [
|
'subscribe' => [
|
||||||
|
|||||||
@ -19,5 +19,8 @@ return [
|
|||||||
'hello_world_link' => 'hello world链接',
|
'hello_world_link' => 'hello world链接',
|
||||||
'hello_world_index' => 'hello world index 插件',
|
'hello_world_index' => 'hello world index 插件',
|
||||||
'hello_world_info' => 'hello world info 插件'
|
'hello_world_info' => 'hello world info 插件'
|
||||||
|
],
|
||||||
|
'dict_site_layout' => [
|
||||||
|
'hellow_world' => '你好'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class AppManageListener
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 应用管理
|
* 应用管理
|
||||||
* @param $data
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
|||||||
29
niucloud/addon/hello_world/app/listener/SiteLayout.php
Normal file
29
niucloud/addon/hello_world/app/listener/SiteLayout.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网址:https://www.niucloud-admin.com
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | niucloud团队 版权所有 开源版本可自由商用
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: Niucloud Team
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
namespace addon\hello_world\app\listener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点端布局
|
||||||
|
*/
|
||||||
|
class SiteLayout
|
||||||
|
{
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
"name" => get_lang("dict_site_layout.hellow_world"),
|
||||||
|
"key" => "hellow",
|
||||||
|
"image" => "static/resource/images/system/layout-hellow.jpg",
|
||||||
|
"sort" => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,7 +4,6 @@
|
|||||||
"key": "hello_world",
|
"key": "hello_world",
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"author": "niucloud",
|
"author": "niucloud",
|
||||||
"url": "https://www.niucloud.com",
|
|
||||||
"type": "addon",
|
"type": "addon",
|
||||||
"support_app": "niucloud"
|
"support_app": "niucloud"
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@ -99,13 +99,13 @@ class ExceptionHandle extends Handle
|
|||||||
'previous' => $e->getPrevious(),
|
'previous' => $e->getPrevious(),
|
||||||
]);
|
]);
|
||||||
} elseif ($e instanceof ValidateException) {
|
} elseif ($e instanceof ValidateException) {
|
||||||
return fail($e->getMessage(), []);
|
return fail($e->getMessage());
|
||||||
} else if($e instanceof UnexpectedValueException){
|
} else if($e instanceof UnexpectedValueException){
|
||||||
return fail($e->getMessage(), [], 401);
|
return fail($e->getMessage(), [], 401);
|
||||||
}else if($e instanceof AuthException || $e instanceof AdminException){
|
}else if($e instanceof AuthException || $e instanceof AdminException){
|
||||||
return fail($e->getMessage(), [], $e->getCode() ?: 400);
|
return fail($e->getMessage(), [], $e->getCode() ?: 400);
|
||||||
}else if($e instanceof ServerException){
|
}else if($e instanceof ServerException){
|
||||||
return fail($e->getMessage(), [], http_code:$e->getCode());
|
return fail($e->getMessage(), http_code:$e->getCode());
|
||||||
}else {
|
}else {
|
||||||
return fail($e->getMessage(), $massageData);
|
return fail($e->getMessage(), $massageData);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,13 +28,19 @@ class Request extends \think\Request
|
|||||||
$filter_rule = '';
|
$filter_rule = '';
|
||||||
foreach ($params as $param) {
|
foreach ($params as $param) {
|
||||||
$key = $param[0];
|
$key = $param[0];
|
||||||
|
// 解析name
|
||||||
|
if (strpos($key, '/')) {
|
||||||
|
[$name, $type] = explode('/', $key);
|
||||||
|
}else{
|
||||||
|
$name = $key;
|
||||||
|
}
|
||||||
$default = $param[1];
|
$default = $param[1];
|
||||||
$item_filter = $param[2] ?? $filter;
|
$item_filter = $param[2] ?? $filter;
|
||||||
$input[$key] = $this->paramFilter($this->param($key, $default, $filter_rule ?? ''), $item_filter);
|
$input[$key] = $this->paramFilter($this->param($key, $default, $filter_rule ?? ''), $item_filter);
|
||||||
//过滤后产生空字符串,按照默认值
|
//过滤后产生空字符串,按照默认值
|
||||||
if($input[$key] === '')
|
if($input[$name] === '')
|
||||||
{
|
{
|
||||||
$input[$key] = $default;
|
$input[$name] = $default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $input;
|
return $input;
|
||||||
@ -55,13 +61,13 @@ class Request extends \think\Request
|
|||||||
"/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",
|
"/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",
|
||||||
"/select|join|where|drop|like|modify|rename|insert|update|table|database|alter|truncate|\'|\/\*|\.\.\/|\.\/|union|into|load_file|outfile/is"
|
"/select|join|where|drop|like|modify|rename|insert|update|table|database|alter|truncate|\'|\/\*|\.\.\/|\.\/|union|into|load_file|outfile/is"
|
||||||
];
|
];
|
||||||
$param = preg_replace($filter_rule, '', $param);
|
return preg_replace($filter_rule, '', $param);
|
||||||
return $param;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取登录用户的uid
|
* 获取登录用户的uid
|
||||||
* @param $params
|
* @param int $uid
|
||||||
|
* @return int|mixed|void
|
||||||
*/
|
*/
|
||||||
public function uid(int $uid = 0)
|
public function uid(int $uid = 0)
|
||||||
{
|
{
|
||||||
@ -87,7 +93,7 @@ class Request extends \think\Request
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点id
|
* 站点id
|
||||||
* @param int $site_id
|
* @param int|string|null $site_id
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function siteId(int|string|null $site_id = 0)
|
public function siteId(int|string|null $site_id = 0)
|
||||||
@ -116,7 +122,7 @@ class Request extends \think\Request
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 定义站点类型
|
* 定义站点类型
|
||||||
* @param string $site_type
|
* @param string $app_type
|
||||||
* @return mixed|string
|
* @return mixed|string
|
||||||
*/
|
*/
|
||||||
public function appType(string $app_type = ''){
|
public function appType(string $app_type = ''){
|
||||||
@ -129,7 +135,7 @@ class Request extends \think\Request
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取管理端token
|
* 获取管理端token
|
||||||
* @return void
|
* @return array|string|null
|
||||||
*/
|
*/
|
||||||
public function adminToken(){
|
public function adminToken(){
|
||||||
return $this->header(system_name('admin_token_name'));
|
return $this->header(system_name('admin_token_name'));
|
||||||
@ -195,4 +201,18 @@ class Request extends \think\Request
|
|||||||
$param = $this->header();
|
$param = $this->header();
|
||||||
$this->withHeader(array_merge($param, $data));
|
$this->withHeader(array_merge($param, $data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权信息
|
||||||
|
* @param $key
|
||||||
|
* @param $value
|
||||||
|
* @return mixed|string|void
|
||||||
|
*/
|
||||||
|
public function auth($key, $value = ''){
|
||||||
|
if (!empty($value)) {
|
||||||
|
static::$auth_info[$key] = $value;
|
||||||
|
} else {
|
||||||
|
return static::$auth_info[$key] ?? '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class Addon extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 执行安装
|
* 执行安装
|
||||||
* @param $addon
|
* @param $addon
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function execute($addon)
|
public function execute($addon)
|
||||||
{
|
{
|
||||||
@ -49,7 +49,7 @@ class Addon extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 插件安装环境检测
|
* 插件安装环境检测
|
||||||
* @param $addon
|
* @param $addon
|
||||||
* @return mixed
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function installCheck($addon)
|
public function installCheck($addon)
|
||||||
{
|
{
|
||||||
@ -59,6 +59,8 @@ class Addon extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 查询插件安装状态
|
* 查询插件安装状态
|
||||||
* @param $addon
|
* @param $addon
|
||||||
|
* @param $key
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getInstallState($addon, $key)
|
public function getInstallState($addon, $key)
|
||||||
{
|
{
|
||||||
@ -90,6 +92,7 @@ class Addon extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 插件详情
|
* 插件详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
@ -108,5 +111,24 @@ class Addon extends BaseAdminController
|
|||||||
return success('SET_SUCCESS');
|
return success('SET_SUCCESS');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载插件
|
||||||
|
* @param $app_key
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function download($addon){
|
||||||
|
(new AddonService())->download($addon);
|
||||||
|
return success('DOWNLOAD_SUCCESS');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新插件
|
||||||
|
* @param $app_key
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function update($addon){
|
||||||
|
(new AddonService())->update($addon);
|
||||||
|
return success('DOWNLOAD_SUCCESS');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,8 @@ class Config extends BaseAdminController
|
|||||||
* 获取支付宝配置信息
|
* 获取支付宝配置信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function get(){
|
public function get()
|
||||||
|
{
|
||||||
return success((new AliappConfigService())->getAliappConfig());
|
return success((new AliappConfigService())->getAliappConfig());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +30,8 @@ class Config extends BaseAdminController
|
|||||||
* 设置支付宝配置信息
|
* 设置支付宝配置信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function set(){
|
public function set()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['name', ''],
|
['name', ''],
|
||||||
['app_id', ''],
|
['app_id', ''],
|
||||||
@ -49,7 +51,8 @@ class Config extends BaseAdminController
|
|||||||
* 静态资源
|
* 静态资源
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function static(){
|
public function static()
|
||||||
|
{
|
||||||
return success((new AliappConfigService())->static());
|
return success((new AliappConfigService())->static());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,8 +11,6 @@
|
|||||||
|
|
||||||
namespace app\adminapi\controller\applet;
|
namespace app\adminapi\controller\applet;
|
||||||
|
|
||||||
use app\model\applet\AppletSiteVersion;
|
|
||||||
use app\service\admin\applet\AppletVersionService;
|
|
||||||
use app\service\admin\applet\AppletVersionSiteService;
|
use app\service\admin\applet\AppletVersionSiteService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
@ -37,6 +35,7 @@ class SiteVersion extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 详情
|
* 详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
@ -48,9 +47,19 @@ class SiteVersion extends BaseAdminController
|
|||||||
* @param string $type
|
* @param string $type
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getLastVersion(string $type){
|
public function getLastVersion(string $type)
|
||||||
|
{
|
||||||
return success((new AppletVersionSiteService())->getLastVersion($type));
|
return success((new AppletVersionSiteService())->getLastVersion($type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看可升级的最高版本
|
||||||
|
* @param string $type
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function getUpgradeVersion(string $type)
|
||||||
|
{
|
||||||
|
return success((new AppletVersionSiteService())->getUpgradeVersion($type));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\applet;
|
|||||||
|
|
||||||
use app\service\admin\applet\AppletVersionService;
|
use app\service\admin\applet\AppletVersionService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use Exception;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,6 +36,7 @@ class Version extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 详情
|
* 详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
@ -79,6 +81,7 @@ class Version extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del(int $id)
|
public function del(int $id)
|
||||||
{
|
{
|
||||||
@ -89,22 +92,25 @@ class Version extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 设置状态
|
* 设置状态
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param $type
|
* @param $status
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setStatus(int $id, $status){
|
public function setStatus(int $id, $status)
|
||||||
|
{
|
||||||
(new AppletVersionService())->setStatus($id, $status);
|
(new AppletVersionService())->setStatus($id, $status);
|
||||||
return success('EDIT_SUCCESS');
|
return success('EDIT_SUCCESS');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序包上传
|
* 小程序包上传
|
||||||
* @return Response
|
* @return Response
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function upload(){
|
public function upload()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['file', 'file'],
|
['file', 'file'],
|
||||||
], true);
|
]);
|
||||||
return success(data: (new AppletVersionService())->upload($data['file']));
|
return success(data: (new AppletVersionService())->upload($data['file']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\applet;
|
|||||||
|
|
||||||
use app\service\admin\applet\AppletDownloadService;
|
use app\service\admin\applet\AppletDownloadService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\response\File;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序版本下载控制器
|
* 小程序版本下载控制器
|
||||||
@ -23,9 +24,10 @@ class VersionDownload extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 下载
|
* 下载
|
||||||
* @param $id
|
* @param $id
|
||||||
* @return mixed
|
* @return File
|
||||||
*/
|
*/
|
||||||
public function download($id){
|
public function download($id)
|
||||||
|
{
|
||||||
return (new AppletDownloadService())->download($id);
|
return (new AppletDownloadService())->download($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,7 @@ class Article extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 文章详情
|
* 文章详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
@ -96,6 +97,7 @@ class Article extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 文章删除
|
* 文章删除
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del(int $id)
|
public function del(int $id)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,7 +21,8 @@ class ArticleCategory extends BaseAdminController
|
|||||||
* 文章分类列表
|
* 文章分类列表
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['name', ''],
|
['name', ''],
|
||||||
]);
|
]);
|
||||||
@ -32,15 +33,18 @@ class ArticleCategory extends BaseAdminController
|
|||||||
* 查询所有分类(文章添加,编辑,索引)
|
* 查询所有分类(文章添加,编辑,索引)
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function all(){
|
public function all()
|
||||||
|
{
|
||||||
return success((new ArticleCategoryService())->getAll());
|
return success((new ArticleCategoryService())->getAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文章分类详情
|
* 文章分类详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id){
|
public function info(int $id)
|
||||||
|
{
|
||||||
return success((new ArticleCategoryService())->getInfo($id));
|
return success((new ArticleCategoryService())->getInfo($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +52,8 @@ class ArticleCategory extends BaseAdminController
|
|||||||
* 添加文章分类
|
* 添加文章分类
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function add(){
|
public function add()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['name', ''],
|
['name', ''],
|
||||||
['is_show', 1],
|
['is_show', 1],
|
||||||
@ -64,7 +69,8 @@ class ArticleCategory extends BaseAdminController
|
|||||||
* @param int $category_id //分类id
|
* @param int $category_id //分类id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function edit(int $category_id){
|
public function edit(int $category_id)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['name', ''],
|
['name', ''],
|
||||||
['is_show', 1],
|
['is_show', 1],
|
||||||
@ -78,8 +84,10 @@ class ArticleCategory extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 文章分类删除
|
* 文章分类删除
|
||||||
* @param int $category_id
|
* @param int $category_id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del(int $category_id){
|
public function del(int $category_id)
|
||||||
|
{
|
||||||
(new ArticleCategoryService())->del($category_id);
|
(new ArticleCategoryService())->del($category_id);
|
||||||
return success('DELETE_SUCCESS');
|
return success('DELETE_SUCCESS');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,10 @@ namespace app\adminapi\controller\auth;
|
|||||||
use app\service\admin\auth\AuthService;
|
use app\service\admin\auth\AuthService;
|
||||||
use app\service\admin\auth\AuthSiteService;
|
use app\service\admin\auth\AuthSiteService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\DbException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
|
|
||||||
class Auth extends BaseAdminController
|
class Auth extends BaseAdminController
|
||||||
@ -22,15 +26,17 @@ class Auth extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 登录用户菜单列表的接口
|
* 登录用户菜单列表的接口
|
||||||
*/
|
*/
|
||||||
public function authMenuList(){
|
public function authMenuList()
|
||||||
|
{
|
||||||
return success((new AuthService())->getAuthMenuList(1));
|
return success((new AuthService())->getAuthMenuList(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取登录用户信息
|
* 获取登录用户信息
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function get(){
|
public function get()
|
||||||
|
{
|
||||||
return success((new AuthService())->getAuthInfo());
|
return success((new AuthService())->getAuthInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,9 +44,10 @@ class Auth extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 修改登录用户信息
|
* 修改登录用户信息
|
||||||
* @param $field
|
* @param $field
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function modify($field){
|
public function modify($field)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['value', ''],
|
['value', ''],
|
||||||
['field', $field]
|
['field', $field]
|
||||||
@ -54,7 +61,8 @@ class Auth extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 更新用户
|
* 更新用户
|
||||||
*/
|
*/
|
||||||
public function edit(){
|
public function edit()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['real_name', ''],
|
['real_name', ''],
|
||||||
['head_img', ''],
|
['head_img', ''],
|
||||||
@ -67,20 +75,22 @@ class Auth extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录站点信息
|
* 获取当前登录站点信息
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function site(){
|
public function site()
|
||||||
|
{
|
||||||
return success((new AuthSiteService())->getSiteInfo());
|
return success((new AuthSiteService())->getSiteInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择可以选择的页面
|
* 选择可以选择的页面
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
* @throws DataNotFoundException
|
||||||
* @throws \think\db\exception\DbException
|
* @throws DbException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function getShowMenuList(){
|
public function getShowMenuList()
|
||||||
|
{
|
||||||
return success((new AuthSiteService())->getShowMenuList());
|
return success((new AuthSiteService())->getShowMenuList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,8 @@ class H5 extends BaseAdminController
|
|||||||
* 获取H5配置信息
|
* 获取H5配置信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function get(){
|
public function get()
|
||||||
|
{
|
||||||
return success((new H5Service())->getH5());
|
return success((new H5Service())->getH5());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +30,8 @@ class H5 extends BaseAdminController
|
|||||||
* 设置H5配置信息
|
* 设置H5配置信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function set(){
|
public function set()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['is_open', 0],
|
['is_open', 0],
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\diy;
|
|||||||
|
|
||||||
use app\service\admin\diy\DiyConfigService;
|
use app\service\admin\diy\DiyConfigService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,7 +25,7 @@ class Config extends BaseAdminController
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 获取底部导航
|
* 获取底部导航
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getBottom()
|
public function getBottom()
|
||||||
{
|
{
|
||||||
@ -33,7 +34,7 @@ class Config extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置底部导航
|
* 设置底部导航
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setBottom()
|
public function setBottom()
|
||||||
{
|
{
|
||||||
@ -41,7 +42,7 @@ class Config extends BaseAdminController
|
|||||||
['menu', []]
|
['menu', []]
|
||||||
]);
|
]);
|
||||||
(new DiyConfigService())->setBottomConfig($data['menu']);
|
(new DiyConfigService())->setBottomConfig($data['menu']);
|
||||||
return success('SUCCESS');
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,11 @@ namespace app\adminapi\controller\diy;
|
|||||||
|
|
||||||
use app\service\admin\diy\DiyService;
|
use app\service\admin\diy\DiyService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use Exception;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\DbException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,7 +29,7 @@ class Diy extends BaseAdminController
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @notes 获取自定义页面分页列表
|
* @notes 获取自定义页面分页列表
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists()
|
public function lists()
|
||||||
{
|
{
|
||||||
@ -38,7 +43,10 @@ class Diy extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 获取自定义页面列表
|
* @notes 获取自定义页面列表
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
|
* @throws DataNotFoundException
|
||||||
|
* @throws DbException
|
||||||
|
* @throws ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function getList()
|
public function getList()
|
||||||
{
|
{
|
||||||
@ -53,7 +61,7 @@ class Diy extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 自定义页面详情
|
* 自定义页面详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
@ -62,7 +70,7 @@ class Diy extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加自定义页面
|
* 添加自定义页面
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
@ -85,7 +93,7 @@ class Diy extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 自定义页面编辑
|
* 自定义页面编辑
|
||||||
* @param $id
|
* @param $id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
@ -102,8 +110,8 @@ class Diy extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义页面删除
|
* 自定义页面删除
|
||||||
* @param $id
|
* @param int $id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del(int $id)
|
public function del(int $id)
|
||||||
{
|
{
|
||||||
@ -114,8 +122,8 @@ class Diy extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 设为使用
|
* 设为使用
|
||||||
* @param $id
|
* @param $id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function setUse($id)
|
public function setUse($id)
|
||||||
{
|
{
|
||||||
@ -125,7 +133,7 @@ class Diy extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取页面初始化数据
|
* 获取页面初始化数据
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getPageInit()
|
public function getPageInit()
|
||||||
{
|
{
|
||||||
@ -152,7 +160,7 @@ class Diy extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取页面模板
|
* 获取页面模板
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getTemplate()
|
public function getTemplate()
|
||||||
{
|
{
|
||||||
@ -168,6 +176,7 @@ class Diy extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 修改页面分享内容
|
* 修改页面分享内容
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function modifyShare(int $id)
|
public function modifyShare(int $id)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\diy;
|
|||||||
|
|
||||||
use app\service\admin\diy\DiyRouteService;
|
use app\service\admin\diy\DiyRouteService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,7 +25,7 @@ class DiyRoute extends BaseAdminController
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @notes 获取自定义路由表列表
|
* @notes 获取自定义路由表列表
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists()
|
public function lists()
|
||||||
{
|
{
|
||||||
@ -37,7 +38,7 @@ class DiyRoute extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 自定义路由表详情
|
* 自定义路由表详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
@ -47,6 +48,7 @@ class DiyRoute extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 自定义路由表详情
|
* 自定义路由表详情
|
||||||
* @param string $name
|
* @param string $name
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getInfoByName(string $name)
|
public function getInfoByName(string $name)
|
||||||
{
|
{
|
||||||
@ -55,7 +57,7 @@ class DiyRoute extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加自定义路由表
|
* 添加自定义路由表
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
@ -74,7 +76,7 @@ class DiyRoute extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 自定义路由表编辑
|
* 自定义路由表编辑
|
||||||
* @param $id
|
* @param $id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
@ -92,8 +94,8 @@ class DiyRoute extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义路由表删除
|
* 自定义路由表删除
|
||||||
* @param $id
|
* @param int $id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del(int $id)
|
public function del(int $id)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,6 +13,10 @@ namespace app\adminapi\controller\generator;
|
|||||||
|
|
||||||
use app\service\admin\generator\GenerateService;
|
use app\service\admin\generator\GenerateService;
|
||||||
use core\base\BaseController;
|
use core\base\BaseController;
|
||||||
|
use Exception;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\DbException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,6 +44,9 @@ class Generator extends BaseController
|
|||||||
* 代码生成详情
|
* 代码生成详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Response
|
* @return Response
|
||||||
|
* @throws DataNotFoundException
|
||||||
|
* @throws DbException
|
||||||
|
* @throws ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
@ -49,6 +56,7 @@ class Generator extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 添加代码生成
|
* 添加代码生成
|
||||||
* @return Response
|
* @return Response
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -23,7 +23,8 @@ class Captcha extends BaseAdminController
|
|||||||
* 创建验证码
|
* 创建验证码
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function create(){
|
public function create()
|
||||||
|
{
|
||||||
return success((new CaptchaService())->create());
|
return success((new CaptchaService())->create());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,7 +32,8 @@ class Captcha extends BaseAdminController
|
|||||||
* 一次校验验证码
|
* 一次校验验证码
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function check(){
|
public function check()
|
||||||
|
{
|
||||||
return success((new CaptchaService())->check());
|
return success((new CaptchaService())->check());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +41,8 @@ class Captcha extends BaseAdminController
|
|||||||
* 二次校验验证码
|
* 二次校验验证码
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function verification(){
|
public function verification()
|
||||||
|
{
|
||||||
return success((new CaptchaService())->verification());
|
return success((new CaptchaService())->verification());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@
|
|||||||
namespace app\adminapi\controller\login;
|
namespace app\adminapi\controller\login;
|
||||||
|
|
||||||
use app\service\admin\auth\ConfigService;
|
use app\service\admin\auth\ConfigService;
|
||||||
use app\service\core\upload\CoreImageService;
|
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,6 @@ class Login extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取登录设置
|
* 获取登录设置
|
||||||
* @return Response
|
* @return Response
|
||||||
|
|||||||
@ -46,8 +46,7 @@ class Account extends BaseAdminController
|
|||||||
$member_account_service = new MemberAccountService();
|
$member_account_service = new MemberAccountService();
|
||||||
$member_service = new MemberService();
|
$member_service = new MemberService();
|
||||||
|
|
||||||
if(empty($data['member_id']))
|
if (empty($data['member_id'])) {
|
||||||
{
|
|
||||||
$commission_data = [
|
$commission_data = [
|
||||||
'point_get' => $member_service->getSum('point_get'),//累计
|
'point_get' => $member_service->getSum('point_get'),//累计
|
||||||
'point_use' => abs($member_account_service->getExpensesSumAccount(MemberAccountTypeDict::POINT)),
|
'point_use' => abs($member_account_service->getExpensesSumAccount(MemberAccountTypeDict::POINT)),
|
||||||
@ -165,8 +164,7 @@ class Account extends BaseAdminController
|
|||||||
$member_account_service = new MemberAccountService();
|
$member_account_service = new MemberAccountService();
|
||||||
$member_service = new MemberService();
|
$member_service = new MemberService();
|
||||||
|
|
||||||
if(empty($data['member_id']))
|
if (empty($data['member_id'])) {
|
||||||
{
|
|
||||||
$commission_data = [
|
$commission_data = [
|
||||||
'total_commission' => $member_service->getSum('commission_get'),//累计
|
'total_commission' => $member_service->getSum('commission_get'),//累计
|
||||||
'commission' => $member_service->getSum('commission'),//未提现
|
'commission' => $member_service->getSum('commission'),//未提现
|
||||||
@ -195,8 +193,7 @@ class Account extends BaseAdminController
|
|||||||
['member_id', ''],
|
['member_id', ''],
|
||||||
]);
|
]);
|
||||||
$member_account_service = new MemberAccountService();
|
$member_account_service = new MemberAccountService();
|
||||||
if(empty($data['member_id']))
|
if (empty($data['member_id'])) {
|
||||||
{
|
|
||||||
|
|
||||||
$balance_data = [
|
$balance_data = [
|
||||||
MemberAccountTypeDict::BALANCE => number_format($member_account_service->getSumAccount(MemberAccountTypeDict::BALANCE), 2),
|
MemberAccountTypeDict::BALANCE => number_format($member_account_service->getSumAccount(MemberAccountTypeDict::BALANCE), 2),
|
||||||
@ -210,7 +207,8 @@ class Account extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 账户变化类型
|
* 账户变化类型
|
||||||
* @param $account_type
|
* @param string $account_type
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function changeType(string $account_type)
|
public function changeType(string $account_type)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class CashOut extends BaseAdminController
|
|||||||
['refuse_reason', ''],
|
['refuse_reason', ''],
|
||||||
]);
|
]);
|
||||||
(new MemberCashOutService())->audit($id, $action, $data);
|
(new MemberCashOutService())->audit($id, $action, $data);
|
||||||
return success('SUCCESS');
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,14 +79,15 @@ class CashOut extends BaseAdminController
|
|||||||
['transfer_type', '']
|
['transfer_type', '']
|
||||||
]);
|
]);
|
||||||
(new MemberCashOutService())->transfer($id, $data);
|
(new MemberCashOutService())->transfer($id, $data);
|
||||||
return success('SUCCESS');
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态
|
* 状态
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getStatusList(){
|
public function getStatusList()
|
||||||
|
{
|
||||||
return success(MemberCashOutDict::getStatus());
|
return success(MemberCashOutDict::getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,8 @@ class Config extends BaseAdminController
|
|||||||
* 获取会员配置
|
* 获取会员配置
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getMemberConfig(){
|
public function getMemberConfig()
|
||||||
|
{
|
||||||
return success((new MemberConfigService())->getMemberConfig());
|
return success((new MemberConfigService())->getMemberConfig());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +85,8 @@ class Config extends BaseAdminController
|
|||||||
* 设置会员配置
|
* 设置会员配置
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setMemberConfig(){
|
public function setMemberConfig()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['prefix', ''],
|
['prefix', ''],
|
||||||
['length', 10]
|
['length', 10]
|
||||||
|
|||||||
@ -16,6 +16,9 @@ use app\dict\member\MemberRegisterChannelDict;
|
|||||||
use app\dict\member\MemberRegisterTypeDict;
|
use app\dict\member\MemberRegisterTypeDict;
|
||||||
use app\service\admin\member\MemberService;
|
use app\service\admin\member\MemberService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\DbException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
class Member extends BaseAdminController
|
class Member extends BaseAdminController
|
||||||
@ -38,7 +41,7 @@ class Member extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员详情
|
* 会员详情
|
||||||
* @param int $member_id
|
* @param int $id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
@ -113,7 +116,7 @@ class Member extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员使用场景
|
* 会员使用场景
|
||||||
* @return array|mixed|string
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getMemberRegisterType()
|
public function getMemberRegisterType()
|
||||||
{
|
{
|
||||||
@ -123,6 +126,9 @@ class Member extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 会员列表
|
* 会员列表
|
||||||
* @return Response
|
* @return Response
|
||||||
|
* @throws DataNotFoundException
|
||||||
|
* @throws DbException
|
||||||
|
* @throws ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function getMemberList()
|
public function getMemberList()
|
||||||
{
|
{
|
||||||
@ -144,9 +150,10 @@ class Member extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 设置会员的状态
|
* 设置会员的状态
|
||||||
* @param $status
|
* @param $status
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setStatus($status){
|
public function setStatus($status)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['member_ids', []],
|
['member_ids', []],
|
||||||
|
|
||||||
@ -160,7 +167,8 @@ class Member extends BaseAdminController
|
|||||||
* 获取状态枚举
|
* 获取状态枚举
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getStatusList(){
|
public function getStatusList()
|
||||||
|
{
|
||||||
return success(MemberDict::getStatus());
|
return success(MemberDict::getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +176,8 @@ class Member extends BaseAdminController
|
|||||||
* 获取会员编码
|
* 获取会员编码
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getMemberNo(){
|
public function getMemberNo()
|
||||||
|
{
|
||||||
$member_no = (new MemberService())->getMemberNo();
|
$member_no = (new MemberService())->getMemberNo();
|
||||||
return success('SUCCESS', $member_no);
|
return success('SUCCESS', $member_no);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,9 @@ namespace app\adminapi\controller\member;
|
|||||||
|
|
||||||
use app\service\admin\member\MemberLabelService;
|
use app\service\admin\member\MemberLabelService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\DbException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
class MemberLabel extends BaseAdminController
|
class MemberLabel extends BaseAdminController
|
||||||
@ -21,7 +24,8 @@ class MemberLabel extends BaseAdminController
|
|||||||
* 会员标签列表
|
* 会员标签列表
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
|
|
||||||
['label_name', ''],
|
['label_name', ''],
|
||||||
@ -32,8 +36,10 @@ class MemberLabel extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 会员标签详情
|
* 会员标签详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id){
|
public function info(int $id)
|
||||||
|
{
|
||||||
return success((new MemberLabelService())->getInfo($id));
|
return success((new MemberLabelService())->getInfo($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +47,8 @@ class MemberLabel extends BaseAdminController
|
|||||||
* 添加会员标签
|
* 添加会员标签
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function add(){
|
public function add()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
|
|
||||||
['label_name', ''],
|
['label_name', ''],
|
||||||
@ -56,7 +63,8 @@ class MemberLabel extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 菜单或接口更新
|
* 菜单或接口更新
|
||||||
*/
|
*/
|
||||||
public function edit($id){
|
public function edit($id)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['label_name', ''],
|
['label_name', ''],
|
||||||
['memo', ''],
|
['memo', ''],
|
||||||
@ -70,8 +78,10 @@ class MemberLabel extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 会员标签删除
|
* 会员标签删除
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del(int $id){
|
public function del(int $id)
|
||||||
|
{
|
||||||
|
|
||||||
(new MemberLabelService())->del($id);
|
(new MemberLabelService())->del($id);
|
||||||
return success('DELETE_SUCCESS');
|
return success('DELETE_SUCCESS');
|
||||||
@ -79,9 +89,13 @@ class MemberLabel extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取标签
|
* 获取标签
|
||||||
* @return void
|
* @return Response
|
||||||
|
* @throws DataNotFoundException
|
||||||
|
* @throws DbException
|
||||||
|
* @throws ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function getAll(){
|
public function getAll()
|
||||||
|
{
|
||||||
return success((new MemberLabelService())->getAll());
|
return success((new MemberLabelService())->getAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
46
niucloud/app/adminapi/controller/niucloud/Module.php
Normal file
46
niucloud/app/adminapi/controller/niucloud/Module.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网址:https://www.niucloud-admin.com
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | niucloud团队 版权所有 开源版本可自由商用
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: Niucloud Team
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace app\adminapi\controller\niucloud;
|
||||||
|
|
||||||
|
use app\service\admin\niucloud\NiucloudService;
|
||||||
|
use app\service\core\niucloud\CoreAuthService;
|
||||||
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
|
class Module extends BaseAdminController
|
||||||
|
{
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
return success((new CoreAuthService())->getAuthInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置 授权信息
|
||||||
|
*/
|
||||||
|
public function setAuthorize()
|
||||||
|
{
|
||||||
|
$data = $this->request->params([
|
||||||
|
['auth_code', ''],
|
||||||
|
['auth_secret', '']
|
||||||
|
]);
|
||||||
|
|
||||||
|
return success("SUCCESS", (new NiucloudService())->setAuthorize($data));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 授权信息
|
||||||
|
*/
|
||||||
|
public function getAuthorize()
|
||||||
|
{
|
||||||
|
return success((new NiucloudService())->getAuthorize());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -36,6 +36,7 @@ class Notice extends BaseAdminController
|
|||||||
$res = (new NoticeService())->getInfo($key);
|
$res = (new NoticeService())->getInfo($key);
|
||||||
return success($res);
|
return success($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息启动与关闭
|
* 消息启动与关闭
|
||||||
* @return Response
|
* @return Response
|
||||||
@ -84,8 +85,7 @@ class Notice extends BaseAdminController
|
|||||||
$data = [
|
$data = [
|
||||||
['is_use', 0]
|
['is_use', 0]
|
||||||
];
|
];
|
||||||
foreach ($sms_type_list[$sms_type]['params'] as $k_param => $v_param)
|
foreach ($sms_type_list[$sms_type]['params'] as $k_param => $v_param) {
|
||||||
{
|
|
||||||
$data[] = [$k_param, ''];
|
$data[] = [$k_param, ''];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace app\adminapi\controller\notice;
|
namespace app\adminapi\controller\notice;
|
||||||
|
|
||||||
use app\service\admin\notice\NoticeLogService;
|
|
||||||
use app\service\admin\notice\NoticeSmsLogService;
|
use app\service\admin\notice\NoticeSmsLogService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|||||||
@ -59,19 +59,6 @@ class Recharge extends BaseAdminController
|
|||||||
return fail($res);
|
return fail($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 充值统计
|
|
||||||
*/
|
|
||||||
public function stat()
|
|
||||||
{
|
|
||||||
$data = $this->request->params([
|
|
||||||
[ 'member_id', '' ],
|
|
||||||
]);
|
|
||||||
$res = (new RechargeOrderService())->stat($data);
|
|
||||||
return success($res);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款列表
|
* 退款列表
|
||||||
* @return Response
|
* @return Response
|
||||||
@ -91,7 +78,7 @@ class Recharge extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款详情
|
* 退款详情
|
||||||
* @param int $order_id
|
* @param int $refund_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function refundDetail(int $refund_id)
|
public function refundDetail(int $refund_id)
|
||||||
@ -101,7 +88,6 @@ class Recharge extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询退款状态
|
* 查询退款状态
|
||||||
* @param $type
|
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function refundStatus()
|
public function refundStatus()
|
||||||
@ -117,5 +103,17 @@ class Recharge extends BaseAdminController
|
|||||||
return success((new RechargeOrderRefundService())->stat());
|
return success((new RechargeOrderRefundService())->stat());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值统计
|
||||||
|
*/
|
||||||
|
public function stat()
|
||||||
|
{
|
||||||
|
$data = $this->request->params([
|
||||||
|
['member_id', ''],
|
||||||
|
]);
|
||||||
|
$res = (new RechargeOrderService())->stat($data);
|
||||||
|
return success($res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
61
niucloud/app/adminapi/controller/pay/Pay.php
Normal file
61
niucloud/app/adminapi/controller/pay/Pay.php
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网址:https://www.niucloud-admin.com
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | niucloud团队 版权所有 开源版本可自由商用
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: Niucloud Team
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace app\adminapi\controller\pay;
|
||||||
|
|
||||||
|
use app\dict\pay\PayDict;
|
||||||
|
use app\service\admin\pay\PayService;
|
||||||
|
use core\base\BaseAdminController;
|
||||||
|
|
||||||
|
class Pay extends BaseAdminController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 待审核支付记录
|
||||||
|
* @param array $where
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function audit(){
|
||||||
|
$data = $this->request->params([
|
||||||
|
['create_time', []],
|
||||||
|
['out_trade_no', ''],
|
||||||
|
['status', '']
|
||||||
|
]);
|
||||||
|
return success(data: (new PayService())->getAuditPage($data));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询详情
|
||||||
|
* @param string $out_trade_no
|
||||||
|
* @return \think\Response
|
||||||
|
*/
|
||||||
|
public function detail(int $id){
|
||||||
|
return success(data: (new PayService())->getDetail($id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付审核通过
|
||||||
|
* @param string $out_trade_no
|
||||||
|
* @return \think\Response
|
||||||
|
*/
|
||||||
|
public function pass(string $out_trade_no){
|
||||||
|
return success(data: (new PayService())->pass($out_trade_no));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核拒绝
|
||||||
|
* @param string $out_trade_no
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function refuse(string $out_trade_no){
|
||||||
|
$reason = input('reason', '');
|
||||||
|
return success(data: (new PayService())->refuse($out_trade_no, $reason));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,6 +14,9 @@ namespace app\adminapi\controller\pay;
|
|||||||
use app\dict\pay\PayDict;
|
use app\dict\pay\PayDict;
|
||||||
use app\service\admin\pay\PayChannelService;
|
use app\service\admin\pay\PayChannelService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\DbException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
class PayChannel extends BaseAdminController
|
class PayChannel extends BaseAdminController
|
||||||
@ -23,7 +26,8 @@ class PayChannel extends BaseAdminController
|
|||||||
* 支付渠道设置
|
* 支付渠道设置
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function set($channel, $type){
|
public function set($channel, $type)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['is_default', 0],
|
['is_default', 0],
|
||||||
['config', []],
|
['config', []],
|
||||||
@ -40,7 +44,8 @@ class PayChannel extends BaseAdminController
|
|||||||
* 支付渠道列表
|
* 支付渠道列表
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
return success((new PayChannelService())->getChannelList());
|
return success((new PayChannelService())->getChannelList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,11 +53,12 @@ class PayChannel extends BaseAdminController
|
|||||||
* 通过渠道获取支付配置
|
* 通过渠道获取支付配置
|
||||||
* @param $channel
|
* @param $channel
|
||||||
* @return Response
|
* @return Response
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
* @throws DataNotFoundException
|
||||||
* @throws \think\db\exception\DbException
|
* @throws DbException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function getListByChannel($channel){
|
public function getListByChannel($channel)
|
||||||
|
{
|
||||||
return success((new PayChannelService())->getListByChannel($channel));
|
return success((new PayChannelService())->getListByChannel($channel));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +67,8 @@ class PayChannel extends BaseAdminController
|
|||||||
* 支付设置
|
* 支付设置
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setTransfer(){
|
public function setTransfer()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['wechatpay_config', []],
|
['wechatpay_config', []],
|
||||||
['alipay_config', []],
|
['alipay_config', []],
|
||||||
@ -76,7 +83,8 @@ class PayChannel extends BaseAdminController
|
|||||||
* 多渠道支付设置
|
* 多渠道支付设置
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setAll(){
|
public function setAll()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['config', []],
|
['config', []],
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -38,6 +38,7 @@ class Site extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 站点详情
|
* 站点详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
@ -65,6 +66,36 @@ class Site extends BaseAdminController
|
|||||||
return success('ADD_SUCCESS', ['site_id' => $site_id]);
|
return success('ADD_SUCCESS', ['site_id' => $site_id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点状态
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function getStatuList()
|
||||||
|
{
|
||||||
|
return success(SiteDict::getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点菜单
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function menu()
|
||||||
|
{
|
||||||
|
return success((new AuthSiteService())->getMenuList(1, 'all'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭站点
|
||||||
|
*/
|
||||||
|
public function closeSite($id)
|
||||||
|
{
|
||||||
|
$data = $this->request->params([
|
||||||
|
['status', SiteDict::CLOSE],
|
||||||
|
]);
|
||||||
|
(new SiteService())->edit($id, $data);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单或接口更新
|
* 菜单或接口更新
|
||||||
*/
|
*/
|
||||||
@ -80,35 +111,6 @@ class Site extends BaseAdminController
|
|||||||
return success('MODIFY_SUCCESS');
|
return success('MODIFY_SUCCESS');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点状态
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function getStatuList()
|
|
||||||
{
|
|
||||||
return success(SiteDict::getStatus());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点菜单
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function menu(){
|
|
||||||
return success((new AuthSiteService())->getMenuList(1, 'all'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭站点
|
|
||||||
*/
|
|
||||||
public function closeSite($id)
|
|
||||||
{
|
|
||||||
$data = $this->request->params([
|
|
||||||
['status', SiteDict::CLOSE],
|
|
||||||
]);
|
|
||||||
(new SiteService())->edit($id, $data);
|
|
||||||
return success('SUCCESS');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启站点
|
* 开启站点
|
||||||
*/
|
*/
|
||||||
@ -118,8 +120,9 @@ class Site extends BaseAdminController
|
|||||||
['status', SiteDict::ON],
|
['status', SiteDict::ON],
|
||||||
]);
|
]);
|
||||||
(new SiteService())->edit($id, $data);
|
(new SiteService())->edit($id, $data);
|
||||||
return success('SUCCESS');
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function indexConfig()
|
public function indexConfig()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -12,10 +12,7 @@
|
|||||||
namespace app\adminapi\controller\site;
|
namespace app\adminapi\controller\site;
|
||||||
|
|
||||||
use app\dict\site\SiteAccountLogDict;
|
use app\dict\site\SiteAccountLogDict;
|
||||||
use app\dict\site\SiteDict;
|
|
||||||
use app\service\admin\auth\AuthSiteService;
|
|
||||||
use app\service\admin\site\SiteAccountLogService;
|
use app\service\admin\site\SiteAccountLogService;
|
||||||
use app\service\admin\site\SiteService;
|
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
@ -37,11 +34,13 @@ class SiteAccount extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 账单详情
|
* 账单详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
return success((new SiteAccountLogService())->getInfo($id));
|
return success((new SiteAccountLogService())->getInfo($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计账单
|
* 累计账单
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\site;
|
|||||||
|
|
||||||
use app\service\admin\site\SiteGroupService;
|
use app\service\admin\site\SiteGroupService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use Exception;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,7 +27,8 @@ class SiteGroup extends BaseAdminController
|
|||||||
* 站点列表
|
* 站点列表
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['keywords', ''],
|
['keywords', ''],
|
||||||
]);
|
]);
|
||||||
@ -38,16 +40,18 @@ class SiteGroup extends BaseAdminController
|
|||||||
* @param int $group_id
|
* @param int $group_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $group_id){
|
public function info(int $group_id)
|
||||||
|
{
|
||||||
return success((new SiteGroupService())->getInfo($group_id));
|
return success((new SiteGroupService())->getInfo($group_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加分组
|
* 添加分组
|
||||||
* @return Response
|
* @return Response
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function add(){
|
public function add()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['group_name', ''],
|
['group_name', ''],
|
||||||
['group_desc', ''],
|
['group_desc', ''],
|
||||||
@ -63,7 +67,8 @@ class SiteGroup extends BaseAdminController
|
|||||||
* @param $group_id
|
* @param $group_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function edit($group_id){
|
public function edit($group_id)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['group_name', ''],
|
['group_name', ''],
|
||||||
['group_desc', ''],
|
['group_desc', ''],
|
||||||
@ -79,7 +84,8 @@ class SiteGroup extends BaseAdminController
|
|||||||
* @param $group_id
|
* @param $group_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del($group_id){
|
public function del($group_id)
|
||||||
|
{
|
||||||
|
|
||||||
(new SiteGroupService())->del($group_id);
|
(new SiteGroupService())->del($group_id);
|
||||||
return success('DELETE_SUCCESS');
|
return success('DELETE_SUCCESS');
|
||||||
@ -89,7 +95,8 @@ class SiteGroup extends BaseAdminController
|
|||||||
* 所有分组
|
* 所有分组
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function all(){
|
public function all()
|
||||||
|
{
|
||||||
return success((new SiteGroupService())->getAll());
|
return success((new SiteGroupService())->getAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ use app\dict\sys\UserDict;
|
|||||||
use app\service\admin\site\SiteUserService;
|
use app\service\admin\site\SiteUserService;
|
||||||
use app\service\admin\user\UserService;
|
use app\service\admin\user\UserService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use Exception;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,7 +25,8 @@ use think\Response;
|
|||||||
*/
|
*/
|
||||||
class User extends BaseAdminController
|
class User extends BaseAdminController
|
||||||
{
|
{
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['username', ''],
|
['username', ''],
|
||||||
['realname', ''],
|
['realname', ''],
|
||||||
@ -41,15 +43,18 @@ class User extends BaseAdminController
|
|||||||
* @param $uid
|
* @param $uid
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info($uid){
|
public function info($uid)
|
||||||
|
{
|
||||||
return success((new SiteUserService())->getInfo($uid));
|
return success((new SiteUserService())->getInfo($uid));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户
|
* 新增用户
|
||||||
* @return Response
|
* @return Response
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function add(){
|
public function add()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['username', ''],
|
['username', ''],
|
||||||
['password', ''],
|
['password', ''],
|
||||||
@ -67,7 +72,8 @@ class User extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 更新用户
|
* 更新用户
|
||||||
*/
|
*/
|
||||||
public function edit($uid){
|
public function edit($uid)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['real_name', ''],
|
['real_name', ''],
|
||||||
['head_img', ''],
|
['head_img', ''],
|
||||||
@ -85,7 +91,8 @@ class User extends BaseAdminController
|
|||||||
* @param $field
|
* @param $field
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function modify($uid, $field){
|
public function modify($uid, $field)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['value', ''],
|
['value', ''],
|
||||||
['field', $field]
|
['field', $field]
|
||||||
@ -99,8 +106,10 @@ class User extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 删除单个用户
|
* 删除单个用户
|
||||||
* @param $uid
|
* @param $uid
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del($uid){
|
public function del($uid)
|
||||||
|
{
|
||||||
(new UserService())->del($uid);
|
(new UserService())->del($uid);
|
||||||
return success('DELETE_SUCCESS');
|
return success('DELETE_SUCCESS');
|
||||||
}
|
}
|
||||||
@ -108,7 +117,8 @@ class User extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 锁定用户
|
* 锁定用户
|
||||||
*/
|
*/
|
||||||
public function lock($uid){
|
public function lock($uid)
|
||||||
|
{
|
||||||
|
|
||||||
(new SiteUserService())->lock($uid);
|
(new SiteUserService())->lock($uid);
|
||||||
return success('MODIFY_SUCCESS');
|
return success('MODIFY_SUCCESS');
|
||||||
@ -117,7 +127,8 @@ class User extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 解锁用户
|
* 解锁用户
|
||||||
*/
|
*/
|
||||||
public function unlock($uid){
|
public function unlock($uid)
|
||||||
|
{
|
||||||
|
|
||||||
(new SiteUserService())->unlock($uid);
|
(new SiteUserService())->unlock($uid);
|
||||||
return success('MODIFY_SUCCESS');
|
return success('MODIFY_SUCCESS');
|
||||||
|
|||||||
@ -21,7 +21,8 @@ class UserLog extends BaseAdminController
|
|||||||
* 操作日志列表
|
* 操作日志列表
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['uid', 0],
|
['uid', 0],
|
||||||
['create_time', []],
|
['create_time', []],
|
||||||
@ -41,7 +42,8 @@ class UserLog extends BaseAdminController
|
|||||||
* @param $id
|
* @param $id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info($id){
|
public function info($id)
|
||||||
|
{
|
||||||
return success((new UserLogService())->getInfo($id));
|
return success((new UserLogService())->getInfo($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\stat;
|
|||||||
|
|
||||||
use app\service\admin\stat\SiteStatService;
|
use app\service\admin\stat\SiteStatService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计数据
|
* 统计数据
|
||||||
@ -23,7 +24,7 @@ class SiteStat extends BaseAdminController
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 首页数据
|
* 首页数据
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\stat;
|
|||||||
|
|
||||||
use app\service\admin\stat\StatService;
|
use app\service\admin\stat\StatService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计数据
|
* 统计数据
|
||||||
@ -23,7 +24,7 @@ class Stat extends BaseAdminController
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 首页数据
|
* 首页数据
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -48,7 +48,8 @@ class Agreement extends BaseAdminController
|
|||||||
* @param string $key
|
* @param string $key
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function edit(string $key){
|
public function edit(string $key)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['title', ''],
|
['title', ''],
|
||||||
['content', ''],
|
['content', ''],
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\sys;
|
|||||||
|
|
||||||
use app\service\admin\sys\AppService;
|
use app\service\admin\sys\AppService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用管理
|
* 应用管理
|
||||||
@ -21,9 +22,10 @@ class App extends BaseAdminController
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 获取应用链接列表
|
* 获取应用链接列表
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getAppList(){
|
public function getAppList()
|
||||||
|
{
|
||||||
return success((new AppService())->getAppList());
|
return success((new AppService())->getAppList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,22 +13,24 @@ namespace app\adminapi\controller\sys;
|
|||||||
|
|
||||||
use app\service\admin\sys\AreaService;
|
use app\service\admin\sys\AreaService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
class Area extends BaseAdminController
|
class Area extends BaseAdminController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 拖过pid获取子项列表
|
* 拖过pid获取子项列表
|
||||||
* @param int $pid
|
* @param int $pid
|
||||||
* @return mixed
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function listByPid(int $pid){
|
public function listByPid(int $pid)
|
||||||
|
{
|
||||||
return success((new AreaService())->getListByPid($pid));
|
return success((new AreaService())->getListByPid($pid));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取层级列表
|
* 获取层级列表
|
||||||
* @param int $level
|
* @param int $level
|
||||||
* @return mixed
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function tree(int $level)
|
public function tree(int $level)
|
||||||
{
|
{
|
||||||
@ -36,10 +38,10 @@ class Area extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $address
|
* @return Response
|
||||||
* 地址解析
|
|
||||||
*/
|
*/
|
||||||
public function addressInfo(){
|
public function addressInfo()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['address', ''],
|
['address', ''],
|
||||||
]);
|
]);
|
||||||
@ -47,10 +49,10 @@ class Area extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $location
|
* @return Response
|
||||||
* 逆地址解析
|
|
||||||
*/
|
*/
|
||||||
public function contraryAddress(){
|
public function contraryAddress()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['location', ''],
|
['location', ''],
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -111,7 +111,7 @@ class Attachment extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 移动图片分组
|
* 移动图片分组
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function moveCategory($att_id)
|
public function moveCategory($att_id)
|
||||||
{
|
{
|
||||||
@ -119,12 +119,11 @@ class Attachment extends BaseAdminController
|
|||||||
['cate_id', '']
|
['cate_id', '']
|
||||||
]);
|
]);
|
||||||
(new AttachmentService())->modifyCategory($att_id, $data['cate_id']);
|
(new AttachmentService())->modifyCategory($att_id, $data['cate_id']);
|
||||||
return success('SUCCESS');
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量移动图片分组
|
* 批量移动图片分组
|
||||||
* @param $att_ids
|
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function batchMoveCategory()
|
public function batchMoveCategory()
|
||||||
@ -134,7 +133,7 @@ class Attachment extends BaseAdminController
|
|||||||
['att_ids', []]
|
['att_ids', []]
|
||||||
]);
|
]);
|
||||||
(new AttachmentService())->batchModifyCategory($data['att_ids'], $data['cate_id']);
|
(new AttachmentService())->batchModifyCategory($data['att_ids'], $data['cate_id']);
|
||||||
return success('SUCCESS');
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -13,14 +13,14 @@ namespace app\adminapi\controller\sys;
|
|||||||
|
|
||||||
use app\dict\common\ChannelDict;
|
use app\dict\common\ChannelDict;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
class Channel extends BaseAdminController
|
class Channel extends BaseAdminController
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取渠道列表
|
* 获取渠道列表
|
||||||
* @param int $level
|
* @return Response
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function getChannelType()
|
public function getChannelType()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\sys;
|
|||||||
|
|
||||||
use app\dict\sys\DateDict;
|
use app\dict\sys\DateDict;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公共数据字典
|
* 公共数据字典
|
||||||
@ -21,17 +22,19 @@ class Common extends BaseAdminController
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 月份
|
* 月份
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getMonth(){
|
public function getMonth()
|
||||||
|
{
|
||||||
return success((new DateDict())->getMonth());
|
return success((new DateDict())->getMonth());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 星期
|
* 星期
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getWeek(){
|
public function getWeek()
|
||||||
|
{
|
||||||
return success((new DateDict())->getWeek());
|
return success((new DateDict())->getWeek());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,8 @@ class Config extends BaseAdminController
|
|||||||
* 获取网站设置
|
* 获取网站设置
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getWebsite(){
|
public function getWebsite()
|
||||||
|
{
|
||||||
return success((new ConfigService())->getWebSite());
|
return success((new ConfigService())->getWebSite());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +30,8 @@ class Config extends BaseAdminController
|
|||||||
* 网站设置
|
* 网站设置
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setWebsite(){
|
public function setWebsite()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
["site_name", ""],
|
["site_name", ""],
|
||||||
["logo", ""],
|
["logo", ""],
|
||||||
@ -67,14 +69,16 @@ class Config extends BaseAdminController
|
|||||||
* 获取版权信息
|
* 获取版权信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getCopyright(){
|
public function getCopyright()
|
||||||
|
{
|
||||||
return success((new ConfigService())->getCopyright());
|
return success((new ConfigService())->getCopyright());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**设置版权信息
|
/**设置版权信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setCopyright(){
|
public function setCopyright()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['icp', ''],
|
['icp', ''],
|
||||||
['gov_record', ''],
|
['gov_record', ''],
|
||||||
@ -93,7 +97,8 @@ class Config extends BaseAdminController
|
|||||||
* 场景域名
|
* 场景域名
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getSceneDomain(){
|
public function getSceneDomain()
|
||||||
|
{
|
||||||
return success((new ConfigService())->getSceneDomain());
|
return success((new ConfigService())->getSceneDomain());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,14 +106,16 @@ class Config extends BaseAdminController
|
|||||||
* 获取服务信息
|
* 获取服务信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getServiceInfo(){
|
public function getServiceInfo()
|
||||||
|
{
|
||||||
return success((new ConfigService())->getService());
|
return success((new ConfigService())->getService());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**设置版权信息
|
/**设置版权信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setMap(){
|
public function setMap()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['key', ''],
|
['key', ''],
|
||||||
]);
|
]);
|
||||||
@ -120,7 +127,8 @@ class Config extends BaseAdminController
|
|||||||
* 获取地图设置
|
* 获取地图设置
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getMap(){
|
public function getMap()
|
||||||
|
{
|
||||||
return success((new ConfigService())->getMap());
|
return success((new ConfigService())->getMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,6 +152,26 @@ class Config extends BaseAdminController
|
|||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取站点首页列表(如果正在使用is_use = 1)
|
||||||
|
*/
|
||||||
|
public function getAdminIndexList()
|
||||||
|
{
|
||||||
|
return success((new ConfigService())->getAdminIndexList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页配置
|
||||||
|
*/
|
||||||
|
public function setAdminIndex()
|
||||||
|
{
|
||||||
|
$data = $this->request->params([
|
||||||
|
['view_path', ''],
|
||||||
|
]);
|
||||||
|
(new ConfigService())->setAdminIndexConfig($data);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置快捷菜单
|
* 设置快捷菜单
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -17,7 +17,6 @@ use app\dict\sys\MethodDict;
|
|||||||
use app\service\admin\install\InstallSystemService;
|
use app\service\admin\install\InstallSystemService;
|
||||||
use app\service\admin\sys\MenuService;
|
use app\service\admin\sys\MenuService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
use think\Exception;
|
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
class Menu extends BaseAdminController
|
class Menu extends BaseAdminController
|
||||||
@ -27,17 +26,19 @@ class Menu extends BaseAdminController
|
|||||||
* 菜单列表(todo 限制只有平台端可以访问)
|
* 菜单列表(todo 限制只有平台端可以访问)
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists($app_type){
|
public function lists($app_type)
|
||||||
|
{
|
||||||
|
|
||||||
return success((new MenuService())->getAllMenuList($app_type, 'all', 1));
|
return success((new MenuService())->getAllMenuList($app_type, 'all', 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单信息
|
* 菜单信息
|
||||||
* @param $id
|
* @param $menu_key
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info($menu_key){
|
public function info($menu_key)
|
||||||
|
{
|
||||||
return success((new MenuService())->get($menu_key));
|
return success((new MenuService())->get($menu_key));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +46,8 @@ class Menu extends BaseAdminController
|
|||||||
* 新增菜单接口
|
* 新增菜单接口
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function add(){
|
public function add()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['menu_name', ''],
|
['menu_name', ''],
|
||||||
['menu_type', 0],
|
['menu_type', 0],
|
||||||
@ -71,7 +73,8 @@ class Menu extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 菜单或接口更新
|
* 菜单或接口更新
|
||||||
*/
|
*/
|
||||||
public function edit($menu_key){
|
public function edit($menu_key)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['menu_name', ''],
|
['menu_name', ''],
|
||||||
['parent_key', ''],
|
['parent_key', ''],
|
||||||
@ -98,7 +101,8 @@ class Menu extends BaseAdminController
|
|||||||
* 获取菜单类型静态资源
|
* 获取菜单类型静态资源
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getMenuType(){
|
public function getMenuType()
|
||||||
|
{
|
||||||
return success(MenuTypeDict::getMenuType());
|
return success(MenuTypeDict::getMenuType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +110,8 @@ class Menu extends BaseAdminController
|
|||||||
* 获取请求方式
|
* 获取请求方式
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getMethodType(){
|
public function getMethodType()
|
||||||
|
{
|
||||||
return success(MethodDict::getMethodType());
|
return success(MethodDict::getMethodType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,14 +119,15 @@ class Menu extends BaseAdminController
|
|||||||
* 删除菜单
|
* 删除菜单
|
||||||
* @param $menu_key
|
* @param $menu_key
|
||||||
* @return Response
|
* @return Response
|
||||||
* @throws Exception
|
|
||||||
*/
|
*/
|
||||||
public function del($menu_key){
|
public function del($menu_key)
|
||||||
|
{
|
||||||
(new MenuService())->del($menu_key);
|
(new MenuService())->del($menu_key);
|
||||||
return success('DELETE_SUCCESS');
|
return success('DELETE_SUCCESS');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function refreshMenu(){
|
public function refreshMenu()
|
||||||
|
{
|
||||||
(new InstallSystemService())->install();
|
(new InstallSystemService())->install();
|
||||||
return success('REFRESH_SUCCESS');
|
return success('REFRESH_SUCCESS');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,11 +14,13 @@ namespace app\adminapi\controller\sys;
|
|||||||
use app\dict\sys\RoleStatusDict;
|
use app\dict\sys\RoleStatusDict;
|
||||||
use app\service\admin\sys\RoleService;
|
use app\service\admin\sys\RoleService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\db\exception\DbException;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
class Role extends BaseAdminController
|
class Role extends BaseAdminController
|
||||||
{
|
{
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['role_name', ''],
|
['role_name', ''],
|
||||||
]);
|
]);
|
||||||
@ -29,10 +31,11 @@ class Role extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户组详情
|
* 用户组详情
|
||||||
* @param $uid
|
* @param $role_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info($role_id){
|
public function info($role_id)
|
||||||
|
{
|
||||||
return success((new RoleService())->getInfo($role_id));
|
return success((new RoleService())->getInfo($role_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,14 +43,17 @@ class Role extends BaseAdminController
|
|||||||
* 获取全部权限
|
* 获取全部权限
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function all(){
|
public function all()
|
||||||
|
{
|
||||||
return success((new RoleService())->getAll());
|
return success((new RoleService())->getAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户组
|
* 新增用户组
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function add(){
|
public function add()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['role_name', ''],
|
['role_name', ''],
|
||||||
['rules', []],
|
['rules', []],
|
||||||
@ -62,7 +68,8 @@ class Role extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 更新用户组
|
* 更新用户组
|
||||||
*/
|
*/
|
||||||
public function edit($role_id){
|
public function edit($role_id)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['role_name', ''],
|
['role_name', ''],
|
||||||
['rules', []],
|
['rules', []],
|
||||||
@ -76,9 +83,12 @@ class Role extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个用户组
|
* 删除单个用户组
|
||||||
* @param $uid
|
* @param $role_id
|
||||||
|
* @return Response
|
||||||
|
* @throws DbException
|
||||||
*/
|
*/
|
||||||
public function del($role_id){
|
public function del($role_id)
|
||||||
|
{
|
||||||
(new RoleService())->del($role_id);
|
(new RoleService())->del($role_id);
|
||||||
return success('DELETE_SUCCESS');
|
return success('DELETE_SUCCESS');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ namespace app\adminapi\controller\sys;
|
|||||||
use app\dict\schedule\ScheduleDict;
|
use app\dict\schedule\ScheduleDict;
|
||||||
use app\service\admin\schedule\ScheduleService;
|
use app\service\admin\schedule\ScheduleService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动任务
|
* 自动任务
|
||||||
@ -22,9 +23,10 @@ class Schedule extends BaseAdminController
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 任务列表
|
* 任务列表
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['key', ''],
|
['key', ''],
|
||||||
['status', ''],
|
['status', ''],
|
||||||
@ -35,23 +37,26 @@ class Schedule extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划任务模板
|
* 计划任务模板
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function template(){
|
public function template()
|
||||||
|
{
|
||||||
return success(data: (new ScheduleService())->getTemplateList());
|
return success(data: (new ScheduleService())->getTemplateList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取任务模式
|
* 获取任务模式
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getType(){
|
public function getType()
|
||||||
|
{
|
||||||
return success(data: ScheduleDict::getType());
|
return success(data: ScheduleDict::getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情
|
* 详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id)
|
public function info(int $id)
|
||||||
{
|
{
|
||||||
@ -93,18 +98,21 @@ class Schedule extends BaseAdminController
|
|||||||
/**
|
/**
|
||||||
* 启用或关闭
|
* 启用或关闭
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function modifyStatus(int $id){
|
public function modifyStatus(int $id)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['status', ScheduleDict::OFF],
|
['status', ScheduleDict::OFF],
|
||||||
]);
|
]);
|
||||||
(new ScheduleService())->modifyStatus($id, $data['status']);
|
(new ScheduleService())->modifyStatus($id, $data['status']);
|
||||||
return success('EDIT_SUCCESS');
|
return success('EDIT_SUCCESS');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del(int $id)
|
public function del(int $id)
|
||||||
{
|
{
|
||||||
@ -114,9 +122,10 @@ class Schedule extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 时间间隔类型
|
* 时间间隔类型
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getDateType(){
|
public function getDateType()
|
||||||
|
{
|
||||||
return success(data: ScheduleDict::getDateType());
|
return success(data: ScheduleDict::getDateType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
namespace app\adminapi\controller\sys;
|
namespace app\adminapi\controller\sys;
|
||||||
|
|
||||||
use app\service\admin\schedule\ScheduleService;
|
|
||||||
use app\service\admin\sys\SystemService;
|
use app\service\admin\sys\SystemService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统信息查询
|
* 系统信息查询
|
||||||
@ -24,7 +24,7 @@ class System extends BaseAdminController
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 获取当前系统信息
|
* 获取当前系统信息
|
||||||
* @return array|mixed
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info()
|
public function info()
|
||||||
{
|
{
|
||||||
@ -33,7 +33,7 @@ class System extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前url配置
|
* 获取当前url配置
|
||||||
* @return array|mixed
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function url()
|
public function url()
|
||||||
{
|
{
|
||||||
@ -42,35 +42,59 @@ class System extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取系统环境配置
|
* 获取系统环境配置
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getSystemInfo(){
|
public function getSystemInfo()
|
||||||
|
{
|
||||||
return success((new SystemService())->getSystemInfo());
|
return success((new SystemService())->getSystemInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清理缓存,更新菜单
|
* 清理缓存,更新菜单
|
||||||
*/
|
*/
|
||||||
public function schemaCache(){
|
public function schemaCache()
|
||||||
|
{
|
||||||
|
|
||||||
return success((new SystemService())->schemaCache());
|
return success((new SystemService())->schemaCache());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验消息队列是否正常运行
|
* 校验消息队列是否正常运行
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function checkJob(){
|
public function checkJob()
|
||||||
|
{
|
||||||
return success(data: (new SystemService())->checkJob());
|
return success(data: (new SystemService())->checkJob());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验计划任务是否正常运行
|
* 校验计划任务是否正常运行
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function checkSchedule(){
|
public function checkSchedule()
|
||||||
|
{
|
||||||
return success(data: (new SystemService())->checkSchedule());
|
return success(data: (new SystemService())->checkSchedule());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取布局
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function layout() {
|
||||||
|
$layouts = event('SiteLayout');
|
||||||
|
if (count($layouts) > 1) {
|
||||||
|
array_multisort(array_column($layouts, 'sort'), SORT_ASC, $layouts);
|
||||||
|
}
|
||||||
|
return success($layouts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 设置布局
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function setLayout(){
|
||||||
|
$key = input('key', '');
|
||||||
|
return success(data: (new SystemService())->setLayout($key));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,10 +27,11 @@ class Upload extends BaseAdminController
|
|||||||
|
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['file', 'file'],
|
['file', 'file'],
|
||||||
['cate_id', '=', 0]
|
['cate_id', 0],
|
||||||
], true);
|
['is_attachment', 1]
|
||||||
|
]);
|
||||||
$upload_service = new UploadService();
|
$upload_service = new UploadService();
|
||||||
return success($upload_service->image($data['file'], $data['cate_id']));
|
return success($upload_service->image($data['file'], $data['cate_id'], boolval($data['is_attachment'])));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,8 +42,8 @@ class Upload extends BaseAdminController
|
|||||||
{
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['file', 'file'],
|
['file', 'file'],
|
||||||
['cate_id', '=', 0]
|
['cate_id', 0]
|
||||||
], true);
|
]);
|
||||||
$upload_service = new UploadService();
|
$upload_service = new UploadService();
|
||||||
return success($upload_service->video($data['file'], $data['cate_id']));
|
return success($upload_service->video($data['file'], $data['cate_id']));
|
||||||
}
|
}
|
||||||
@ -51,17 +52,18 @@ class Upload extends BaseAdminController
|
|||||||
* 文件上传(默认不上云)
|
* 文件上传(默认不上云)
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function document($type){
|
public function document($type)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['file', 'file'],
|
['file', 'file'],
|
||||||
], true);
|
]);
|
||||||
$upload_service = new UploadService();
|
$upload_service = new UploadService();
|
||||||
return success($upload_service->document($data['file'], $type));
|
return success($upload_service->document($data['file'], $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传配置
|
* 上传配置
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function setUploadConfig()
|
public function setUploadConfig()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,7 +17,8 @@ use think\Response;
|
|||||||
|
|
||||||
class User extends BaseAdminController
|
class User extends BaseAdminController
|
||||||
{
|
{
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['username', ''],
|
['username', ''],
|
||||||
['real_name', '']
|
['real_name', '']
|
||||||
@ -33,7 +34,8 @@ class User extends BaseAdminController
|
|||||||
* @param $uid
|
* @param $uid
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info($uid){
|
public function info($uid)
|
||||||
|
{
|
||||||
return success((new UserService())->getUserAdminInfo($uid));
|
return success((new UserService())->getUserAdminInfo($uid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,8 @@ class Config extends BaseAdminController
|
|||||||
* 获取微信小程序配置信息
|
* 获取微信小程序配置信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function get(){
|
public function get()
|
||||||
|
{
|
||||||
return success((new WeappConfigService())->getWeappConfig());
|
return success((new WeappConfigService())->getWeappConfig());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +30,8 @@ class Config extends BaseAdminController
|
|||||||
* 设置微信小程序配置信息
|
* 设置微信小程序配置信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function set(){
|
public function set()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['weapp_name', ''],
|
['weapp_name', ''],
|
||||||
['weapp_original', ''],
|
['weapp_original', ''],
|
||||||
|
|||||||
@ -11,18 +11,18 @@
|
|||||||
|
|
||||||
namespace app\adminapi\controller\weapp;
|
namespace app\adminapi\controller\weapp;
|
||||||
|
|
||||||
use app\service\admin\weapp\WeappConfigService;
|
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
use think\Response;
|
|
||||||
|
|
||||||
class Package extends BaseAdminController
|
class Package extends BaseAdminController
|
||||||
{
|
{
|
||||||
|
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add(){
|
public function add()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['version', ''],
|
['version', ''],
|
||||||
['path', ''],
|
['path', ''],
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\weapp;
|
|||||||
|
|
||||||
use app\service\admin\weapp\WeappTemplateService;
|
use app\service\admin\weapp\WeappTemplateService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序订阅消息
|
* 微信小程序订阅消息
|
||||||
@ -22,9 +23,10 @@ class Template extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 订阅消息
|
* 订阅消息
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$wechat_template_service = new WeappTemplateService();
|
$wechat_template_service = new WeappTemplateService();
|
||||||
return success($wechat_template_service->getList());
|
return success($wechat_template_service->getList());
|
||||||
}
|
}
|
||||||
@ -32,9 +34,10 @@ class Template extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单信息
|
* 菜单信息
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function sync(){
|
public function sync()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['keys', []]
|
['keys', []]
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -21,7 +21,8 @@ class Config extends BaseAdminController
|
|||||||
* 获取微信配置信息
|
* 获取微信配置信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function get(){
|
public function get()
|
||||||
|
{
|
||||||
return success((new WechatConfigService())->getWechatConfig());
|
return success((new WechatConfigService())->getWechatConfig());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +30,8 @@ class Config extends BaseAdminController
|
|||||||
* 设置微信配置信息
|
* 设置微信配置信息
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function set(){
|
public function set()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['wechat_name', ''],
|
['wechat_name', ''],
|
||||||
['wechat_original', ''],
|
['wechat_original', ''],
|
||||||
@ -49,7 +51,8 @@ class Config extends BaseAdminController
|
|||||||
* 获取微信静态资源
|
* 获取微信静态资源
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function static(){
|
public function static()
|
||||||
|
{
|
||||||
return success((new WechatConfigService())->getWechatStaticInfo());
|
return success((new WechatConfigService())->getWechatStaticInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,9 @@ namespace app\adminapi\controller\wechat;
|
|||||||
|
|
||||||
use app\service\admin\wechat\WechatMenuService;
|
use app\service\admin\wechat\WechatMenuService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use EasyWeChat\Kernel\Exceptions\InvalidConfigException;
|
||||||
|
use GuzzleHttp\Exception\GuzzleException;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信公众号管理菜单
|
* 微信公众号管理菜单
|
||||||
@ -22,18 +25,22 @@ class Menu extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单信息
|
* 菜单信息
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(){
|
public function info()
|
||||||
|
{
|
||||||
$wechat_menu_service = new WechatMenuService();
|
$wechat_menu_service = new WechatMenuService();
|
||||||
return success($wechat_menu_service->getInfo());
|
return success($wechat_menu_service->getInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置菜单
|
* 设置菜单
|
||||||
* @return void
|
* @return Response
|
||||||
|
* @throws InvalidConfigException
|
||||||
|
* @throws GuzzleException
|
||||||
*/
|
*/
|
||||||
public function edit(){
|
public function edit()
|
||||||
|
{
|
||||||
$wechat_menu_service = new WechatMenuService();
|
$wechat_menu_service = new WechatMenuService();
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['button', []]
|
['button', []]
|
||||||
|
|||||||
@ -23,14 +23,16 @@ class Reply extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 关键词回复
|
* 关键词回复
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function keyword($id){
|
public function keyword($id)
|
||||||
|
{
|
||||||
$wechat_reply_service = new WechatReplyService();
|
$wechat_reply_service = new WechatReplyService();
|
||||||
return success($wechat_reply_service->getKeywordInfo($id));
|
return success($wechat_reply_service->getKeywordInfo($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKeywordLists(){
|
public function getKeywordLists()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['keyword', ''],
|
['keyword', ''],
|
||||||
['name', '']
|
['name', '']
|
||||||
@ -38,11 +40,13 @@ class Reply extends BaseAdminController
|
|||||||
$wechat_reply_service = new WechatReplyService();
|
$wechat_reply_service = new WechatReplyService();
|
||||||
return success($wechat_reply_service->getKeywordPage($data));
|
return success($wechat_reply_service->getKeywordPage($data));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增关键词回复
|
* 新增关键词回复
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function addKeyword(){
|
public function addKeyword()
|
||||||
|
{
|
||||||
$wechat_reply_service = new WechatReplyService();
|
$wechat_reply_service = new WechatReplyService();
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['name', ''],
|
['name', ''],
|
||||||
@ -58,9 +62,10 @@ class Reply extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新关键词回复
|
* 更新关键词回复
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function editKeyword($id){
|
public function editKeyword($id)
|
||||||
|
{
|
||||||
$wechat_reply_service = new WechatReplyService();
|
$wechat_reply_service = new WechatReplyService();
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['name', ''],
|
['name', ''],
|
||||||
@ -76,9 +81,10 @@ class Reply extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除关键字回复
|
* 删除关键字回复
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function delKeyword($id){
|
public function delKeyword($id)
|
||||||
|
{
|
||||||
$wechat_reply_service = new WechatReplyService();
|
$wechat_reply_service = new WechatReplyService();
|
||||||
return success($wechat_reply_service->delKeyword($id));
|
return success($wechat_reply_service->delKeyword($id));
|
||||||
}
|
}
|
||||||
@ -87,7 +93,8 @@ class Reply extends BaseAdminController
|
|||||||
* 获取默认回复
|
* 获取默认回复
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function default(){
|
public function default()
|
||||||
|
{
|
||||||
$wechat_reply_service = new WechatReplyService();
|
$wechat_reply_service = new WechatReplyService();
|
||||||
return success($wechat_reply_service->getDefault());
|
return success($wechat_reply_service->getDefault());
|
||||||
}
|
}
|
||||||
@ -96,7 +103,8 @@ class Reply extends BaseAdminController
|
|||||||
* 更新默认回复
|
* 更新默认回复
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function editDefault(){
|
public function editDefault()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['content_type', ''],
|
['content_type', ''],
|
||||||
['content', ''],
|
['content', ''],
|
||||||
@ -110,7 +118,8 @@ class Reply extends BaseAdminController
|
|||||||
* 获取关注回复
|
* 获取关注回复
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function subscribe(){
|
public function subscribe()
|
||||||
|
{
|
||||||
$wechat_reply_service = new WechatReplyService();
|
$wechat_reply_service = new WechatReplyService();
|
||||||
return success($wechat_reply_service->getSubscribe());
|
return success($wechat_reply_service->getSubscribe());
|
||||||
}
|
}
|
||||||
@ -119,7 +128,8 @@ class Reply extends BaseAdminController
|
|||||||
* 更新关注回复
|
* 更新关注回复
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function editSubscribe(){
|
public function editSubscribe()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['content_type', ''],
|
['content_type', ''],
|
||||||
['content', ''],
|
['content', ''],
|
||||||
@ -130,5 +140,4 @@ class Reply extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\wechat;
|
|||||||
|
|
||||||
use app\service\admin\wechat\WechatTemplateService;
|
use app\service\admin\wechat\WechatTemplateService;
|
||||||
use core\base\BaseAdminController;
|
use core\base\BaseAdminController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信公众号管理菜单
|
* 微信公众号管理菜单
|
||||||
@ -22,9 +23,10 @@ class Template extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单信息
|
* 菜单信息
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function sync(){
|
public function sync()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['keys', []]
|
['keys', []]
|
||||||
]);
|
]);
|
||||||
@ -34,9 +36,10 @@ class Template extends BaseAdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 模板消息
|
* 模板消息
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function lists(){
|
public function lists()
|
||||||
|
{
|
||||||
$wechat_template_service = new WechatTemplateService();
|
$wechat_template_service = new WechatTemplateService();
|
||||||
return success($wechat_template_service->getList());
|
return success($wechat_template_service->getList());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
// 全局中间件定义文件
|
// 全局中间件定义文件
|
||||||
use app\adminapi\middleware\AllowCrossDomain;
|
use app\adminapi\middleware\AllowCrossDomain;
|
||||||
use think\middleware\LoadLangPack;
|
use think\middleware\LoadLangPack;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
//跨域请求中间件
|
//跨域请求中间件
|
||||||
AllowCrossDomain::class,
|
AllowCrossDomain::class,
|
||||||
|
|||||||
@ -13,7 +13,6 @@ namespace app\adminapi\middleware;
|
|||||||
|
|
||||||
|
|
||||||
use app\Request;
|
use app\Request;
|
||||||
|
|
||||||
use app\service\admin\auth\AuthService;
|
use app\service\admin\auth\AuthService;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
|
||||||
|
|||||||
@ -26,8 +26,7 @@ class AdminLog
|
|||||||
public function handle(Request $request, Closure $next)
|
public function handle(Request $request, Closure $next)
|
||||||
{
|
{
|
||||||
//写入日志
|
//写入日志
|
||||||
if($request->method() != 'GET')
|
if ($request->method() != 'GET') {
|
||||||
{
|
|
||||||
$data = [
|
$data = [
|
||||||
'uid' => $request->uid(),
|
'uid' => $request->uid(),
|
||||||
'username' => $request->username(),
|
'username' => $request->username(),
|
||||||
|
|||||||
@ -13,7 +13,6 @@ namespace app\adminapi\middleware;
|
|||||||
|
|
||||||
use app\Request;
|
use app\Request;
|
||||||
use Closure;
|
use Closure;
|
||||||
use core\exception\ServerException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* http跨域请求中间件
|
* http跨域请求中间件
|
||||||
|
|||||||
@ -34,6 +34,8 @@ Route::group(function () {
|
|||||||
Route::post('addon/install/execute/:addon', 'addon.Addon/execute');
|
Route::post('addon/install/execute/:addon', 'addon.Addon/execute');
|
||||||
//插件安装状态
|
//插件安装状态
|
||||||
Route::get('addon/install/:addon/status/:key', 'addon.Addon/getInstallState');
|
Route::get('addon/install/:addon/status/:key', 'addon.Addon/getInstallState');
|
||||||
|
//下载插件
|
||||||
|
Route::post('addon/download/:addon', 'addon.Addon/download');
|
||||||
|
|
||||||
//卸载插件
|
//卸载插件
|
||||||
Route::post('addon/uninstall/:addon', 'addon.Addon/uninstall');
|
Route::post('addon/uninstall/:addon', 'addon.Addon/uninstall');
|
||||||
@ -41,6 +43,8 @@ Route::group(function () {
|
|||||||
Route::post('addon/edit/:addon', 'addon.Addon/edit');
|
Route::post('addon/edit/:addon', 'addon.Addon/edit');
|
||||||
//应用列表(...)
|
//应用列表(...)
|
||||||
Route::get('app/list', 'addon.App/getAppList');
|
Route::get('app/list', 'addon.App/getAppList');
|
||||||
|
|
||||||
|
|
||||||
})->middleware([
|
})->middleware([
|
||||||
AdminCheckToken::class,
|
AdminCheckToken::class,
|
||||||
AdminCheckRole::class,
|
AdminCheckRole::class,
|
||||||
|
|||||||
@ -9,10 +9,11 @@
|
|||||||
// | Author: Niucloud Team
|
// | Author: Niucloud Team
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
use think\facade\Route;
|
use core\exception\CommonException;
|
||||||
|
use think\facade\Request;
|
||||||
|
|
||||||
$is_demo = env('system.is_demo', 0);
|
$is_demo = env('system.is_demo', 0);
|
||||||
if ($is_demo && !\think\facade\Request::isGet()) {
|
if ($is_demo && !Request::isGet()) {
|
||||||
//加载插件路由
|
//加载插件路由
|
||||||
throw new \core\exception\CommonException("演示数据不能进行修改");
|
throw new CommonException("演示数据不能进行修改");
|
||||||
}
|
}
|
||||||
@ -42,11 +42,12 @@ Route::group('applet', function () {
|
|||||||
//详情
|
//详情
|
||||||
Route::get('site/version/:id', 'applet.SiteVersion/info');
|
Route::get('site/version/:id', 'applet.SiteVersion/info');
|
||||||
//最后一个升级的版本
|
//最后一个升级的版本
|
||||||
Route::post('site/version/last', 'applet.SiteVersion/getLastVersion');
|
Route::get('site/version/last', 'applet.SiteVersion/getLastVersion');
|
||||||
|
//查看最新的版本
|
||||||
|
Route::get('site/version/upgrade', 'applet.SiteVersion/getUpgradeVersion');
|
||||||
|
|
||||||
//下载
|
//下载
|
||||||
Route::post('version/download/:id', 'applet.VersionDownload/download');
|
Route::get('version/download/:id', 'applet.VersionDownload/download');
|
||||||
})->middleware([
|
})->middleware([
|
||||||
AdminCheckToken::class,
|
AdminCheckToken::class,
|
||||||
AdminCheckRole::class,
|
AdminCheckRole::class,
|
||||||
|
|||||||
46
niucloud/app/adminapi/route/niucloud.php
Normal file
46
niucloud/app/adminapi/route/niucloud.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网址:https://www.niucloud-admin.com
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | niucloud团队 版权所有 开源版本可自由商用
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: Niucloud Team
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
use app\adminapi\middleware\AdminCheckRole;
|
||||||
|
use app\adminapi\middleware\AdminCheckToken;
|
||||||
|
use app\adminapi\middleware\AdminLog;
|
||||||
|
use think\facade\Route;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用插件相关路由
|
||||||
|
*/
|
||||||
|
Route::group('niucloud', function () {
|
||||||
|
//设置 授权信息
|
||||||
|
Route::post('authinfo', 'niucloud.Module/setAuthorize');
|
||||||
|
//获取 授权设置
|
||||||
|
Route::get('admin/authinfo', 'niucloud.Module/getAuthorize');
|
||||||
|
|
||||||
|
//获取授权信息
|
||||||
|
Route::get('authinfo', 'niucloud.Module/authorize');
|
||||||
|
|
||||||
|
|
||||||
|
//获取应用插件列表
|
||||||
|
Route::get('module', 'addon.Addon/getLocalAddonList');
|
||||||
|
//获取应用详情
|
||||||
|
Route::get('module', 'addon.Addon/getLocalAddonList');
|
||||||
|
//获取插件插件列表
|
||||||
|
Route::get('module/version', 'addon.Addon/lists');
|
||||||
|
//下载
|
||||||
|
Route::get('module/download/:version_id', 'addon.Addon/info');
|
||||||
|
//更新
|
||||||
|
Route::put('addon/status/:version_id', 'addon.Addon/setStatus');
|
||||||
|
|
||||||
|
|
||||||
|
})->middleware([
|
||||||
|
AdminCheckToken::class,
|
||||||
|
AdminCheckRole::class,
|
||||||
|
AdminLog::class
|
||||||
|
]);
|
||||||
@ -31,6 +31,14 @@ Route::group('pay', function () {
|
|||||||
Route::post('channel/set/transfer', 'pay.PayChannel/setTransfer');
|
Route::post('channel/set/transfer', 'pay.PayChannel/setTransfer');
|
||||||
//多渠道设置
|
//多渠道设置
|
||||||
Route::post('channel/set/all', 'pay.PayChannel/setAll');
|
Route::post('channel/set/all', 'pay.PayChannel/setAll');
|
||||||
|
// 支付审核
|
||||||
|
Route::get('audit', 'pay.Pay/audit');
|
||||||
|
// 审核通过
|
||||||
|
Route::put('pass/:out_trade_no', 'pay.Pay/pass');
|
||||||
|
// 审核拒绝
|
||||||
|
Route::put('refuse/:out_trade_no', 'pay.Pay/refuse');
|
||||||
|
// 支付单据详情
|
||||||
|
Route::get('detail/:id', 'pay.Pay/detail');
|
||||||
})->middleware([
|
})->middleware([
|
||||||
AdminCheckToken::class,
|
AdminCheckToken::class,
|
||||||
AdminCheckRole::class,
|
AdminCheckRole::class,
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
// | Author: Niucloud Team
|
// | Author: Niucloud Team
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
use core\dict\DictLoader;
|
||||||
use think\facade\Route;
|
use think\facade\Route;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,4 +31,4 @@ Route::group(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//加载插件路由
|
//加载插件路由
|
||||||
(new \core\dict\DictLoader("Route"))->load(['app_type' => 'adminapi']);
|
(new DictLoader("Route"))->load(['app_type' => 'adminapi']);
|
||||||
@ -77,6 +77,11 @@ Route::group('sys', function () {
|
|||||||
//获取首页加载
|
//获取首页加载
|
||||||
Route::get('config/site_index', 'sys.Config/getSiteIndexList');
|
Route::get('config/site_index', 'sys.Config/getSiteIndexList');
|
||||||
|
|
||||||
|
//平台首页加载设置
|
||||||
|
Route::put('config/admin_index', 'sys.Config/setAdminIndex');
|
||||||
|
//获取平台首页加载
|
||||||
|
Route::get('config/admin_index', 'sys.Config/getAdminIndexList');
|
||||||
|
|
||||||
//快捷菜单设置
|
//快捷菜单设置
|
||||||
Route::put('config/shortcut_menu', 'sys.Config/setShortcutMenu');
|
Route::put('config/shortcut_menu', 'sys.Config/setShortcutMenu');
|
||||||
//获取快捷菜单
|
//获取快捷菜单
|
||||||
@ -185,6 +190,9 @@ Route::group('sys', function () {
|
|||||||
Route::get('date/month', 'sys.Common/getMonth');
|
Route::get('date/month', 'sys.Common/getMonth');
|
||||||
Route::get('date/week', 'sys.Common/getWeek');
|
Route::get('date/week', 'sys.Common/getWeek');
|
||||||
|
|
||||||
|
/***************************************************** 获取布局 ****************************************************/
|
||||||
|
Route::get('layout', 'sys.System/layout');
|
||||||
|
Route::put('layout', 'sys.System/setLayout');
|
||||||
})->middleware([
|
})->middleware([
|
||||||
AdminCheckToken::class,
|
AdminCheckToken::class,
|
||||||
AdminCheckRole::class,
|
AdminCheckRole::class,
|
||||||
|
|||||||
@ -9,8 +9,3 @@
|
|||||||
// | Author: Niucloud Team
|
// | Author: Niucloud Team
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
use app\adminapi\middleware\AdminCheckRole;
|
|
||||||
use app\adminapi\middleware\AdminCheckToken;
|
|
||||||
use app\adminapi\middleware\AdminLog;
|
|
||||||
use think\facade\Route;
|
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,7 @@ class Article extends BaseApiController
|
|||||||
/**
|
/**
|
||||||
* 文章详情
|
* 文章详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id){
|
public function info(int $id){
|
||||||
return success((new ArticleService())->getInfo($id));
|
return success((new ArticleService())->getInfo($id));
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class ArticleCategory extends BaseApiController
|
|||||||
/**
|
/**
|
||||||
* 文章分类详情
|
* 文章分类详情
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $id){
|
public function info(int $id){
|
||||||
return success((new ArticleCategoryService())->getInfo($id));
|
return success((new ArticleCategoryService())->getInfo($id));
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class Diy extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 分享内容
|
* 分享内容
|
||||||
* @return Response|void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function share()
|
public function share()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,7 +21,8 @@ class Config extends BaseController
|
|||||||
* 获取登录注册设置
|
* 获取登录注册设置
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getLoginConfig(){
|
public function getLoginConfig()
|
||||||
|
{
|
||||||
|
|
||||||
return success((new MemberConfigService())->getLoginConfig());
|
return success((new MemberConfigService())->getLoginConfig());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ namespace app\api\controller\login;
|
|||||||
use app\service\api\captcha\CaptchaService;
|
use app\service\api\captcha\CaptchaService;
|
||||||
use app\service\api\login\LoginService;
|
use app\service\api\login\LoginService;
|
||||||
use core\base\BaseController;
|
use core\base\BaseController;
|
||||||
|
use Exception;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
class Login extends BaseController
|
class Login extends BaseController
|
||||||
@ -22,7 +23,8 @@ class Login extends BaseController
|
|||||||
* 登录
|
* 登录
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function login(){
|
public function login()
|
||||||
|
{
|
||||||
|
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['username', ''],
|
['username', ''],
|
||||||
@ -43,7 +45,8 @@ class Login extends BaseController
|
|||||||
* 登出
|
* 登出
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function logout(){
|
public function logout()
|
||||||
|
{
|
||||||
(new LoginService)->logout();
|
(new LoginService)->logout();
|
||||||
return success('MEMBER_LOGOUT');
|
return success('MEMBER_LOGOUT');
|
||||||
}
|
}
|
||||||
@ -52,15 +55,19 @@ class Login extends BaseController
|
|||||||
* 创建验证码
|
* 创建验证码
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function captcha(){
|
public function captcha()
|
||||||
|
{
|
||||||
return success((new CaptchaService())->create());
|
return success((new CaptchaService())->create());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送手机验证码
|
* 发送手机验证码
|
||||||
* @return void
|
* @param $type
|
||||||
|
* @return Response
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function sendMobileCode($type){
|
public function sendMobileCode($type)
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['mobile', ''],
|
['mobile', ''],
|
||||||
]);
|
]);
|
||||||
@ -69,9 +76,10 @@ class Login extends BaseController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号登录
|
* 手机号登录
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function mobile(){
|
public function mobile()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['mobile', ''],
|
['mobile', ''],
|
||||||
]);
|
]);
|
||||||
@ -82,7 +90,8 @@ class Login extends BaseController
|
|||||||
* 重置密码
|
* 重置密码
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function resetPassword(){
|
public function resetPassword()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['mobile', ''],
|
['mobile', ''],
|
||||||
['password', '']
|
['password', '']
|
||||||
|
|||||||
@ -22,7 +22,8 @@ class Register extends BaseController
|
|||||||
* 账号密码注册
|
* 账号密码注册
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function account(){
|
public function account()
|
||||||
|
{
|
||||||
|
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['username', ''],
|
['username', ''],
|
||||||
@ -40,7 +41,8 @@ class Register extends BaseController
|
|||||||
* 手机号注册
|
* 手机号注册
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function mobile(){
|
public function mobile()
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['mobile', ''],
|
['mobile', ''],
|
||||||
]);
|
]);
|
||||||
@ -54,9 +56,4 @@ class Register extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,7 @@ use app\dict\member\MemberAccountChangeTypeDict;
|
|||||||
use app\dict\member\MemberAccountTypeDict;
|
use app\dict\member\MemberAccountTypeDict;
|
||||||
use app\service\api\member\MemberAccountService;
|
use app\service\api\member\MemberAccountService;
|
||||||
use core\base\BaseApiController;
|
use core\base\BaseApiController;
|
||||||
|
use think\db\exception\DbException;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -28,7 +29,8 @@ class Account extends BaseApiController
|
|||||||
* 积分流水
|
* 积分流水
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function point(){
|
public function point(): Response
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['from_type', '']
|
['from_type', '']
|
||||||
]);
|
]);
|
||||||
@ -40,7 +42,8 @@ class Account extends BaseApiController
|
|||||||
* 余额流水
|
* 余额流水
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function balance(){
|
public function balance(): Response
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['from_type', '']
|
['from_type', '']
|
||||||
]);
|
]);
|
||||||
@ -52,7 +55,8 @@ class Account extends BaseApiController
|
|||||||
* 零钱流水
|
* 零钱流水
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function money(){
|
public function money(): Response
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['from_type', '']
|
['from_type', '']
|
||||||
]);
|
]);
|
||||||
@ -63,8 +67,10 @@ class Account extends BaseApiController
|
|||||||
/**
|
/**
|
||||||
* 账户记录数量
|
* 账户记录数量
|
||||||
* @return Response
|
* @return Response
|
||||||
|
* @throws DbException
|
||||||
*/
|
*/
|
||||||
public function count(){
|
public function count(): Response
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['from_type', ''],
|
['from_type', ''],
|
||||||
['account_type', '']
|
['account_type', '']
|
||||||
@ -76,7 +82,8 @@ class Account extends BaseApiController
|
|||||||
* 佣金流水
|
* 佣金流水
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function commission(){
|
public function commission(): Response
|
||||||
|
{
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['from_type', '']
|
['from_type', '']
|
||||||
]);
|
]);
|
||||||
@ -89,7 +96,8 @@ class Account extends BaseApiController
|
|||||||
* @param $account_type
|
* @param $account_type
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getFromType($account_type){
|
public function getFromType($account_type): Response
|
||||||
|
{
|
||||||
|
|
||||||
return success(MemberAccountChangeTypeDict::getType($account_type));
|
return success(MemberAccountChangeTypeDict::getType($account_type));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace app\api\controller\member;
|
|||||||
|
|
||||||
use app\service\api\member\MemberCashOutAccountService;
|
use app\service\api\member\MemberCashOutAccountService;
|
||||||
use core\base\BaseApiController;
|
use core\base\BaseApiController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
class CashOutAccount extends BaseApiController
|
class CashOutAccount extends BaseApiController
|
||||||
{
|
{
|
||||||
@ -30,7 +31,7 @@ class CashOutAccount extends BaseApiController
|
|||||||
/**
|
/**
|
||||||
* 提现账户信息
|
* 提现账户信息
|
||||||
* @param int $account_id
|
* @param int $account_id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function info(int $account_id){
|
public function info(int $account_id){
|
||||||
return success((new MemberCashOutAccountService())->getInfo($account_id));
|
return success((new MemberCashOutAccountService())->getInfo($account_id));
|
||||||
@ -38,7 +39,7 @@ class CashOutAccount extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询首条提现账户按账户类型
|
* 查询首条提现账户按账户类型
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function firstInfo(){
|
public function firstInfo(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -49,7 +50,7 @@ class CashOutAccount extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加提现账号
|
* 添加提现账号
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function add(){
|
public function add(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -66,7 +67,7 @@ class CashOutAccount extends BaseApiController
|
|||||||
/**
|
/**
|
||||||
* 编辑提现账号
|
* 编辑提现账号
|
||||||
* @param int $account_id
|
* @param int $account_id
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function edit(int $account_id){
|
public function edit(int $account_id){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -83,7 +84,7 @@ class CashOutAccount extends BaseApiController
|
|||||||
/**
|
/**
|
||||||
* 删除提现账号
|
* 删除提现账号
|
||||||
* @param int $account_id
|
* @param int $account_id
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function del(int $account_id){
|
public function del(int $account_id){
|
||||||
(new MemberCashOutAccountService())->del($account_id);
|
(new MemberCashOutAccountService())->del($account_id);
|
||||||
|
|||||||
@ -15,6 +15,9 @@ use app\service\api\login\AuthService;
|
|||||||
use app\service\api\member\MemberLogService;
|
use app\service\api\member\MemberLogService;
|
||||||
use app\service\api\member\MemberService;
|
use app\service\api\member\MemberService;
|
||||||
use core\base\BaseApiController;
|
use core\base\BaseApiController;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\DbException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
class Member extends BaseApiController
|
class Member extends BaseApiController
|
||||||
@ -38,7 +41,6 @@ class Member extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改会员
|
* 修改会员
|
||||||
* @param $member_id
|
|
||||||
* @param $field
|
* @param $field
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
@ -67,7 +69,7 @@ class Member extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定手机号
|
* 绑定手机号
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function mobile(){
|
public function mobile(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -88,6 +90,13 @@ class Member extends BaseApiController
|
|||||||
['pre_route', '']
|
['pre_route', '']
|
||||||
]);
|
]);
|
||||||
(new MemberLogService())->log($data);
|
(new MemberLogService())->log($data);
|
||||||
return success('SUCCESS');
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员码
|
||||||
|
*/
|
||||||
|
public function qrcode(){
|
||||||
|
return success((new MemberService())->getQrcode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class MemberCashOut extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请提现
|
* 申请提现
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function apply()
|
public function apply()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,6 +13,10 @@ namespace app\api\controller\pay;
|
|||||||
|
|
||||||
use app\service\api\pay\PayService;
|
use app\service\api\pay\PayService;
|
||||||
use core\base\BaseApiController;
|
use core\base\BaseApiController;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\DbException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信服务端通信以及网页授权
|
* 微信服务端通信以及网页授权
|
||||||
@ -22,7 +26,7 @@ class Pay extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 接收消息并推送
|
* 接收消息并推送
|
||||||
* @return void
|
* @return void|null
|
||||||
*/
|
*/
|
||||||
public function notify($site_id, $channel, $type, $action)
|
public function notify($site_id, $channel, $type, $action)
|
||||||
{
|
{
|
||||||
@ -31,26 +35,39 @@ class Pay extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 去支付
|
* 去支付
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function pay()
|
public function pay()
|
||||||
{
|
{
|
||||||
|
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
['type', ''],
|
['type', ''],
|
||||||
['out_trade_no', ''],
|
// ['out_trade_no', ''],
|
||||||
|
['trade_type', ''],//业务类型
|
||||||
|
['trade_id', ''],//业务id
|
||||||
['quit_url', ''],
|
['quit_url', ''],
|
||||||
['buyer_id', ''],
|
['buyer_id', ''],
|
||||||
['return_url', '']
|
['return_url', ''],
|
||||||
|
['voucher', '']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return success('SUCCESS',(new PayService())->pay($data['type'], $data['out_trade_no'], $data['return_url'], $data['quit_url'], $data['buyer_id']));
|
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']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function info($out_trade_no)
|
public function info($trade_type, $trade_id)
|
||||||
{
|
{
|
||||||
|
return success((new PayService())->getInfoByTrade($trade_type, $trade_id));
|
||||||
|
}
|
||||||
|
|
||||||
return success((new PayService())->getInfoByOutTradeNo($out_trade_no));
|
/**
|
||||||
|
* 获取可用的支付方法
|
||||||
|
* @param $trade_type
|
||||||
|
* @return Response
|
||||||
|
* @throws DataNotFoundException
|
||||||
|
* @throws DbException
|
||||||
|
* @throws ModelNotFoundException
|
||||||
|
*/
|
||||||
|
public function getPayType($trade_type){
|
||||||
|
return success((new PayService())->getPayTypeByTrade($trade_type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,13 +15,14 @@ use app\service\api\upload\Base64Service;
|
|||||||
use app\service\api\upload\FetchService;
|
use app\service\api\upload\FetchService;
|
||||||
use app\service\api\upload\UploadService;
|
use app\service\api\upload\UploadService;
|
||||||
use core\base\BaseApiController;
|
use core\base\BaseApiController;
|
||||||
|
use think\Response;
|
||||||
|
|
||||||
class Upload extends BaseApiController
|
class Upload extends BaseApiController
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片上传
|
* 图片上传
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function image(){
|
public function image(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -33,7 +34,7 @@ class Upload extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 远程图片拉取
|
* 远程图片拉取
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function imageFetch(){
|
public function imageFetch(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -46,7 +47,7 @@ class Upload extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* base64图片上传
|
* base64图片上传
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function imageBase64(){
|
public function imageBase64(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class Weapp extends BaseApiController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 授权登录
|
* 授权登录
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function login(){
|
public function login(){
|
||||||
$data = $this->request->params([['code', '']]);
|
$data = $this->request->params([['code', '']]);
|
||||||
@ -33,7 +33,6 @@ class Weapp extends BaseApiController
|
|||||||
/**
|
/**
|
||||||
* 注册
|
* 注册
|
||||||
* @return Response
|
* @return Response
|
||||||
* @throws InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
public function register(){
|
public function register(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
|
|||||||
@ -13,6 +13,12 @@ namespace app\api\controller\wechat;
|
|||||||
|
|
||||||
use app\service\api\wechat\WechatServeService;
|
use app\service\api\wechat\WechatServeService;
|
||||||
use core\base\BaseController;
|
use core\base\BaseController;
|
||||||
|
use EasyWeChat\Kernel\Exceptions\BadRequestException;
|
||||||
|
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
|
||||||
|
use EasyWeChat\Kernel\Exceptions\RuntimeException;
|
||||||
|
use ReflectionException;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信服务端通信以及网页授权
|
* 微信服务端通信以及网页授权
|
||||||
@ -22,7 +28,13 @@ class Serve extends BaseController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 接收消息并推送
|
* 接收消息并推送
|
||||||
* @return void
|
* @param $site_id
|
||||||
|
* @return Response
|
||||||
|
* @throws BadRequestException
|
||||||
|
* @throws InvalidArgumentException
|
||||||
|
* @throws RuntimeException
|
||||||
|
* @throws ReflectionException
|
||||||
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public function serve($site_id){
|
public function serve($site_id){
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,9 @@ namespace app\api\controller\wechat;
|
|||||||
use app\service\api\wechat\WechatAuthService;
|
use app\service\api\wechat\WechatAuthService;
|
||||||
use core\base\BaseController;
|
use core\base\BaseController;
|
||||||
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
|
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
|
use think\db\exception\DbException;
|
||||||
|
use think\db\exception\ModelNotFoundException;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
class Wechat extends BaseController
|
class Wechat extends BaseController
|
||||||
@ -23,7 +26,6 @@ class Wechat extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取跳转获取code
|
* 获取跳转获取code
|
||||||
* @return Response
|
* @return Response
|
||||||
* @throws InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
public function getCodeUrl(){
|
public function getCodeUrl(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -36,7 +38,10 @@ class Wechat extends BaseController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 授权登录
|
* 授权登录
|
||||||
* @return void
|
* @return Response
|
||||||
|
* @throws DataNotFoundException
|
||||||
|
* @throws DbException
|
||||||
|
* @throws ModelNotFoundException
|
||||||
*/
|
*/
|
||||||
public function login(){
|
public function login(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -49,7 +54,6 @@ class Wechat extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 注册
|
* 注册
|
||||||
* @return Response
|
* @return Response
|
||||||
* @throws InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
public function register(){
|
public function register(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -67,7 +71,6 @@ class Wechat extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 同步
|
* 同步
|
||||||
* @return Response
|
* @return Response
|
||||||
* @throws InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
public function sync(){
|
public function sync(){
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
@ -91,7 +94,7 @@ class Wechat extends BaseController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫码登录
|
* 扫码登录
|
||||||
* @return void
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function scanLogin(){
|
public function scanLogin(){
|
||||||
$wechat_auth_service = new WechatAuthService();
|
$wechat_auth_service = new WechatAuthService();
|
||||||
|
|||||||
@ -13,7 +13,6 @@ namespace app\api\middleware;
|
|||||||
|
|
||||||
use app\Request;
|
use app\Request;
|
||||||
use Closure;
|
use Closure;
|
||||||
use core\exception\ServerException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* http跨域请求中间件
|
* http跨域请求中间件
|
||||||
|
|||||||
@ -12,11 +12,8 @@
|
|||||||
namespace app\api\middleware;
|
namespace app\api\middleware;
|
||||||
|
|
||||||
use app\Request;
|
use app\Request;
|
||||||
use app\service\core\site\CoreSiteService;
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use core\exception\AuthException;
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use think\facade\Log;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -31,6 +31,8 @@ Route::group('member', function() {
|
|||||||
Route::put('edit', 'member.Member/edit');
|
Route::put('edit', 'member.Member/edit');
|
||||||
//绑定手机号
|
//绑定手机号
|
||||||
Route::put('mobile', 'member.Member/mobile');
|
Route::put('mobile', 'member.Member/mobile');
|
||||||
|
//获取会员码
|
||||||
|
Route::get('qrcode', 'member.Member/qrcode');
|
||||||
|
|
||||||
/***************************************************** 会员账户 ****************************************************/
|
/***************************************************** 会员账户 ****************************************************/
|
||||||
//会员积分流水
|
//会员积分流水
|
||||||
|
|||||||
@ -26,7 +26,9 @@ Route::group('pay',function () {
|
|||||||
//去支付
|
//去支付
|
||||||
Route::post('', 'pay.Pay/pay');
|
Route::post('', 'pay.Pay/pay');
|
||||||
//支付信息
|
//支付信息
|
||||||
Route::get('info/:out_trade_no', 'pay.Pay/info');
|
Route::get('info/:trade_type/:trade_id', 'pay.Pay/info');
|
||||||
|
//
|
||||||
|
Route::get('type/:trade_type', 'pay.Pay/getPayType');
|
||||||
|
|
||||||
})->middleware(ApiChannel::class)
|
})->middleware(ApiChannel::class)
|
||||||
->middleware(ApiCheckToken::class)
|
->middleware(ApiCheckToken::class)
|
||||||
|
|||||||
@ -12,7 +12,10 @@
|
|||||||
use app\api\middleware\ApiChannel;
|
use app\api\middleware\ApiChannel;
|
||||||
use app\api\middleware\ApiCheckToken;
|
use app\api\middleware\ApiCheckToken;
|
||||||
use app\api\middleware\ApiLog;
|
use app\api\middleware\ApiLog;
|
||||||
|
use app\api\route\dispatch\BindDispatch;
|
||||||
|
use core\dict\DictLoader;
|
||||||
use think\facade\Route;
|
use think\facade\Route;
|
||||||
|
use app\service\core\niucloud\CoreNotifyService;
|
||||||
|
|
||||||
//公众号消息推送
|
//公众号消息推送
|
||||||
Route::any('wechat/serve/:site_id', 'wechat.Serve/serve')
|
Route::any('wechat/serve/:site_id', 'wechat.Serve/serve')
|
||||||
@ -20,6 +23,12 @@ Route::any('wechat/serve/:site_id', 'wechat.Serve/serve')
|
|||||||
->middleware(ApiCheckToken::class)
|
->middleware(ApiCheckToken::class)
|
||||||
->middleware(ApiLog::class);
|
->middleware(ApiLog::class);
|
||||||
|
|
||||||
|
Route::group(function() {
|
||||||
|
Route::post('niucloud/notify', function(){
|
||||||
|
return (new CoreNotifyService())->notify();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由
|
* 路由
|
||||||
@ -45,7 +54,7 @@ Route::group(function() {
|
|||||||
//登录
|
//登录
|
||||||
Route::get('login', 'login.Login/login');
|
Route::get('login', 'login.Login/login');
|
||||||
//第三方绑定
|
//第三方绑定
|
||||||
Route::post('bind', \app\api\route\dispatch\BindDispatch::class);
|
Route::post('bind', BindDispatch::class);
|
||||||
//密码重置
|
//密码重置
|
||||||
Route::post('password/reset', 'login.Login/resetPassword');
|
Route::post('password/reset', 'login.Login/resetPassword');
|
||||||
//账号密码注册
|
//账号密码注册
|
||||||
@ -78,4 +87,4 @@ Route::group(function() {
|
|||||||
->middleware(ApiCheckToken::class)
|
->middleware(ApiCheckToken::class)
|
||||||
->middleware(ApiLog::class);
|
->middleware(ApiLog::class);
|
||||||
//加载插件路由
|
//加载插件路由
|
||||||
( new \core\dict\DictLoader("Route") )->load([ 'app_type' => 'api' ]);
|
( new DictLoader("Route") )->load([ 'app_type' => 'api' ]);
|
||||||
@ -4,10 +4,11 @@ declare (strict_types = 1);
|
|||||||
namespace app\command\Addon;
|
namespace app\command\Addon;
|
||||||
|
|
||||||
use app\service\core\addon\CoreAddonInstallService;
|
use app\service\core\addon\CoreAddonInstallService;
|
||||||
|
use Exception;
|
||||||
use think\console\Command;
|
use think\console\Command;
|
||||||
use think\console\Input;
|
use think\console\Input;
|
||||||
use think\console\Output;
|
|
||||||
use think\console\input\Option;
|
use think\console\input\Option;
|
||||||
|
use think\console\Output;
|
||||||
|
|
||||||
class Install extends Command
|
class Install extends Command
|
||||||
{
|
{
|
||||||
@ -28,7 +29,7 @@ class Install extends Command
|
|||||||
try {
|
try {
|
||||||
$instance->$step();
|
$instance->$step();
|
||||||
$output->writeln("Command executed successfully");
|
$output->writeln("Command executed successfully");
|
||||||
} catch (\Exception $e) {
|
} catch ( Exception $e ) {
|
||||||
$output->writeln("Command failed " . $e->getMessage());
|
$output->writeln("Command failed " . $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,6 @@
|
|||||||
namespace app\command\schedule;
|
namespace app\command\schedule;
|
||||||
|
|
||||||
use app\service\core\schedule\CoreScheduleService;
|
use app\service\core\schedule\CoreScheduleService;
|
||||||
use think\Container;
|
|
||||||
use think\helper\Str;
|
|
||||||
use yunwuxin\cron\Task;
|
use yunwuxin\cron\Task;
|
||||||
|
|
||||||
class Schedule extends Task
|
class Schedule extends Task
|
||||||
@ -15,24 +13,14 @@ class Schedule extends Task
|
|||||||
$this->expression($this->getCrontab($this->vars['time']));
|
$this->expression($this->getCrontab($this->vars['time']));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行任务
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
protected function execute()
|
|
||||||
{
|
|
||||||
//...具体的任务执行
|
|
||||||
(new CoreScheduleService())->execute($this->vars);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getCrontab($data): string
|
protected function getCrontab($data): string
|
||||||
{
|
{
|
||||||
$crontab = '';
|
|
||||||
$min = $data['min'] ?? '*';
|
$min = $data['min'] ?? '*';
|
||||||
$hour = $data['hour'] ?? '*';
|
$hour = $data['hour'] ?? '*';
|
||||||
$day = $data['day'] ?? '*';
|
$day = $data['day'] ?? '*';
|
||||||
$week = $data['week'] ?? '*';
|
$week = $data['week'] ?? '*';
|
||||||
switch ($data['type']) {
|
$type = $data['type'] ?? '';
|
||||||
|
switch ($type) {
|
||||||
case 'min':// 每隔几分
|
case 'min':// 每隔几分
|
||||||
$crontab = '*/' . $min . ' * * * *';
|
$crontab = '*/' . $min . ' * * * *';
|
||||||
break;
|
break;
|
||||||
@ -49,6 +37,16 @@ class Schedule extends Task
|
|||||||
$crontab = $min . ' ' . $hour . ' ' . $day . ' * *';
|
$crontab = $min . ' ' . $hour . ' ' . $day . ' * *';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $crontab;
|
return $crontab ?? '* * * * *';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行任务
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function execute()
|
||||||
|
{
|
||||||
|
//...具体的任务执行
|
||||||
|
(new CoreScheduleService())->execute($this->vars);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,8 +11,11 @@ use app\service\core\upload\CoreImageService;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口操作成功,返回信息
|
* 接口操作成功,返回信息
|
||||||
* @param int $msg
|
* @param string $msg
|
||||||
* @param array $
|
* @param array|string|bool|null $data
|
||||||
|
* @param int $code
|
||||||
|
* @param int $http_code
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
function success($msg = 'SUCCESS', array|string|bool|null $data = [], int $code = 1, int $http_code = 200): Response
|
function success($msg = 'SUCCESS', array|string|bool|null $data = [], int $code = 1, int $http_code = 200): Response
|
||||||
{
|
{
|
||||||
@ -26,6 +29,11 @@ function success($msg = 'SUCCESS', array|string|bool|null $data = [], int $code
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口操作失败,返回信息
|
* 接口操作失败,返回信息
|
||||||
|
* @param $msg
|
||||||
|
* @param array|null $data
|
||||||
|
* @param int $code
|
||||||
|
* @param int $http_code
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
function fail($msg = 'FAIL', ?array $data = [], int $code = 0, int $http_code = 200): Response
|
function fail($msg = 'FAIL', ?array $data = [], int $code = 0, int $http_code = 200): Response
|
||||||
{
|
{
|
||||||
@ -38,7 +46,7 @@ function fail($msg = 'FAIL', ?array $data = [], int $code = 0, int $http_code =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动侦测语言并转化
|
* 自动侦测语言并转化
|
||||||
* @param string
|
* @param string $str
|
||||||
* @return lang()
|
* @return lang()
|
||||||
*/
|
*/
|
||||||
function get_lang($str)
|
function get_lang($str)
|
||||||
@ -87,7 +95,7 @@ function list_to_tree($list, $pk = 'id', $pid = 'pid', $child = 'child', $root =
|
|||||||
* 生成加密密码
|
* 生成加密密码
|
||||||
* @param $password
|
* @param $password
|
||||||
* @param $salt 手动提供散列密码的盐值(salt)。这将避免自动生成盐值(salt)。,默认不填写将自动生成
|
* @param $salt 手动提供散列密码的盐值(salt)。这将避免自动生成盐值(salt)。,默认不填写将自动生成
|
||||||
* @return bool|string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function create_password($password, $salt = '')
|
function create_password($password, $salt = '')
|
||||||
{
|
{
|
||||||
@ -98,6 +106,7 @@ function create_password($password, $salt = '')
|
|||||||
* 校验比对密码和加密密码是否一致
|
* 校验比对密码和加密密码是否一致
|
||||||
* @param $password
|
* @param $password
|
||||||
* @param $hash
|
* @param $hash
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function check_password($password, $hash)
|
function check_password($password, $hash)
|
||||||
{
|
{
|
||||||
@ -174,38 +183,6 @@ function del_target_dir($path, $delDir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @notes 下载文件
|
|
||||||
* @param $url
|
|
||||||
* @param $saveDir
|
|
||||||
* @param $fileName
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function download_file($url, $saveDir, $fileName)
|
|
||||||
{
|
|
||||||
if (!file_exists($saveDir)) {
|
|
||||||
mkdir($saveDir, 0775, true);
|
|
||||||
}
|
|
||||||
$fileSrc = $saveDir . $fileName;
|
|
||||||
file_exists($fileSrc) && unlink($fileSrc);
|
|
||||||
$ch = curl_init();
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
|
||||||
$file = curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
$resource = fopen($fileSrc, 'a');
|
|
||||||
fwrite($resource, $file);
|
|
||||||
fclose($resource);
|
|
||||||
if (filesize($fileSrc) == 0) {
|
|
||||||
unlink($fileSrc);
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
return $fileSrc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取一些公共的系统参数
|
* 获取一些公共的系统参数
|
||||||
* @param string|null $key
|
* @param string|null $key
|
||||||
@ -235,12 +212,12 @@ function system_name(?string $key = '')
|
|||||||
*/
|
*/
|
||||||
function get_date_by_time(?int $time = null)
|
function get_date_by_time(?int $time = null)
|
||||||
{
|
{
|
||||||
return date('Y-m-d h:i:s', time());
|
return date('Y-m-d h:i:s', $time);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_start_and_end_time_by_day($day = '')
|
function get_start_and_end_time_by_day($day = '')
|
||||||
{
|
{
|
||||||
$date = $day ?: date('Y-m-d', time());
|
$date = $day ?: date('Y-m-d');
|
||||||
$day_start_time = strtotime($date);
|
$day_start_time = strtotime($date);
|
||||||
//当天结束之间
|
//当天结束之间
|
||||||
$day_end_time = $day_start_time + 86400;
|
$day_end_time = $day_start_time + 86400;
|
||||||
@ -268,13 +245,27 @@ function url_to_path($url)
|
|||||||
return public_path() . trim(str_replace('/', DIRECTORY_SEPARATOR, $url));
|
return public_path() . trim(str_replace('/', DIRECTORY_SEPARATOR, $url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取本地文件的对外网络路径
|
||||||
|
* @param string $path
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function get_file_url(string $path)
|
||||||
|
{
|
||||||
|
if (!$path) return '';
|
||||||
|
if (!str_contains($path, 'http://') && !str_contains($path, 'https://')) {
|
||||||
|
return request()->domain() .'/'. path_to_url($path);
|
||||||
|
} else {
|
||||||
|
return path_to_url($path);
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 新增队列工作
|
* 新增队列工作
|
||||||
* @param $job
|
* @param $job
|
||||||
* @param $data
|
* @param $data
|
||||||
* @param $delay
|
* @param $delay
|
||||||
* @param $queue
|
* @param $queue
|
||||||
* @return void
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function create_job($job, $data = '', $delay = 0, $queue = null)
|
function create_job($job, $data = '', $delay = 0, $queue = null)
|
||||||
{
|
{
|
||||||
@ -309,7 +300,7 @@ function is_write($file)
|
|||||||
{
|
{
|
||||||
if (is_dir($file)) {
|
if (is_dir($file)) {
|
||||||
$dir = $file;
|
$dir = $file;
|
||||||
if ($fp = @fopen("$dir/test.txt", 'w')) {
|
if ($fp = @fopen("$dir/test.txt", 'wb')) {
|
||||||
@fclose($fp);
|
@fclose($fp);
|
||||||
@unlink("$dir/test.txt");
|
@unlink("$dir/test.txt");
|
||||||
$writeable = true;
|
$writeable = true;
|
||||||
@ -317,7 +308,7 @@ function is_write($file)
|
|||||||
$writeable = false;
|
$writeable = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($fp = @fopen($file, 'a+')) {
|
if ($fp = @fopen($file, 'ab+')) {
|
||||||
@fclose($fp);
|
@fclose($fp);
|
||||||
$writeable = true;
|
$writeable = true;
|
||||||
} else {
|
} else {
|
||||||
@ -364,9 +355,10 @@ function filter($string)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成编号
|
* 生成编号
|
||||||
* @param string $type
|
* @param string $prefix
|
||||||
* @param string $tag 业务标识 例如member_id ...
|
* @param string $tag 业务标识 例如member_id ...
|
||||||
* @return void
|
* @return string
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
function create_no(string $prefix = '', string $tag = '')
|
function create_no(string $prefix = '', string $tag = '')
|
||||||
{
|
{
|
||||||
@ -374,7 +366,7 @@ function create_no(string $prefix = '', string $tag = '')
|
|||||||
$machine_id = 2;
|
$machine_id = 2;
|
||||||
$snowflake = new Snowflake($data_center_id, $machine_id);
|
$snowflake = new Snowflake($data_center_id, $machine_id);
|
||||||
$id = $snowflake->generateId();
|
$id = $snowflake->generateId();
|
||||||
return $prefix.date('Ymd').$tag.(string)$id;
|
return $prefix.date('Ymd').$tag.$id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -391,6 +383,19 @@ function mkdirs($dir, $mode = 0777)
|
|||||||
return @mkdir($dir, $mode);
|
return @mkdir($dir, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建文件夹
|
||||||
|
* @param $dir
|
||||||
|
* @param $mode
|
||||||
|
* @return true
|
||||||
|
*/
|
||||||
|
function mkdirs_or_notexist($dir, $mode = 0777)
|
||||||
|
{
|
||||||
|
if (! is_dir($dir) && ! mkdir($dir, $mode, true) && ! is_dir($dir)) {
|
||||||
|
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 删除缓存文件使用
|
* 删除缓存文件使用
|
||||||
* @param $dir
|
* @param $dir
|
||||||
@ -426,7 +431,7 @@ function unique_random($len = 10)
|
|||||||
/**
|
/**
|
||||||
* 校验事件结果
|
* 校验事件结果
|
||||||
* @param $result
|
* @param $result
|
||||||
* @return void
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function check_event_result($result)
|
function check_event_result($result)
|
||||||
{
|
{
|
||||||
@ -441,8 +446,9 @@ function check_event_result($result)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 二维数组合并
|
* 二维数组合并
|
||||||
* @param $array1
|
* @param array $array1
|
||||||
* @param $array2
|
* @param array $array2
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
function array_merge2(array $array1, array $array2)
|
function array_merge2(array $array1, array $array2)
|
||||||
{
|
{
|
||||||
@ -450,7 +456,7 @@ function array_merge2(array $array1, array $array2)
|
|||||||
if (array_key_exists($array2_k, $array1)) {
|
if (array_key_exists($array2_k, $array1)) {
|
||||||
foreach ($array2_v as $array2_kk => $array2_vv) {
|
foreach ($array2_v as $array2_kk => $array2_vv) {
|
||||||
if (array_key_exists($array2_kk, $array1[$array2_k])) {
|
if (array_key_exists($array2_kk, $array1[$array2_k])) {
|
||||||
if (gettype($array2_vv) == 'array') {
|
if (is_array($array2_vv)) {
|
||||||
$array1[$array2_k][$array2_kk] = array_merge($array1[$array2_k][$array2_kk], $array2_vv);
|
$array1[$array2_k][$array2_kk] = array_merge($array1[$array2_k][$array2_kk], $array2_vv);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -577,7 +583,7 @@ function parse_sql($content = '', $string = false, $replace = [])
|
|||||||
$content = str_replace(["\r\n", "\r"], "\n", $content);
|
$content = str_replace(["\r\n", "\r"], "\n", $content);
|
||||||
$content = explode("\n", trim($content));
|
$content = explode("\n", trim($content));
|
||||||
// 循环处理每一行
|
// 循环处理每一行
|
||||||
foreach ($content as $key => $line) {
|
foreach ($content as $line) {
|
||||||
// 跳过空行
|
// 跳过空行
|
||||||
if ($line == '') {
|
if ($line == '') {
|
||||||
continue;
|
continue;
|
||||||
@ -591,12 +597,12 @@ function parse_sql($content = '', $string = false, $replace = [])
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 多行注释开始
|
// 多行注释开始
|
||||||
if (substr($line, 0, 2) == '/*') {
|
if (str_starts_with($line, '/*')) {
|
||||||
$comment = true;
|
$comment = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 多行注释结束
|
// 多行注释结束
|
||||||
if (substr($line, -2) == '*/') {
|
if (str_ends_with($line, '*/')) {
|
||||||
$comment = false;
|
$comment = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -703,7 +709,7 @@ function cache_remember(string $name = null, $value = '', $tag = null, $options
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目目录
|
* 项目目录
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function project_path() {
|
function project_path() {
|
||||||
return dirname(root_path()) . DIRECTORY_SEPARATOR;
|
return dirname(root_path()) . DIRECTORY_SEPARATOR;
|
||||||
@ -713,7 +719,7 @@ function project_path() {
|
|||||||
* 图片转base64
|
* 图片转base64
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param $is_delete 转换后是否删除原图
|
* @param $is_delete 转换后是否删除原图
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function image_to_base64(string $path, $is_delete = false) {
|
function image_to_base64(string $path, $is_delete = false) {
|
||||||
if (!file_exists($path)) return 'image not exist';
|
if (!file_exists($path)) return 'image not exist';
|
||||||
@ -725,13 +731,15 @@ function image_to_base64(string $path, $is_delete = false) {
|
|||||||
|
|
||||||
if ($is_delete) @unlink($path);
|
if ($is_delete) @unlink($path);
|
||||||
|
|
||||||
return "data:{$mime};base64,{$base64_data}";
|
return "data:$mime;base64,$base64_data";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取缩略图
|
* 获取缩略图
|
||||||
* @param $site_id
|
* @param $site_id
|
||||||
* @param $image
|
* @param $image
|
||||||
* @param $thumb_type
|
* @param string $thumb_type
|
||||||
|
* @param bool $is_throw_exception
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@ -739,9 +747,10 @@ function get_thumb_images($site_id, $image, $thumb_type = 'all', bool $is_throw_
|
|||||||
|
|
||||||
return (new CoreImageService())->thumb($site_id, $image, $thumb_type, $is_throw_exception);
|
return (new CoreImageService())->thumb($site_id, $image, $thumb_type, $is_throw_exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 版本号转整数 例如1.0.0=001.000.000=001000000=1000000
|
* 版本号转整数 例如1.0.0=001.000.000=001000000=1000000
|
||||||
* @param string $ver
|
* @param $version
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function version_to_int($version) {
|
function version_to_int($version) {
|
||||||
@ -761,14 +770,14 @@ function version_to_int($version) {
|
|||||||
function version_to_string($ver) {
|
function version_to_string($ver) {
|
||||||
if($ver > 999) {
|
if($ver > 999) {
|
||||||
if($ver > 999999) {
|
if($ver > 999999) {
|
||||||
$ver = $ver . "";
|
$ver .= "";
|
||||||
$v3 = (int) substr($ver, -3);
|
$v3 = (int) substr($ver, -3);
|
||||||
$v2 = (int) substr($ver, -6, 3);
|
$v2 = (int) substr($ver, -6, 3);
|
||||||
$v1 = (int) substr($ver, 0, strlen($ver) - 6);
|
$v1 = (int) substr($ver, 0, -6);
|
||||||
} else {
|
} else {
|
||||||
$ver = $ver . "";
|
$ver .= "";
|
||||||
$v3 = (int) substr($ver, -3);
|
$v3 = (int) substr($ver, -3);
|
||||||
$v2 = (int) substr($ver, 0, strlen($ver) - 3);
|
$v2 = (int) substr($ver, 0, -3);
|
||||||
$v1 = 0;
|
$v1 = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -778,3 +787,12 @@ function version_to_string($ver) {
|
|||||||
}
|
}
|
||||||
return "{$v1}.{$v2}.{$v3}";
|
return "{$v1}.{$v2}.{$v3}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测文件是否是本地图片
|
||||||
|
* @param string $file_path
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function check_file_is_remote(string $file_path){
|
||||||
|
return str_contains($file_path, 'https://') || str_contains($file_path, 'http://') || str_contains($file_path, '.com');
|
||||||
|
}
|
||||||
@ -32,13 +32,14 @@ class AddonDict
|
|||||||
// 执行成功
|
// 执行成功
|
||||||
const INSTALL_SUCCESS = 'success';
|
const INSTALL_SUCCESS = 'success';
|
||||||
// 执行失败
|
// 执行失败
|
||||||
CONST INSTALL_FAIL = 'fail';
|
const INSTALL_FAIL = 'fail';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 插件操作方式
|
* 插件操作方式
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getActionType(){
|
public static function getActionType()
|
||||||
|
{
|
||||||
return [
|
return [
|
||||||
self::INSTALL => get_lang('dict_addon.install'),
|
self::INSTALL => get_lang('dict_addon.install'),
|
||||||
self::UNINSTALL => get_lang('dict_addon.uninstall'),
|
self::UNINSTALL => get_lang('dict_addon.uninstall'),
|
||||||
@ -50,7 +51,8 @@ class AddonDict
|
|||||||
* 状态
|
* 状态
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getStatus(){
|
public static function getStatus()
|
||||||
|
{
|
||||||
return [
|
return [
|
||||||
self::ON => get_lang('dict_addon.status_on'),//展示
|
self::ON => get_lang('dict_addon.status_on'),//展示
|
||||||
self::OFF => get_lang('dict_addon.status_off'),//隐藏
|
self::OFF => get_lang('dict_addon.status_off'),//隐藏
|
||||||
|
|||||||
@ -20,24 +20,23 @@ namespace app\dict\applet;
|
|||||||
class AppletlDict
|
class AppletlDict
|
||||||
{
|
{
|
||||||
|
|
||||||
const ON = '1';//草稿
|
public const ON = '1';
|
||||||
//微信公众号
|
|
||||||
const OFF = '2';
|
|
||||||
|
|
||||||
const PUBLISHED = '3';
|
public const OFF = '2';
|
||||||
|
|
||||||
|
|
||||||
const DOWNLOAD = 'download';//下载
|
public const DOWNLOAD = 'download';//下载
|
||||||
const UPGRADE = 'upgrade';//升级
|
public const UPGRADE = 'upgrade';//升级
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序版本状态
|
* 小程序版本状态
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getStatus(){
|
public static function getStatus()
|
||||||
$data = [
|
{
|
||||||
|
return [
|
||||||
self::ON => get_lang('dict_applet.channel_weapp'),//启用
|
self::ON => get_lang('dict_applet.channel_weapp'),//启用
|
||||||
self::OFF => get_lang('dict_applet.channel_wechat'),//下架
|
self::OFF => get_lang('dict_applet.channel_wechat'),//下架
|
||||||
];
|
];
|
||||||
return $data;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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