|
@@ -145,10 +145,12 @@ class VoicePromptView(View):
|
|
|
uid = voice_qs[0].uid
|
|
|
device_qs = Device_Info.objects.filter(UID=uid, userID=userID)
|
|
|
if device_qs.exists():
|
|
|
+ channel = voice_qs[0].channel
|
|
|
+ filename = voice_qs[0].filename
|
|
|
voice_qs.delete()
|
|
|
auth = oss2.Auth(OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET)
|
|
|
bucket = oss2.Bucket(auth, 'http://oss-cn-shenzhen.aliyuncs.com', 'ansjer-static-resources')
|
|
|
- obj = 'voice_prompt/{uid}/{channel}/'.format(uid=uid, channel=voice_qs[0].channel) + voice_qs[0].filename
|
|
|
+ obj = 'voice_prompt/{uid}/{channel}/'.format(uid=uid, channel=channel) + filename
|
|
|
bucket.delete_object(obj)
|
|
|
return response.json(0)
|
|
|
else:
|