Skip to content

关于accessToken出现Failed to cache access token.的问题 #1450

@mikeshoes

Description

@mikeshoes

我用的环境

PHP 版本:7.1
overtrue/wechat 版本:4.1.16
是否使用了框架?框架名称:larvarl 5.5.44

第一次获取accessToken缓存throw exception

  $ok = $this->getCache()->set($this->getCacheKey(), [
        $this->tokenKey => $token,
        'expires_in' => $lifetime,
    ], $lifetime - $this->safeSeconds);

    if (!$ok) {
        throw new RuntimeException('Failed to cache access token.');
    }

关于此段代码,查阅larval 源码发现 如果使用larval 自己的缓存 此处是没有返回值得即ok永远是null
然后就抛出异常了,请查阅谢谢。

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions