handle register and poster and fix bugs
This commit is contained in:
+13
-5
@@ -1,21 +1,29 @@
|
||||
import api from "./api";
|
||||
import Cookies from "universal-cookie";
|
||||
|
||||
export const request = {
|
||||
auth: (grant_type, client_id, client_secret, username, password) =>
|
||||
sendCode: (mobile_number) =>
|
||||
api.post(
|
||||
"api/v1/user/auth",
|
||||
{ mobile_number },
|
||||
{
|
||||
headers: {
|
||||
Authorization: "",
|
||||
},
|
||||
}
|
||||
),
|
||||
getToken: (grant_type, client_id, client_secret, mobile_number, code) =>
|
||||
api.post(
|
||||
"oauth/token",
|
||||
{
|
||||
grant_type,
|
||||
client_id,
|
||||
client_secret,
|
||||
username,
|
||||
password,
|
||||
mobile_number,
|
||||
code,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
Authorization: "",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
}
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user