fix: use WeChat profile authorization login
这个提交包含在:
@@ -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) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户