Explorar o código

调整服务器URL 去掉http连接的端口号

ganzf hai 7 meses
pai
achega
82939a3c5d

+ 4 - 4
AIIM/AIIM/Common/CommonUI/Util/config.h

@@ -9,7 +9,7 @@
 #define config_h
 #import <UIKit/UIKit.h>
 
-
+//
 #ifdef DEBUG
 static NSString *WebSocketUrl = @"ws://abt1.my-im.com:9326?";
 #else
@@ -19,11 +19,11 @@ static NSString *WebSocketUrl = @"ws://aiim.my-im.com:9326?";
 #ifdef DEBUG
 static NSString *httphost = @"http://abt1.my-im.com:8080";
 #else
-static NSString *httphost = @"http://aiim.my-im.com:8080";
+static NSString *httphost = @"http://aiim.my-im.com";
 #endif
 
 //static NSString *WebSocketUrl = @"ws://aiim.my-im.com:9326?";
-//static NSString *httphost = @"http://aiim.my-im.com:8080";
+//static NSString *httphost = @"http://aiim.my-im.com";
 
 //static NSString *WebSocketUrl = @"ws://192.168.1.7:9326?";
 //static NSString *httphost = @"http://192.168.1.7:8080";
@@ -43,7 +43,7 @@ static NSString *JitsiMeetSV = @"https://rtc2.my-im.com/";
 
 //旧地址 @"https://rtc.my-im.com/"
 
-static NSString *filehttphost = @"http://upload.my-im.com:8080";//生产文件服务器
+static NSString *filehttphost = @"http://upload.my-im.com";//生产文件服务器
 static NSString * privacyPolicy = @"https://download.gobuy99.com/ynszc.html";//隐私政策
 
 

+ 1 - 1
AIIM/AIIM/Controller/friend/FriendListCell.m

@@ -43,7 +43,7 @@
 
 - (void)fillWithData:( NSDictionary*)data {
     
-    NSLog(@"fillWithData:%@",data);
+//    NSLog(@"fillWithData:%@",data);
     NSString *avatar =data[@"avatar"];
     if([avatar isKindOfClass:[NSString class]]){
         

+ 3 - 3
AIIM/AIIM/Controller/group/GroupListController.m

@@ -73,12 +73,12 @@
     return 1;
 }
 -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
-    NSLog(@"numberOfRowsInSection:%lu",(unsigned long)self.grouplist.count);
+//    NSLog(@"numberOfRowsInSection:%lu",(unsigned long)self.grouplist.count);
     return self.grouplist.count;
 }
 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
     NSDictionary *data=self.grouplist[indexPath.row];
-    NSLog(@"cellForRowAtIndexPath:%@",data);
+//    NSLog(@"cellForRowAtIndexPath:%@",data);
     if(data){
         
         GroupListCell *cell =[tableView dequeueReusableCellWithIdentifier:@"group" forIndexPath:indexPath];
@@ -98,7 +98,7 @@
 }
 
 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
-    NSLog(@"didSelectRowAtIndexPath:%@",indexPath);
+//    NSLog(@"didSelectRowAtIndexPath:%@",indexPath);
     
     NSDictionary *data=self.grouplist[indexPath.row];
     UIStoryboard *board = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];

+ 5 - 0
AIIM/AIIM/Controller/login/GLoginController.m

@@ -178,8 +178,12 @@
             [UDManager.shareInstance setSDManager:userid key:dkuserloginId];
             [self getUserinfo];
         }
+        else{
+            [MBProgressHUD showWithText:@"数据异常"];
+        }
     } fail:^(NSError * _Nonnull error) {
         NSLog(@"--%@",error);
+        [MBProgressHUD showWithText:@"网络或服务器异常"];
     }];
 }
 
@@ -244,6 +248,7 @@
             
         } fail:^(NSError * _Nonnull error) {
             NSLog(@"%@", error);
+            [MBProgressHUD showWithText:@"网络或服务器异常"];
         }];
     }
 }

+ 62 - 9
AIIM/AIIM/Controller/mine/UserConterController.m

@@ -48,6 +48,8 @@
 
 - (void)viewWillAppear:(BOOL)animated{
     [self setNavigationBarHidden:YES animated:YES];
+    NSLog(@"viewWillAppear------------");
+    [self getUserinfo];
 }
 
 -(void)initsubView{
@@ -57,14 +59,8 @@
     _tableView.backgroundColor = [UIColor clearColor];
     _tableView.delegate =self;
     _tableView.dataSource = self;
-    NSDictionary *userinfo = [UDManager.shareInstance getDDManager:dkuserinfo];
-    _nameLb.text = userinfo[@"name"];
-    _qianmLb.alpha = 0;
-    NSURL *av = [NSURL URLWithString:userinfo[@"avatar"]];
-    _avatar.layer.cornerRadius = 41.0;
-    _avatar.layer.borderWidth = 1.0;
-    _avatar.layer.borderColor = [UIColor whiteColor].CGColor;
-    [_avatar sd_setImageWithURL:av placeholderImage:[UIImage imageNamed:@"Avatar"]];
+    [self showUserData];
+    
 }
 
 
@@ -140,7 +136,7 @@
     
     NSInteger section =indexPath.section;
     NSString *cellT =@"cellT";
-    if(section==_cellDatas.count-1){
+    if(section>=_cellDatas.count-2){
         cellT =@"tuichu";
     }
     
@@ -288,6 +284,63 @@
     }];
 }
 
+
+#pragma mark private
+
+-(void)getUserinfo{
+    NSString *token = [UDManager.shareInstance getSDManager:gkeytoken];
+    if([token isKindOfClass:[NSString class]]&&token.length>10){
+        [UserNetApi getUserinfo:^(int code, NSDictionary * res) {
+            NSLog(@"%d", code);
+            NSNumber *gcode=res[@"code"];
+            NSDictionary *data=res[@"data"];
+            NSLog(@"%@", res);
+            if([gcode intValue]!=200){
+                NSLog(@"%@",res[@"msg"]);
+//                [MBProgressHUD showWithText:@"登录异常,请重新登录"];
+                return;
+            }
+            NSDictionary *ps = @{@"avatar": data[@"avatar"]?:@"",
+                                 @"deptId": data[@"deptId"]?:@"",
+                                 //@"domainId":data[@"domainId"],
+                                 @"email":data[@"email"]?:@"",
+                                 @"id":data[@"id"]?:@"",
+                                 @"mobile":data[@"mobile"]?:@"",
+                                 @"name":data[@"name"]?:@"",
+                                 //@"platformType":data[@"platformType"]?:@"",
+                                 //@"registrationId":data[@"registrationId"]?:@"",
+                                 @"sex":data[@"sex"]?:@"",
+                                 //@"tgbotAdmin":data[@"tgbotAdmin"],
+                                 //@"tgbotName":data[@"tgbotName"],
+                                 //@"tgbotTk":data[@"tgbotTk"]?:@"",
+                                 @"username":data[@"username"]?:@"",
+                                 //@"uuid":data[@"uuid"],
+                                 //@"voipTk":data[@"voipTk"]?:@""
+                                };
+            if([gcode intValue]==200){
+                NSLog(@"ps:%@",ps);
+                [UDManager.shareInstance setSDManager:ps[@"id"] key:dkuserId];
+                [UDManager.shareInstance setDDManager:ps key:dkuserinfo];
+                [self showUserData];
+            }
+            
+        } fail:^(NSError * _Nonnull error) {
+            NSLog(@"%@", error);
+        }];
+    }
+}
+
+-(void)showUserData{
+    NSDictionary *userinfo = [UDManager.shareInstance getDDManager:dkuserinfo];
+    _nameLb.text = userinfo[@"name"];
+    _qianmLb.alpha = 0;
+    NSURL *av = [NSURL URLWithString:userinfo[@"avatar"]];
+    _avatar.layer.cornerRadius = 41.0;
+    _avatar.layer.borderWidth = 1.0;
+    _avatar.layer.borderColor = [UIColor whiteColor].CGColor;
+    [_avatar sd_setImageWithURL:av placeholderImage:[UIImage imageNamed:@"Avatar"]];
+}
+
 #pragma mark statusBar
 - (UIStatusBarStyle)preferredStatusBarStyle{
     return UIStatusBarStyleLightContent;