添加chapter和lesson
This commit is contained in:
10
Html/apps/services/cos_service.py
Normal file
10
Html/apps/services/cos_service.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from flask import current_app
|
||||
|
||||
def upload_file(rb_file, file_name):
|
||||
cos_client = current_app.extensions["cos_client"]
|
||||
cos_client.put_object(
|
||||
Bucket=current_app.config["TENCENT_COS"]["bucket"],
|
||||
Body=rb_file,
|
||||
Key=file_name,
|
||||
)
|
||||
return f"https://{current_app.config['TENCENT_COS']['bucket']}.cos.{current_app.config['TENCENT_COS']['region']}.myqcloud.com/{file_name}"
|
||||
Reference in New Issue
Block a user