You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
550 B
18 lines
550 B
4 months ago
|
from WxMini.Utils.OssUtil import get_sts_token, upload_to_oss
|
||
|
|
||
|
# 测试调用
|
||
|
if __name__ == "__main__":
|
||
|
# 获取 STS 临时凭证
|
||
|
sts_token = get_sts_token()
|
||
|
# print(f"AccessKeyId: {sts_token['AccessKeyId']}")
|
||
|
# print(f"AccessKeySecret: {sts_token['AccessKeySecret']}")
|
||
|
# print(f"SecurityToken: {sts_token['SecurityToken']}")
|
||
|
|
||
|
# 上传文件到 OSS
|
||
|
result = upload_to_oss(
|
||
|
sts_token['AccessKeyId'],
|
||
|
sts_token['AccessKeySecret'],
|
||
|
sts_token['SecurityToken']
|
||
|
)
|
||
|
print(result)
|