new files
This commit is contained in:
53
pro_v3.5.1/app/controller/admin/v1/wechat/Menus.php
Normal file
53
pro_v3.5.1/app/controller/admin/v1/wechat/Menus.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\v1\wechat;
|
||||
|
||||
|
||||
use app\controller\admin\AuthController;
|
||||
use app\services\wechat\WechatMenuServices;
|
||||
use think\annotation\Inject;
|
||||
|
||||
/**
|
||||
* 微信菜单 控制器
|
||||
* Class Menus
|
||||
* @package app\admin\controller\wechat
|
||||
*/
|
||||
class Menus extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var WechatMenuServices
|
||||
*/
|
||||
#[Inject]
|
||||
protected WechatMenuServices $services;
|
||||
|
||||
/**
|
||||
* 获取菜单
|
||||
* @return mixed
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$menus = $this->services->getWechatMenu();
|
||||
return $this->success(compact('menus'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存菜单
|
||||
* @return mixed
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$buttons = request()->post('button/a', []);
|
||||
if (!count($buttons)) return $this->fail('请添加至少一个按钮');
|
||||
$this->services->saveMenu($buttons);
|
||||
return $this->success('修改成功!');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user