支持登录网易云账号

This commit is contained in:
qier222 2020-10-17 00:13:20 +08:00
parent 861125ea8c
commit 5f0ef06786
15 changed files with 734 additions and 153 deletions

42
src/api/auth.js Normal file
View file

@ -0,0 +1,42 @@
import request from "@/utils/request";
export function loginWithPhone(params) {
//必选参数 :
// phone: 手机号码
// password: 密码
// 可选参数 :
// countrycode: 国家码用于国外手机号登录例如美国传入1
// md5_password: md5加密后的密码,传入后 password 将失效
return request({
url: "/login/cellphone",
method: "post",
params,
});
}
export function loginWithEmail(params) {
// 必选参数 :
// email: 163 网易邮箱
// password: 密码
// 可选参数 :
// md5_password: md5加密后的密码,传入后 password 将失效
return request({
url: "/login",
method: "post",
params,
});
}
export function loginRefresh() {
return request({
url: "/login/refresh",
method: "post",
});
}
export function logout() {
return request({
url: "/logout",
method: "post",
});
}