虚拟退款获取 access_token 时显式导入 cache,避免未导入报错。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9507,6 +9507,7 @@ class KefuPlatformRefundView(APIView):
|
|||||||
|
|
||||||
def _get_access_token(self):
|
def _get_access_token(self):
|
||||||
"""获取 access_token,带缓存"""
|
"""获取 access_token,带缓存"""
|
||||||
|
from django.core.cache import cache
|
||||||
cache_key = "virtual_payment_access_token"
|
cache_key = "virtual_payment_access_token"
|
||||||
access_token = cache.get(cache_key)
|
access_token = cache.get(cache_key)
|
||||||
if not access_token:
|
if not access_token:
|
||||||
|
|||||||
Reference in New Issue
Block a user