| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\controller\api;
- use app\extra\basic\Base;
- use app\extra\dyLife\data\BaseData;
- use app\middleware\AuthMiddleware;
- use LinFly\Annotation\Attributes\Route\Controller;
- use LinFly\Annotation\Attributes\Route\GetMapping;
- use LinFly\Annotation\Attributes\Route\Middleware;
- use support\Request;
- use support\Response;
- use Webman\RedisQueue\Redis;
- #[Controller("/dy/home"),Middleware(AuthMiddleware::class)]
- class Home extends Base
- {
- /**
- * @var array|string[]
- */
- protected array $noNeedLogin = ["getHomeData"];
- #[GetMapping("data")]
- public function getHomeData(Request $request): Response
- {
- try {
- $resp = (new BaseData)->config([
- "appid" => sConf("wechat.appid"),
- "secret" => sConf("wechat.secret"),
- "account" => sConf("wechat.shop_id"),
- ])->token()->getStoreCategoryTemplate(6005001);
- return $this->success("ok",$resp);
- } catch (\Throwable $th) {
- return error($th->getMessage());
- }
- }
- }
|