[更新]修复本地APi授权失败

This commit is contained in:
Anyon 2019-07-17 11:30:02 +08:00
parent 6b3a1bc580
commit c2ad6826a7

View File

@ -124,7 +124,7 @@ class WechatService extends \We
*/
public static function instance($name, $type = 'WeChat', $config = [])
{
if (in_array($type, ['WePay', 'AliPay']) || "{$type}{$name}" === 'WeChatPay') {
if (self::getType() === 'api' || in_array($type, ['WePay', 'AliPay']) || "{$type}{$name}" === 'WeChatPay') {
if (class_exists($class = "\\{$type}\\" . ucfirst(strtolower($name)))) {
return new $class(empty($config) ? self::config() : $config);
} else {