provider.ts
548 Bytes
import axios from 'axios';
type LoginData = { access_token: string; refresh_token: string; nick_name: string };
export default class useProviderApi {
static async area() {
return axios.get('/provider/area');
}
static sms(type: string, phone: string, area?: string) {
return axios.post('/provider/sms', { type, phone, area, platform: 'manage', scope: 2 });
}
static async login(type: 'phone' | 'email', data: object) {
return axios.post<LoginData>('/provider/login', { platform: 'manage', scope: 2, type, ...data });
}
}