mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 14:51:06 +03:30
send Api Ok
This commit is contained in:
+31
-3
@@ -21,7 +21,7 @@ const UserService = {
|
||||
login: async function(cell_number, password) {
|
||||
const requestData = {
|
||||
method: 'post',
|
||||
url: "login",
|
||||
url: "/login",
|
||||
data: {
|
||||
cell_number,
|
||||
password,
|
||||
@@ -57,7 +57,7 @@ const UserService = {
|
||||
forgotPassword: async function(cell_number) {
|
||||
const requestData = {
|
||||
method: 'post',
|
||||
url: "/forgotPassword",
|
||||
url: "forgotPassword",
|
||||
data: {
|
||||
cell_number,
|
||||
},
|
||||
@@ -70,7 +70,35 @@ const UserService = {
|
||||
try {
|
||||
const response = await ApiService.customRequest(requestData);
|
||||
ApiService.setHeader();
|
||||
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw new AuthenticationError(error.response.status, error.response.data.detail);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Login the user and store the access token to TokenService.
|
||||
*
|
||||
* @returns access_token
|
||||
* @throws AuthenticationError
|
||||
**/
|
||||
verifyCode: async function(verifyCode) {
|
||||
const requestData = {
|
||||
method: 'post',
|
||||
url: "forgotPassword",
|
||||
data: {
|
||||
verifyCode,
|
||||
},
|
||||
auth: {
|
||||
username: process.env.VUE_APP_CLIENT_ID,
|
||||
password: process.env.VUE_APP_CLIENT_SECRET
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await ApiService.customRequest(requestData);
|
||||
ApiService.setHeader();
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw new AuthenticationError(error.response.status, error.response.data.detail);
|
||||
|
||||
Reference in New Issue
Block a user