Update: 2026-06-12 20:40:40
This commit is contained in:
@@ -17,9 +17,9 @@ import '../functions/encrypt_decrypt.dart';
|
||||
|
||||
class OtpHelper extends GetxController {
|
||||
static final String _sendOtpUrl =
|
||||
'${AppLink.server}/Admin/auth/send_otp_admin.php';
|
||||
'${AppLink.server}/auth/otp/request.php';
|
||||
static final String _verifyOtpUrl =
|
||||
'${AppLink.server}/Admin/auth/verify_otp_admin.php';
|
||||
'${AppLink.server}/auth/otp/verify.php';
|
||||
static final String _checkAdminLogin =
|
||||
'${AppLink.server}/Admin/auth/login.php';
|
||||
|
||||
@@ -29,7 +29,7 @@ class OtpHelper extends GetxController {
|
||||
// await CRUD().getJWT();
|
||||
final response = await CRUD().post(
|
||||
link: _sendOtpUrl,
|
||||
payload: {'receiver': phoneNumber},
|
||||
payload: {'receiver': phoneNumber, 'user_type': 'admin'},
|
||||
);
|
||||
// Log.print('_sendOtpUrl: ${_sendOtpUrl}');
|
||||
// Log.print('response: ${response}');
|
||||
@@ -54,8 +54,9 @@ class OtpHelper extends GetxController {
|
||||
link: _verifyOtpUrl,
|
||||
payload: {
|
||||
'phone_number': phoneNumber,
|
||||
'otp': otp,
|
||||
'device_number': box.read(BoxName.fingerPrint)
|
||||
'token_code': otp,
|
||||
'user_type': 'admin',
|
||||
'device_number': box.read(BoxName.fingerPrint) ?? ''
|
||||
},
|
||||
);
|
||||
|
||||
@@ -79,7 +80,7 @@ class OtpHelper extends GetxController {
|
||||
}
|
||||
|
||||
/// تسجيل الدخول بكلمة المرور والبصمة
|
||||
Future<bool> loginWithPassword(String password) async {
|
||||
Future<bool> loginWithPassword(String password, [String phone = '']) async {
|
||||
try {
|
||||
final fingerprint = box.read(BoxName.fingerPrint);
|
||||
final response = await CRUD().post(
|
||||
@@ -87,6 +88,7 @@ class OtpHelper extends GetxController {
|
||||
payload: {
|
||||
'fingerprint': fingerprint,
|
||||
'password': password,
|
||||
'phone': phone,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user