mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
use customRequest
This commit is contained in:
parent
2ed5db8735
commit
da9f7b5415
@ -2,7 +2,7 @@ import SessionModel from "../session"
|
|||||||
|
|
||||||
export default class AuthModel {
|
export default class AuthModel {
|
||||||
static login = async (payload) => {
|
static login = async (payload) => {
|
||||||
const response = await app.cores.api.customRequest( {
|
const response = await app.cores.api.customRequest({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: "/auth/login",
|
url: "/auth/login",
|
||||||
data: {
|
data: {
|
||||||
@ -29,10 +29,14 @@ export default class AuthModel {
|
|||||||
static async register(payload) {
|
static async register(payload) {
|
||||||
const { username, password, email } = payload
|
const { username, password, email } = payload
|
||||||
|
|
||||||
const response = await User.bridge.post.register(undefined, {
|
const response = await app.cores.api.customRequest({
|
||||||
username,
|
method: "post",
|
||||||
password,
|
url: "/auth/register",
|
||||||
email,
|
data: {
|
||||||
|
username,
|
||||||
|
password,
|
||||||
|
email,
|
||||||
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user