修复添加指纹模块bug
This commit is contained in:
parent
a824c33c3c
commit
2878f291a7
@ -3,6 +3,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
|
||||
import '../../../../../blue/blue_manage.dart';
|
||||
@ -50,10 +51,10 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
Future<void> _replyAddFingerprintBegin(Reply reply) async {
|
||||
var token = reply.data.sublist(2, 6);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
print("_replyAddFingerprintReplyToken:$token");
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
// var token = reply.data.sublist(2, 6);
|
||||
// var saveStrList = changeIntListToStringList(token);
|
||||
// print("_replyAddFingerprintReplyToken:$token");
|
||||
// Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
@ -74,6 +75,9 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
@ -84,7 +88,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
needAuthor:1,
|
||||
publicKey:publicKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: token,
|
||||
token: getTokenList,
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
@ -164,7 +168,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
// print("添加指纹确认成功,调用添加指纹接口");
|
||||
if(state.isCoerced.value == "1"){
|
||||
if(state.isCoerced.value == "2"){
|
||||
// 非胁迫指纹
|
||||
addFingerprintsData();
|
||||
}else{
|
||||
@ -234,8 +238,8 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
// 添加指纹开始
|
||||
Future<void> senderAddFingerprint() async {
|
||||
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
|
||||
if (state == DeviceConnectionState.connected){
|
||||
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == DeviceConnectionState.connected){
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
@ -244,7 +248,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print("openDoorTokenPubToken:$getTokenList");
|
||||
print("openDoorTokenPubToken:$getTokenList state.startDate.value:${state.startDate.value}");
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
keyID:"1",
|
||||
@ -253,6 +257,8 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
useCountLimit:1,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
// startTime:int.parse(state.startDate.value)~/1000,
|
||||
// endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
publicKey:publicKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
@ -264,8 +270,8 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
// 添加胁迫指纹
|
||||
Future<void> senderAddStressFingerprint() async {
|
||||
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
|
||||
if (state == DeviceConnectionState.connected){
|
||||
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == DeviceConnectionState.connected){
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
@ -283,6 +289,8 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
useCountLimit:1,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
// startTime:int.parse(state.startDate.value)~/1000,
|
||||
// endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
publicKey:publicKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
|
||||
@ -114,7 +114,7 @@ class AddICCardLogic extends BaseGetXController{
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
// print("添加指纹确认成功,调用添加指纹接口");
|
||||
if(state.isCoerced.value == "1"){
|
||||
if(state.isCoerced.value == "2"){
|
||||
// 非胁迫指纹
|
||||
addICCardData();
|
||||
}else{
|
||||
|
||||
@ -72,7 +72,7 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||
fingerprintType = 4;
|
||||
}
|
||||
|
||||
|
||||
print("addOtherType startDate:$startDate endDate:$endDate");
|
||||
switch (state.lockType.value) {
|
||||
case 0:
|
||||
// 卡
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:star_lock/appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
import '../../tools/commonItem.dart';
|
||||
import '../../tools/titleAppBar.dart';
|
||||
import '../../tools/toast.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
|
||||
// 网页的宏定义网址
|
||||
@ -64,7 +65,9 @@ class _AbountPageState extends State<AbountPage> {
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {}),
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
}),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
@ -113,7 +116,9 @@ class _AbountPageState extends State<AbountPage> {
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {}),
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
}),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
@ -126,7 +131,9 @@ class _AbountPageState extends State<AbountPage> {
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {}),
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
}),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
@ -139,7 +146,9 @@ class _AbountPageState extends State<AbountPage> {
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {}),
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -92,7 +92,7 @@ abstract class Api {
|
||||
final String addICCardURL = '/identityCard/add'; // 添加IC卡
|
||||
final String editICCardURL = '/identityCard/update'; // 编辑IC卡
|
||||
final String deleteICCardURL = '/identityCard/delete'; // 删除IC卡
|
||||
final String updateICCardUserNoURL = '/identityCard/updatePwdUserNo'; // 更新ic卡用户序号
|
||||
final String updateICCardUserNoURL = '/identityCard/updateCardUserNo'; // 更新ic卡用户序号
|
||||
|
||||
final String transferLockListURL = '/room/listForTransfer'; // 转移锁锁列表
|
||||
final String transferLockConfirmURL = '/room/transferLockConfirm'; // 转移智能锁确认
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user