From 881f0da670f20c401c1e1d08b36253abb28f72d2 Mon Sep 17 00:00:00 2001
From: zjf <zhangjf@probim.com.cn>
Date: Mon, 13 Mar 2023 13:35:39 +0800
Subject: [PATCH] token 过期 diss 和 pressent 间隔一下

---
 IphoneBIMe/IphoneBIMe/Classes/Tools/PBNetworkTools.m |   34 ++++++++++++++++++++++++++++++----
 1 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/IphoneBIMe/IphoneBIMe/Classes/Tools/PBNetworkTools.m b/IphoneBIMe/IphoneBIMe/Classes/Tools/PBNetworkTools.m
index 8427f14..b396ab0 100644
--- a/IphoneBIMe/IphoneBIMe/Classes/Tools/PBNetworkTools.m
+++ b/IphoneBIMe/IphoneBIMe/Classes/Tools/PBNetworkTools.m
@@ -151,9 +151,14 @@
     PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
     if ([networkModel.Msg isEqualToString:@"Token已过期"]) {
         [PBNoteCenter postNotificationName: PBNoteCenterDismissTabBarController object:nil];
-        [PBNoteCenter postNotificationName:@"PBNoteCenterTokenExpired" object:nil];
+        [self performSelector:@selector(toLogin) withObject:nil afterDelay:0.3f];
+        
     }
 }
+- (void)toLogin {
+    [PBNoteCenter postNotificationName:@"PBNoteCenterTokenExpired" object:nil];
+}
+
 #pragma mark =================================新接口=======================================
 #pragma mark - 登录
 - (void)loginWithUserName:(NSString *)userName andPassword:(NSString *)password andCallBack:(void (^) (NSURLSessionDataTask *task,id response, NSError *error))callBack {
@@ -1936,15 +1941,36 @@
 - (void)aEntryOrExitWithOrganizeId:(NSString *)organizeId andFillingUserId:(NSString *)fillingUserId andProgressParentId:(NSString *)progressParentId andProgressTreeId:(NSString *)progressTreeId andProgressProjectId:(NSString *)progressProjectId andAddress:(NSString *)address andType:(NSInteger)type andCallBack:(void (^) (NSURLResponse *response, id responseObject, NSError *error))callBack {
     NSDictionary *dict = @{
                            @"OrganizeId": organizeId,
-                           @"FillingUserId": fillingUserId,
+                           @"FillingId": fillingUserId,
                            @"ProgressParentId": progressParentId,
                            @"ProgressTreeId": progressTreeId,
                            @"ProgressProjectId": progressProjectId,
                            @"Address": address,
-                           @"Token": Token,
                            @"Type": [NSNumber numberWithInteger:type]
                            };
-    NSString *url = [NSString stringWithFormat:@"%@/api/Filling/FillingUserLog/EntryOrExit",BaseUrl];
+    NSString *url = [NSString stringWithFormat:@"%@/api/Filling/FillingLog/UserEntryOrExit",BaseUrl];
+    [[PBNetworkTools sharedTools] BodyRequestWithType:POST andCookie:NO andUrl:url andParams:dict andCallBack:callBack];
+}
+#pragma mark - 获取现场车辆扫描信息
+- (void)GetCarInfoWithID:(NSString *)guid andCallBack:(void (^) (NSURLSessionDataTask *task,id response, NSError *error))callBack {
+    NSDictionary *dict = @{
+                           @"id":guid
+                           };
+    NSString *url = [NSString stringWithFormat:@"%@/api/Filling/FillingCar/GetCarInfo",BaseUrl];
+    [[PBNetworkTools sharedTools] RequestWithType:GET andCookie:NO andUrl:url andParams:dict andCallBack:callBack];
+}
+#pragma mark - 现场车辆填报
+- (void)CarEntryOrExitWithOrganizeId:(NSString *)organizeId andFillingId:(NSString *)fillingId andProgressParentId:(NSString *)progressParentId andProgressTreeId:(NSString *)progressTreeId andProgressProjectId:(NSString *)progressProjectId andAddress:(NSString *)address andType:(NSInteger)type andCallBack:(void (^) (NSURLResponse *response, id responseObject, NSError *error))callBack {
+    NSDictionary *dict = @{
+                           @"OrganizeId": organizeId,
+                           @"FillingId": fillingId,
+                           @"ProgressParentId": progressParentId,
+                           @"ProgressTreeId": progressTreeId,
+                           @"ProgressProjectId": progressProjectId,
+                           @"Address": address,
+                           @"Type": [NSNumber numberWithInteger:type]
+                           };
+    NSString *url = [NSString stringWithFormat:@"%@/api/Filling/FillingLog/CarEntryOrExit",BaseUrl];
     [[PBNetworkTools sharedTools] BodyRequestWithType:POST andCookie:NO andUrl:url andParams:dict andCallBack:callBack];
 }
 #pragma mark - 获取现场人员列表

--
Gitblit v1.9.3