add pin login and add pin code

This commit is contained in:
tzw
2024-10-04 13:55:59 +06:30
parent b5023a4171
commit 81dfeb037d
18 changed files with 340 additions and 68 deletions

View File

@@ -4,6 +4,8 @@ import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:dio/dio.dart';
import 'package:fcs/data/services/services.dart';
import 'package:fcs/domain/entities/user.dart';
import 'package:fcs/domain/vo/status.dart';
import 'package:logging/logging.dart';
import 'package:path_provider/path_provider.dart';
@@ -28,6 +30,10 @@ Future<dynamic> requestAPI(String path, method,
if (token != null) {
headers["Token"] = token;
}
User? pinLoginUser = Services.instance.authService.getPinLoginUser();
if (pinLoginUser != null) {
headers["pin_token"] = pinLoginUser.pinToken;
}
if (devInfo.deviceID != null) {
headers["Device"] = devInfo.deviceID ?? "" + ":" + deviceName;
}