locky преди 2 години
родител
ревизия
fe75a5f077
променени са 2 файла, в които са добавени 2 реда и са изтрити 4 реда
  1. 2 3
      Controller/UserManger.py
  2. 0 1
      Object/ContentSecurityObject.py

+ 2 - 3
Controller/UserManger.py

@@ -170,6 +170,8 @@ class perfectUserInfoView(TemplateView):
                 config=botocore.client.Config(signature_version='s3v4'),
             )
             Key = userID + '/' + userIcon.name
+            aws_s3_client.put_object(Bucket=AVATAR_BUCKET, Key=Key, Body=userIcon)
+            userIconPath = userID + '/' + userIcon.name
 
             #  测试/国内服,验证头像是否合规
             if CONFIG_INFO == CONFIG_CN or CONFIG_INFO == CONFIG_TEST:
@@ -182,9 +184,6 @@ class perfectUserInfoView(TemplateView):
                 if not legal:
                     return response.json(106)
 
-            aws_s3_client.put_object(Bucket=AVATAR_BUCKET, Key=Key, Body=userIcon)
-            userIconPath = userID + '/' + userIcon.name
-
         if userContent:
             dataValid = json.loads(userContent)
             if 'userID' and 'password' and 'is_superuser' in dataValid.keys():

+ 0 - 1
Object/ContentSecurityObject.py

@@ -70,7 +70,6 @@ class ContentSecurity:
         runtime = util_models.RuntimeOptions()
         res = client.image_moderation_with_options(image_moderation_request, runtime)
         print(res)
-        LOGGER.info('图片审核响应内容:{}'.format(res))
         if res.status_code != 200:
             return False
         # 获取审核结果