user.service.js 482 字节
Newer Older
yma16's avatar
yma16 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import axios from 'axios'

export function loginUser(data) {
    console.log('用户登录service!', data)
    let baseurl='http://yongma16.xyz/user/login/'
    let res=null
    axios.post(baseurl, data).then(o => {
        res=o
        console.log('成功认证', res)
        localStorage.setItem("yma16siteUserInfoName",res.name)
        localStorage.setItem("yma16siteUserInfoPwd",res.password)
    }).catch(r=>{
        console.log('登录失败!',r)
    })
    return res
}