真人素材库授权BUG修复
This commit is contained in:
@@ -136,11 +136,19 @@ class ArkPrivateAssetClient:
|
|||||||
10,
|
10,
|
||||||
60,
|
60,
|
||||||
)
|
)
|
||||||
api_info = {action.value: ApiInfo("POST", "/", f"Action={action.value}&Version={ARK_PRIVATE_PORTRAIT_VERSION}", {}, {})}
|
# volcengine SDK 的 ApiInfo.query 必须是 dict,不能传 "Action=xxx&Version=xxx" 字符串。
|
||||||
|
# 否则 Service.merge() 会按 dict 下标读取字符串,触发:
|
||||||
|
# TypeError: string indices must be integers, not 'str'。
|
||||||
|
api_info = {
|
||||||
|
action.value: ApiInfo(
|
||||||
|
"POST",
|
||||||
|
"/",
|
||||||
|
{"Action": action.value, "Version": ARK_PRIVATE_PORTRAIT_VERSION},
|
||||||
|
{},
|
||||||
|
{},
|
||||||
|
)
|
||||||
|
}
|
||||||
service = Service(service_info, api_info)
|
service = Service(service_info, api_info)
|
||||||
try:
|
|
||||||
raw = service.json(action.value, {}, json.dumps(payload, ensure_ascii=False, separators=(",", ":")))
|
|
||||||
except TypeError:
|
|
||||||
raw = service.json(action.value, {}, payload)
|
raw = service.json(action.value, {}, payload)
|
||||||
|
|
||||||
resp = self._normalize_response(raw)
|
resp = self._normalize_response(raw)
|
||||||
|
|||||||
Reference in New Issue
Block a user