From da9f7b54153b0ecce7c2e7885aaa16b954e5f039 Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Tue, 14 Mar 2023 20:40:29 +0000 Subject: [PATCH] use customRequest --- packages/app/src/models/auth/index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/app/src/models/auth/index.js b/packages/app/src/models/auth/index.js index 21d38dbf..38a64e9e 100755 --- a/packages/app/src/models/auth/index.js +++ b/packages/app/src/models/auth/index.js @@ -2,7 +2,7 @@ import SessionModel from "../session" export default class AuthModel { static login = async (payload) => { - const response = await app.cores.api.customRequest( { + const response = await app.cores.api.customRequest({ method: "post", url: "/auth/login", data: { @@ -29,10 +29,14 @@ export default class AuthModel { static async register(payload) { const { username, password, email } = payload - const response = await User.bridge.post.register(undefined, { - username, - password, - email, + const response = await app.cores.api.customRequest({ + method: "post", + url: "/auth/register", + data: { + username, + password, + email, + } }).catch((error) => { console.error(error)