user.js 1.62 KB
import http from './interface'


//通过用户名获取可用的仓库列表
export const getWarehouseByUserCode = (data) => {
    return http.request({
        url: '/system/warehouse/getWarehouseByUserCode',
		method:'get',
        data,
    })
}

//登录
export const login = (data) => {
    return http.request({
        url: '/mobile/login',
		method:'POST',
        data,
    })
}

//退出登录
export const logout = () => {
    return http.request({
        url: '/home/v1/logout',
		method:'GET',
    })
}

//使用手机号注册账户
export const phoneReg = (data) => {
    return http.request({
        url: '/home/v1/reg/phone',
		method:'POST',
        data,
    })
}


/**
 * 修改密码
 * oldPwd	原密码
 * newPwd	新密码
 */
export const updatePassword = (data) => {
    return http.request({
        url: '/home/v1/password/update',
		method:'POST',
        data,
    })
}

/**
 * 密码验证
 * oldPwd	原密码
 * newPwd	新密码
 */
export const passwordValidation = (data) => {
    return http.request({
        url: '/home/v1/password/validation',
		method:'POST',
        data,
    })
}

/**
 * 检查是否登录
 * oldPwd	原密码
 * newPwd	新密码
 */
export const hasLogin = () => {
    return http.request({
        url: '/home/v1/user/islogin',
		method:'GET'
    })
}


/**
 * 更新手机号
 * phone	手机号
 * code		手机验证码
 */
export const updatePhone = (data) =>{
	return http.request({
	    url: '/home/v1/user/phone/update',
		method:'POST',
	    data,
	})
}

export default {
	getWarehouseByUserCode,
	login,
	logout,
	phoneReg,
	updatePassword,
	passwordValidation,
	updatePhone,
	hasLogin
}