返回 map
This commit is contained in:
		@@ -97,12 +97,12 @@ def get_image_type(type:str, id:str, version:str, ext:str):
 | 
			
		||||
            if os.path.exists(img_path):
 | 
			
		||||
                return Response(content=open(img_path, 'rb').read(), media_type=f"image/{ext}")
 | 
			
		||||
            if type == 'ad' or type == 'article' or type == 'article_attribute':
 | 
			
		||||
                count = cursor.execute(f"SELECT * FROM `web_{type}` WHERE `id`={id}")
 | 
			
		||||
                count = cursor.execute(f"SELECT image FROM `web_{type}` WHERE `id`={id}")
 | 
			
		||||
                img = cursor.fetchone()
 | 
			
		||||
                if img is None:
 | 
			
		||||
                    print('图片不存在:', count)
 | 
			
		||||
                    return Response('图片不存在', status_code=404)
 | 
			
		||||
                url = img['image']
 | 
			
		||||
                url = img[0]
 | 
			
		||||
            elif type == 'url':
 | 
			
		||||
                id = unquote(id, 'utf-8')
 | 
			
		||||
                id = id.replace(' ','+')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user