WechatMiniprogramService.php 750 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Modules\Manage\Services;
  3. use Illuminate\Support\Facades\Redis;
  4. class WechatMiniprogramService
  5. {
  6. /**
  7. * 微信短剧提审appid
  8. * @return string
  9. */
  10. public static function getDuanjuCheckAppid() {
  11. return config('manage.miniprogram.duanjuWechatCheck.appid');
  12. }
  13. /**
  14. * 微信短剧提审小程序 accessToken
  15. * @param string|null $appid
  16. * @return string
  17. */
  18. public static function getDuanjuCheckAccessToken($appid=null) {
  19. $checkAppid = $appid ?: self::getDuanjuCheckAppid();
  20. return Redis::get(self::getAccessTokenRedisKey($checkAppid));
  21. }
  22. private static function getAccessTokenRedisKey($appid) {
  23. return 'dj.miniWechat.at.' . $appid;
  24. }
  25. }