Commit 7dffab20 authored by Davve's avatar Davve

修改图片上传类型

parent 24fed907
...@@ -18,7 +18,7 @@ class FileUpload(APIView): ...@@ -18,7 +18,7 @@ class FileUpload(APIView):
def post(self, request): def post(self, request):
image = request.FILES.get('file') image = request.FILES.get('file')
data = image.read() data = image.read()
full_image_url = upload(data, img_type=self.args_post.get('type')) + '-w' full_image_url = upload(data, img_type=int(self.args_post.get('type'))) + '-w'
return { return {
'file_url': full_image_url 'file_url': full_image_url
} }
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
default: '' default: ''
}, },
type: { type: {
type: String, type: Number,
default: '' default: ''
} }
}, },
......
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
}, },
tempRoute: {}, tempRoute: {},
dataObj: { token: 'fahsdfiwqehfkajsdhfjkasdhfkj', key: 'fasdhfkasdhfkjashdfkjhasdfads' }, dataObj: { token: 'fahsdfiwqehfkajsdhfjkasdhfkj', key: 'fasdhfkasdhfkjashdfkjhasdfads' },
type: '1' // 图片类型 type: 1 // 图片类型
} }
}, },
computed: { computed: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment