123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- /**
- * 授权 API
- */
- import {
- http
- } from '../request/main.js'
- /**
- * 用户登录 - 姓名登录码
- *
- * @returns {Promise}
- */
- export function loginByNameCode(name, code, wx_code) {
- return http.post('/user/loginByNameCode', {
- name,
- code,
- wx_code
- }, {
- muteLogin: true
- })
- }
- /**
- * 用户登录 - 编号登录码
- *
- * @returns {Promise}
- */
- export function loginByNumberCode(number, code, wx_code) {
- return http.post('/user/loginByNumberCode', {
- number,
- code,
- wx_code
- }, {
- muteLogin: true
- })
- }
- /**
- * 用户登录 - 手机验证码
- *
- * @returns {Promise}
- */
- export function loginByPhoneCaptcha(phone, captcha, wx_code) {
- return http.post('/user/loginByPhoneCaptcha', {
- phone,
- captcha,
- wx_code
- }, {
- muteLogin: true
- })
- }
- /**
- * 用户登录 - 微信快捷登录
- *
- * @returns {Promise}
- */
- export function loginByWechatPhone(encrypted_data, iv, code, wx_code) {
- return http.post('/user/loginByWechatPhone', {
- encrypted_data,
- iv,
- code,
- wx_code
- }, {
- muteLogin: true
- })
- }
- /**
- * 小程序自动登录
- *
- * @returns {Promise}
- */
- export function wechatAutoLogin(wx_code) {
- return http.post('/user/wechatAutoLogin', {
- wx_code
- }, {
- muteLogin: true
- })
- }
- /**
- * 发送手机验证吗
- *
- * @returns {Promise}
- */
- export function sendPhoneCaptcha(phone, wx_code, muteLogin) {
- return http.post('/user/sendPhoneCaptcha', {
- phone,
- wx_code
- }, {
- muteLogin: muteLogin
- })
- }
- /**
- * 用户登出
- *
- * @returns {Promise}
- */
- export function logout() {
- return http.post('/user/logout')
- }
- /**
- * 更新用户信息
- *
- * @returns {Promise}
- */
- export function updateUserInfo(avatar_url) {
- return http.post('/user/updateUserInfo', {
- avatar_url
- })
- }
- /**
- * 获取用户信息
- *
- * @returns {Promise}
- */
- export function getUserInfo() {
- return http.post('/user/getUserInfo')
- }
- /**
- * 修改登录码
- *
- * @returns {Promise}
- */
- export function changeCode(oldCode, newCode) {
- return http.post('/user/changeCode', {
- oldCode,
- newCode
- })
- }
- /**
- * 修改手机号
- *
- * @returns {Promise}
- */
- export function changePhone(phone, captcha) {
- return http.post('/user/changePhone', {
- phone,
- captcha
- })
- }
- /**
- * 修改手机号 - 授权微信手机号
- *
- * @returns {Promise}
- */
- export function changeWechatPhone(encrypted_data, iv, code, wx_code) {
- return http.post('/user/changeWechatPhone', {
- encrypted_data,
- iv,
- code,
- wx_code
- })
- }
|