WorkController.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\api\v1\work;
  12. use app\Request;
  13. use crmeb\services\wechat\Work;
  14. /**
  15. * 企业微信
  16. * Class WorkController
  17. * @package app\controller\api\v1\work
  18. */
  19. class WorkController
  20. {
  21. /**
  22. * 获取企业微信配置
  23. * @param Request $request
  24. * @return mixed
  25. * @throws \Psr\SimpleCache\InvalidArgumentException
  26. */
  27. public function config(Request $request)
  28. {
  29. return response(['status' => 200, 'msg' => 'ok', 'data' => Work::getJsSDK($request->get('url', ''))], 200, [], 'json');
  30. }
  31. /**
  32. * 获取应用配置
  33. * @param Request $request
  34. * @return \think\Response
  35. * @throws \Psr\SimpleCache\InvalidArgumentException
  36. */
  37. public function agentConfig(Request $request)
  38. {
  39. return response(['status' => 200, 'msg' => 'ok', 'data' => Work::getAgentConfig($request->get('url', ''))], 200, [], 'json');
  40. }
  41. }