Browse Source

打印图片链接及响应

locky 2 năm trước cách đây
mục cha
commit
ee767e40db
2 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 2 1
      Controller/UserManger.py
  2. 1 0
      Object/ContentSecurityObject.py

+ 2 - 1
Controller/UserManger.py

@@ -11,7 +11,7 @@ from django.views.decorators.csrf import csrf_exempt
 from django.views.generic import TemplateView, View
 
 from Ansjer.config import BASE_DIR, ACCESS_KEY_ID, SECRET_ACCESS_KEY, REGION_NAME, AVATAR_BUCKET, CONFIG_INFO, \
-    CONFIG_CN, CONFIG_TEST
+    CONFIG_CN, CONFIG_TEST, LOGGER
 from Ansjer.config import SERVER_DOMAIN
 from Model.models import Role, Device_User, UserOauth2Model, UserExModel, CountryLanguageModel, LanguageModel, App_Info, \
     IcloudUseDetails
@@ -178,6 +178,7 @@ class perfectUserInfoView(TemplateView):
                 params = {'Bucket': AVATAR_BUCKET, 'Key': Key}
                 image_url = aws_s3_client.generate_presigned_url('get_object', Params=params)
                 service = 'profilePhotoCheck'
+                LOGGER.info('头像链接:{}'.format(image_url))
                 service_dict = {'imageUrl': image_url}
                 service_parameters = json.dumps(service_dict)
                 legal = ContentSecurity().image_review(service, service_parameters)

+ 1 - 0
Object/ContentSecurityObject.py

@@ -70,6 +70,7 @@ 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
         # 获取审核结果