| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import {
- useUserServer
- } from '@/config/server-info'
- import axios from '@/plugins/axios'
- export function register ({ name, email, emailCode, phone, phoneCode, password }) {
- const data = {
- name,
- email,
- emailCode,
- phone,
- phoneCode,
- password
- }
- return axios
- .post(useUserServer('/register'), data)
- .then(res => res.data)
- }
- export function loginByEmail ({ email, password }) {
- const data = {
- username: email,
- password
- }
- return axios
- .post(useUserServer('/login/email'), data)
- .then(res => res.data)
- }
- export function logout () {
- return axios
- .post(useUserServer('/logout'))
- .then(res => {})
- }
- export function modifyUser ({ name }) {
- const data = {
- name
- }
- return axios
- .put(useUserServer(), data)
- .then(res => res.data)
- }
- export function resetPasswordByEmail({ email, code, password }) {
- const data = {
- username: email,
- code,
- password
- }
- return axios
- .put(useUserServer('/resetPassword/email'), data)
- .then(res => {})
- }
- export function getUserInfo () {
- return axios
- .get(useUserServer())
- .then(res => res.data)
- }
|