31 lines
674 B
JavaScript
31 lines
674 B
JavaScript
import request from '@/api/http/client'
|
|
|
|
/**
|
|
* 发送短信验证码。
|
|
* @param {string} mobile 手机号
|
|
*/
|
|
export function sendSmsCode(mobile) {
|
|
return request.post('/auth/sms-code', { mobile }, { needAuth: false })
|
|
}
|
|
|
|
/**
|
|
* 手机号 + 验证码登录。
|
|
*/
|
|
export function loginByMobile(mobile, code) {
|
|
return request.post('/auth/mobile-login', { mobile, code }, { needAuth: false })
|
|
}
|
|
|
|
/**
|
|
* 微信登录。
|
|
*/
|
|
export function loginByWechat(loginCode) {
|
|
return request.post('/auth/wechat-login', { code: loginCode }, { needAuth: false })
|
|
}
|
|
|
|
/**
|
|
* 获取当前用户信息。
|
|
*/
|
|
export function getUserProfile() {
|
|
return request.get('/user/profile')
|
|
}
|