动我项目仓库 flutter:3.22 dart:3.4.4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
907 B

import 'request.dart';
class Api {
/// 单例模式
static Api? _instance;
// 工厂函数:初始化,默认会返回唯一的实例
factory Api() => _instance ?? Api._internal();
// 用户Api实例:当访问UserApi的时候,就相当于使用了get方法来获取实例对象,如果_instance存在就返回_instance,不存在就初始化
static Api? get instance => _instance ?? Api._internal();
/// 初始化
Api._internal() {
// 初始化基本选项
}
$getAuthCaptcha(data) async {
var result = await Request().request(
"/dating-agency-uec/authorize/get/auth-captcha",
method: DioMethod.post,
data: data
);
return result;
}
$login(data) async {
var result = await Request().request(
"/dating-agency-uec/authorize/by-captcha",
method: DioMethod.post,
data: data
);
return result;
}
}