提交 ff01c6ce authored 作者: yueweilu's avatar yueweilu

发送验证码 添加 uuid

上级 c427ef10
......@@ -9,6 +9,7 @@ abstract class AccountAPI {
required String type,
String? password,
String? code,
String? uuid,
}) async {
// assert((password != null && code == null) ||
// (password == null && code != null),
......@@ -26,6 +27,7 @@ abstract class AccountAPI {
// 验证码登录
if(type == '2'){
params['code'] = code;
params['uuid'] = uuid;
}
final result = await HttpService.to.post(
'/v1/members/login/login',
......@@ -70,11 +72,24 @@ abstract class AccountAPI {
required String phone,
required String type,
}) async {
String uuid = '';
final DeviceInfoPlugin device = DeviceInfoPlugin();
if(Platform.isIOS){
final IosDeviceInfo iosInfo = await device.iosInfo;
uuid = iosInfo.identifierForVendor??'';
}
else if(Platform.isAndroid){
const androidIdPlugin = AndroidId();
uuid = await androidIdPlugin.getId()??'';
}
final result = await HttpService.to.post(
'/v1/members/login/sendCode',
params: {
'phone': phone,
'types': type
'types': type,
'uuid':uuid
},
excludeToken: true,
showLoading: true,
......
library apis;
import 'dart:io';
import 'package:android_id/android_id.dart';
import 'package:device_info_plus/device_info_plus.dart';
import '../models/index.dart';
import '../services/index.dart';
part 'account.dart';
part 'mine.dart';
part 'course.dart';
......
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
android_id:
dependency: "direct main"
description:
name: android_id
sha256: "5c2d3a259afcd173dbe367ba452817bd530c4df75d251d652c69b8d3c8ac0d36"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.6"
archive:
dependency: "direct main"
description:
......@@ -161,6 +169,22 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.3"
device_info_plus:
dependency: "direct main"
description:
name: device_info_plus
sha256: "77f757b789ff68e4eaf9c56d1752309bd9f7ad557cb105b938a7f8eb89e59110"
url: "https://pub.flutter-io.cn"
source: hosted
version: "9.1.2"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64
url: "https://pub.flutter-io.cn"
source: hosted
version: "7.0.0"
dio:
dependency: "direct main"
description:
......@@ -1018,6 +1042,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.0.9"
win32_registry:
dependency: transitive
description:
name: win32_registry
sha256: e4506d60b7244251bc59df15656a3093501c37fb5af02105a944d73eb95be4c9
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
xdg_directories:
dependency: transitive
description:
......
......@@ -115,6 +115,10 @@ dependencies:
connectivity_plus: ^5.0.2
# 数据库
sqflite: ^2.3.2
# 设备信息
device_info_plus: ^9.1.2
# 安卓
android_id: ^0.3.6
dev_dependencies:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论