send Api Ok

This commit is contained in:
saeid_01
2019-04-16 11:18:38 +04:30
parent 4c286bfbc0
commit 655d6bf800
29 changed files with 5100 additions and 3358 deletions
+31 -3
View File
@@ -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);