Commit 8adfa0c5 authored by guxukai's avatar guxukai

chore: api迁移

parent 3e293122
import { Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
@Serializable()
export class UserCodeGetReq {
target: string
type: string
}
@Serializable()
export class UserCode {
/**
* 发送验证码
......@@ -17,3 +12,8 @@ export class UserCode {
})
}
}
@Serializable()
export class UserCodeGetReq {
target: string
type: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserPasswordPutReq extends Model<UserPasswordPutReq> {
@JsonProperty() password: string
@JsonProperty() phoneNum: string
@JsonProperty() verificode: string
}
@Serializable()
export class UserPassword extends Model<UserPassword> {
static async put(payload: UserPasswordPutReq) {
......@@ -16,3 +9,9 @@ export class UserPassword extends Model<UserPassword> {
})
}
}
@Serializable()
export class UserPasswordPutReq extends Model<UserPasswordPutReq> {
@JsonProperty() password: string
@JsonProperty() phoneNum: string
@JsonProperty() verificode: string
}
......@@ -3,6 +3,14 @@ import { Model } from '@shared/models/Model'
import { api } from '@shared/http/axios'
import { Encrypt } from '@shared/utils/secret-utils'
@Serializable()
export class UserRegister {
static async post(payload: UserRegisterPostReq) {
return await api.post('/services/user-service/user/register', {
data: serialize(payload),
})
}
}
@Serializable()
export class UserRegisterPostReq extends Model<UserRegisterPostReq> {
@JsonProperty() uname: string
@JsonProperty() mail: string
......@@ -16,11 +24,3 @@ export class UserRegisterPostReq extends Model<UserRegisterPostReq> {
@JsonProperty()
verificode: string
}
@Serializable()
export class UserRegister {
static async post(payload: UserRegisterPostReq) {
return await api.post('/services/user-service/user/register', {
data: serialize(payload),
})
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment