install and handle casle & prevent page dashboard & handle register and code verfication & get data in clinics page
This commit is contained in:
@@ -1,30 +1,31 @@
|
||||
import api from "./api";
|
||||
|
||||
export const request = {
|
||||
sendCode: (mobile_number) =>
|
||||
sendCode: (mobile, captcha_token) =>
|
||||
api.post(
|
||||
"api/v1/user/auth",
|
||||
{ mobile_number },
|
||||
"api/v1/user/send-code",
|
||||
{
|
||||
mobile,
|
||||
captcha_token,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
Authorization: "",
|
||||
withCredentials: true,
|
||||
},
|
||||
}
|
||||
),
|
||||
getToken: (grant_type, client_id, client_secret, mobile_number, code) => {
|
||||
getToken: (grant_type, client_id, client_secret, uuid, code) => {
|
||||
const formData = new URLSearchParams();
|
||||
formData.append("grant_type", grant_type);
|
||||
formData.append("client_id", client_id);
|
||||
formData.append("client_secret", client_secret);
|
||||
formData.append("mobile_number", mobile_number);
|
||||
formData.append("uuid", uuid);
|
||||
formData.append("code", code);
|
||||
|
||||
return api.post("oauth/token", formData, {
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
Authorization: "",
|
||||
withCredentials: true,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user