fix: WeChat login Content-Type header, ASR tiny model, re-upload mini-program v1.0.11

This commit is contained in:
yuzhiran
2026-06-15 10:00:02 +08:00
parent 4fa620f0a2
commit 18c50726cd
22 changed files with 311 additions and 128 deletions
+17 -4
View File
@@ -286,12 +286,25 @@ const doWxLogin = async () => {
// #ifdef MP-WEIXIN
wxLoading.value = true
try {
const { code } = await uni.login()
const res = await uni.request({ url: api('/user/wx-login'), method: 'POST', data: { code } })
const wxResp = await uni.login()
console.log('[wxLogin] uni.login success:', JSON.stringify(wxResp).slice(0, 300))
const { code, errMsg } = wxResp
if (!code) { console.error('[wxLogin] no code:', errMsg); showToast('获取微信凭证失败'); return }
const res = await uni.request({
url: api('/user/wx-login'), method: 'POST',
header: { 'Content-Type': 'application/json' },
data: { code },
})
console.log('[wxLogin] server response:', res.statusCode, JSON.stringify(res.data).slice(0, 500))
if (res.statusCode === 200 && res.data?.token) {
loginSuccess(res.data)
} else { showToast('微信登录失败') }
} catch { showToast('微信登录失败') }
} else {
showToast(res.data?.message || `登录失败(${res.statusCode})`)
}
} catch (e) {
console.error('[wxLogin] error:', JSON.stringify(e).slice(0, 500))
showToast('微信登录失败')
}
finally { wxLoading.value = false }
// #endif
}