Files
spring-festival-greetings/utils/login.js
2026-01-09 11:24:40 +08:00

31 lines
577 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export const wxLogin = () => {
return new Promise((resolve, reject) => {
wx.login({
success: res => {
if (res.code) {
resolve(res.code)
} else {
reject('登录失败code为空')
}
},
fail: err => {
reject(err)
}
})
})
}
export const wxGetUserProfile = () => {
return new Promise((resolve, reject) => {
wx.getUserProfile({
desc: '用于完善用户信息',
success: res => {
resolve(res)
},
fail: err => {
reject(err)
}
})
})
}