浏览代码

添加 API 解决bug

openlockPPP 1 年之前
父节点
当前提交
a7c9b4a5c2

二进制
jiaPei.xcworkspace/xcuserdata/mimasigeling.xcuserdatad/UserInterfaceState.xcuserstate


+ 5 - 4
jiaPei/Modules/HomePageModule/Model/RQHTTPService+RQGetPlaceVideoList.m

@@ -27,10 +27,11 @@
         /// 每页数据量
         subscript[@"pageSize"] = @(pageSize);
     }
-    if (RQStringIsNotEmpty(searchStr)) {
-        /// 考场名称
-        subscript[@"examName"] = searchStr;
-    }
+    //后端说不用
+//    if (RQStringIsNotEmpty(searchStr)) {
+//        /// 考场名称
+//        subscript[@"examName"] = searchStr;
+//    }
     /// 0未开启 1已开启
     subscript[@"state"] = @1;
     /// 城市ID

+ 2 - 0
jiaPei/Modules/LoginModule/LoginModule.h

@@ -20,6 +20,8 @@
 
 /// 学员注销接口
 #define RQ_POST_StudentLogoutUser               @"student/logoutUser"
+/// get学员
+#define RQ_POST_StudentGetUser               @"student/getUserInfo"
 /// 修改用户密码
 #define RQ_POST_UpdatePassword                  @"student/savePwd"
 /// 获取短信验证码

+ 1 - 0
jiaPei/Modules/LoginModule/Model/Login/RQHTTPService+RQLogin.h

@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (RACSignal *)studentLoginWithLoginCode:(NSString *)loginCode password:(NSString *)password;
 - (RACSignal *)studentLoginWithUserId:(NSString *)userId;
+- (RACSignal *)getUserinfoWithUserId:(NSString *)userId;
 @end
 
 NS_ASSUME_NONNULL_END

+ 15 - 0
jiaPei/Modules/LoginModule/Model/Login/RQHTTPService+RQLogin.m

@@ -53,4 +53,19 @@
              enqueueResultClass:[RQUserModel class]]
             rq_parsedResults];
 }
+
+- (RACSignal *)getUserinfoWithUserId:(NSString *)userId {
+    /// 1. 配置参数
+    RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
+    subscript[@"userId"] = userId;
+    
+    /// 2. 配置参数模型
+    RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_POST path:RQ_POST_StudentGetUser parameters:subscript.dictionary];
+    
+    /// 3.发起请求
+    return [[[RQHTTPRequest requestWithParameters:paramters]
+             enqueueResultClass:[RQUserModel class]]
+            rq_parsedResults];
+}
+
 @end

+ 7 - 0
jiaPei/Modules/TimeModule/Controller/RQTimeViewController.m

@@ -21,6 +21,13 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
+    [[RQ_HTTP_Service getUserinfoWithUserId:RQ_USER_MANAGER.currentUser._id] subscribeNext:^(RQUserModel *userModel) {
+        if(userModel){
+            [RQ_USER_MANAGER saveUser:userModel];//更新保存
+        }
+    } error:^(NSError * _Nullable error) {
+    } completed:^{
+    }];
 }
 
 #pragma mark - OverrideMethods