This commit is contained in:
yanran200730
2022-06-17 16:24:32 +08:00
parent b383a89d9c
commit 5371349eaa
2 changed files with 4 additions and 12 deletions

View File

@@ -174,7 +174,7 @@
}, },
record () { record () {
this.duration = 0 this.time = 60
this.recorder = Recorder({ this.recorder = Recorder({
type: 'mp3', type: 'mp3',
sampleRate: 16000, sampleRate: 16000,
@@ -201,16 +201,6 @@
}, 1000) }, 1000)
}, },
blobToDataURI(blob) {
return new Promise((resolve) => {
var reader = new FileReader()
reader.readAsDataURL(blob)
reader.onload = function (e) {
resolve(e.target.result)
}
})
},
play (url, index) { play (url, index) {
if (this.currIndex === index) { if (this.currIndex === index) {
this.innerAudioContext.destroy() this.innerAudioContext.destroy()
@@ -275,11 +265,13 @@
this.isShow = false this.isShow = false
}).catch(() => { }).catch(() => {
this.isShow = false this.isShow = false
uni.hideLoading()
}) })
} else { } else {
this.isShow = false this.isShow = false
} }
}).catch(() => { }).catch(() => {
uni.hideLoading()
this.isShow = false this.isShow = false
}) })

View File

@@ -23,8 +23,8 @@ instance.interceptors.request.use(config => {
}) })
instance.interceptors.response.use(res => { instance.interceptors.response.use(res => {
uni.hideLoading()
if (res.data) { if (res.data) {
uni.hideLoading()
if (res.data.access_token) { if (res.data.access_token) {
return res.data return res.data
} }