fix: use WeChat profile authorization login

这个提交包含在:
Guoguo
2026-04-28 23:00:13 +08:00
父节点 444c91c0b0
当前提交 a1b189483f
修改 4 个文件,包含 1 行新增54 行删除
-25
查看文件
@@ -65,31 +65,6 @@ Page({
})
},
uploadAvatar: function (filePath) {
var ext = 'jpg'
var match = String(filePath).match(/\.([a-zA-Z0-9]+)$/)
if (match && match[1]) ext = match[1].toLowerCase()
var contentType = ext === 'png' ? 'image/png' : 'image/jpeg'
return http.post('/api/v1/user/avatar/upload-url', {
ext: ext,
content_type: contentType
}).then(function (data) {
return new Promise(function (resolve, reject) {
wx.uploadFile({
url: data.upload_url,
filePath: filePath,
name: 'file',
header: { 'Content-Type': contentType },
success: function (res) {
if (res.statusCode >= 200 && res.statusCode < 300) resolve(data.public_url)
else reject({ message: '头像上传失败' })
},
fail: function () { reject({ message: '头像上传失败' }) }
})
})
})
},
onGetPhoneNumber: function (e) {
var self = this
if (!e.detail || !e.detail.code) {