Skip to content

Commit

Permalink
图欧君短链生成器-v4.0.1 优化 json 文件,更易读
Browse files Browse the repository at this point in the history
  • Loading branch information
zkeq committed Feb 18, 2022
1 parent 0359f57 commit a052cb1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python-CLI/main_oss_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def oss_config_init():
# 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录RAM控制台创建RAM账号。
_config_dict = {'AK': AK, 'SK': SK, 'BUCKET_NAME': BUCKET_NAME, 'Endpoint': Endpoint}
with open('oss_config.json', 'w', encoding='utf-8') as f:
config_file = json.dumps(_config_dict)
f.write(config_file)
json.dump(_config_dict, f, indent=2, ensure_ascii=False)
return _config_dict


Expand Down Expand Up @@ -66,7 +65,7 @@ def read_json(file_name):
# 写入json文件
def write_json(file_name, _data):
with open(file_name, 'w+', encoding='utf-8') as f:
json.dump(_data, f, ensure_ascii=False)
json.dump(_data, f, indent=2, ensure_ascii=False)
bucket.put_object_from_file(file_name, file_name)


Expand Down

1 comment on commit a052cb1

@vercel
Copy link

@vercel vercel bot commented on a052cb1 Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.