import request from '@/utils/request' // 登录方法 test git export function login(username, password, code, uuid) { const data = { username, password, code, uuid } return request({ url: '/auth/login', method: 'post', data: data }) } // 注册方法 export function register(data) { return request({ url: '/register', headers: { isToken: false }, method: 'post', data: data }) } // 获取用户详细信息 export function getInfo() { return request({ url: '/system/user/getInfo', method: 'get' }).then(res => { try { if (!Array.isArray(res.pharmacyList) || res.pharmacyList.length === 0) { res.pharmacyList = [{id: 18, name: '默认药房'}]; } } catch (err) {} return res; }); } // 退出方法 export function logout() { return request({ url: '/auth/logout', method: 'delete' }) } // 获取验证码 export function getCodeImg() { return request({ url: '/code', method: 'get', timeout: 20000 }) } //忘记密码 export function forgetPwd(code, phone, pwd, password) { const data = { code, phone, pwd, password } return request({ url: '/forgetPwd', method: 'post', data: data }) } //发送验证码 export function sendCode(data) { return request({ url: `/sendCode?phone=${data}`, method: 'get', }) }