From c79d438681d65561b517055d9c0683f0bc235cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=9A=E5=87=AF?= <15929996560@163.com> Date: Tue, 30 Dec 2025 22:50:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QXLive/Base/QXAppStartViewController.m | 12 +++++++++++- QXLive/Base/QXGlobal.h | 1 + QXLive/Other/AppDelegate+Login.m | 2 -- QXLive/Other/QXApi.h | 5 ++++- QXLive/活动/时空之巅/QXTimePraizePoolView.m | 6 +++++- QXLive/活动/时空之巅/QXTimePraizeRecordView.m | 10 +++++++--- QXLive/活动/时空之巅/QXTimePraizeView.m | 12 ++++++++++-- 7 files changed, 38 insertions(+), 10 deletions(-) diff --git a/QXLive/Base/QXAppStartViewController.m b/QXLive/Base/QXAppStartViewController.m index c27cc09..f2174bd 100644 --- a/QXLive/Base/QXAppStartViewController.m +++ b/QXLive/Base/QXAppStartViewController.m @@ -8,8 +8,11 @@ #import "QXAppStartViewController.h" #import "AppDelegate.h" #import "TUIChatConfig.h" +#import "OpenUDID.h" +#import "QXManagerMqtt.h" @interface QXAppStartViewController () @property (nonatomic,strong)UIImageView *bgImaegView; +@property (nonatomic,assign)BOOL isNeedChangeServer; @end @implementation QXAppStartViewController @@ -47,7 +50,11 @@ @property (nonatomic,strong)NSString *icon_wd_notselect; */ -(void)getAppTheme{ - NSString *themeUrl = [NSString stringWithFormat:@"%@%@",ServerUrl,QXAppTheme]; + NSString *server = ServerUrl; + if (QXGlobal.shareGlobal.isNeedChangeServer) { + server = RServerUrl; + } + NSString *themeUrl = [NSString stringWithFormat:@"%@%@",server,QXAppTheme]; [[QXRequset shareInstance] getWithUrl:themeUrl parameters:@{} needCache:NO success:^(id responseObject) { [QXConfig defaultConfig]; QXTabbarModel *tabbarIndex1 = QXConfig.shared.tabbarArray[0]; @@ -145,10 +152,13 @@ BOOL api_version = [responseObject[@"api_version"] boolValue]; TUIChatConfig.defaultConfig.isAppStore = api_version; [QXGlobal shareGlobal].isAppStore = api_version; + NSString *clientId = [OpenUDID value]; + [[QXManagerMqtt sharedInstance] bindWithUserName:@"public" password:@"" cliendId:clientId isSSL:NO]; NSLog(@"请求成功"); } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { NSLog(@"请求失败"); [self alertNetworkError]; + QXGlobal.shareGlobal.isNeedChangeServer = YES; }]; } -(void)loginSuccess{ diff --git a/QXLive/Base/QXGlobal.h b/QXLive/Base/QXGlobal.h index 76fc9db..1117736 100644 --- a/QXLive/Base/QXGlobal.h +++ b/QXLive/Base/QXGlobal.h @@ -20,6 +20,7 @@ typedef void (^showFinishBlock)(void); @interface QXGlobal : NSObject +(instancetype)shareGlobal; @property (nonatomic,assign)BOOL isNeedUpdate; +@property (nonatomic,assign)BOOL isNeedChangeServer; // 是否登录 @property (nonatomic,readonly,assign)BOOL isLogin; @property (nonatomic,assign)BOOL isShowLoginVC; diff --git a/QXLive/Other/AppDelegate+Login.m b/QXLive/Other/AppDelegate+Login.m index 7a4b9c2..faf09a9 100644 --- a/QXLive/Other/AppDelegate+Login.m +++ b/QXLive/Other/AppDelegate+Login.m @@ -77,8 +77,6 @@ [[QXLocationManager shareManager] startLoction]; [QXLocationManager shareManager].delegate = self; [self getUserInfo]; - NSString *clientId = [OpenUDID value]; - [[QXManagerMqtt sharedInstance] bindWithUserName:@"public" password:@"" cliendId:clientId isSSL:NO]; } -(void)onConnectSuccess{ // showToast(@"腾讯重连服务器成功"); diff --git a/QXLive/Other/QXApi.h b/QXLive/Other/QXApi.h index 45a2511..06db60b 100644 --- a/QXLive/Other/QXApi.h +++ b/QXLive/Other/QXApi.h @@ -17,8 +17,9 @@ //tmd.xscmmidi.site -- 这是接口 api #if DEVELOPENT == 1 static NSString* ServerUrl = @"https://test.vespa.qxyushen.top/"; -//static NSString* ServerUrl = @"http://test.chat.qxyushen.top"; static NSString* H5ServerUrl = @"https://test.vespa.qxyushen.top/h5/"; +static NSString* RServerUrl = @"https://test.vespa.qxyushen.top/"; +static NSString* RH5ServerUrl = @"https://test.vespa.qxyushen.top/h5/"; #else //static NSString* ServerUrl = @"https://test.vespa.qxyushen.top/"; //static NSString* H5ServerUrl = @"https://test.vespa.qxyushen.top/h5/"; @@ -26,6 +27,8 @@ static NSString* H5ServerUrl = @"https://test.vespa.qxyushen.top/h5/"; //static NSString* H5ServerUrl = @"https://vespa.qxyushen.top/h5/"; static NSString* ServerUrl = @"https://yushengapi.qxyushen.top/"; static NSString* H5ServerUrl = @"https://yushengapi.qxyushen.top/h5/"; +static NSString* RServerUrl = @"https://vespa.qxhs.xyz/"; +static NSString* RH5ServerUrl = @"https://vespa.qxhs.xyz/h5/"; #endif #pragma mark - 引导页 /// 引导页 diff --git a/QXLive/活动/时空之巅/QXTimePraizePoolView.m b/QXLive/活动/时空之巅/QXTimePraizePoolView.m index 2b81ba9..01a2c74 100644 --- a/QXLive/活动/时空之巅/QXTimePraizePoolView.m +++ b/QXLive/活动/时空之巅/QXTimePraizePoolView.m @@ -66,7 +66,11 @@ return; } MJWeakSelf - [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"12",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { + NSString *server = ServerUrl; + if (QXGlobal.shareGlobal.isNeedChangeServer) { + server = RServerUrl; + } + [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"12",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; [self.collectionView reloadData]; diff --git a/QXLive/活动/时空之巅/QXTimePraizeRecordView.m b/QXLive/活动/时空之巅/QXTimePraizeRecordView.m index 9982823..f38b92a 100644 --- a/QXLive/活动/时空之巅/QXTimePraizeRecordView.m +++ b/QXLive/活动/时空之巅/QXTimePraizeRecordView.m @@ -118,11 +118,15 @@ @"gift_bag_id":@"12", @"page":[NSNumber numberWithInteger:self.page] }; - NSString *url = [NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_my_record"]; + NSString *server = ServerUrl; + if (QXGlobal.shareGlobal.isNeedChangeServer) { + server = RServerUrl; + } + NSString *url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_my_record"]; if (self.myRecordBtn.selected) { - url = [NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_my_record"]; + url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_my_record"]; }else{ - url = [NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_all_record"]; + url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_all_record"]; } [[QXRequset shareInstance] postWithUrl:url parameters:parameters needCache:NO success:^(id responseObject) { if (weakSelf.myRecordBtn.selected == YES) { diff --git a/QXLive/活动/时空之巅/QXTimePraizeView.m b/QXLive/活动/时空之巅/QXTimePraizeView.m index e542633..eca6650 100644 --- a/QXLive/活动/时空之巅/QXTimePraizeView.m +++ b/QXLive/活动/时空之巅/QXTimePraizeView.m @@ -375,7 +375,11 @@ static NSInteger toSlowCount = 4; // return; // } MJWeakSelf - [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"12",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { + NSString *server = ServerUrl; + if (QXGlobal.shareGlobal.isNeedChangeServer) { + server = RServerUrl; + } + [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"12",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; weakSelf.centerView.model = model; @@ -655,7 +659,11 @@ static NSInteger toSlowCount = 4; NSDictionary *parameters = @{ @"send_id":self.drawResultModel.blind_box_turntable_id?self.drawResultModel.blind_box_turntable_id:@"" }; - [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/gift_send"] parameters:parameters needCache:NO success:^(id responseObject) { + NSString *server = ServerUrl; + if (QXGlobal.shareGlobal.isNeedChangeServer) { + server = RServerUrl; + } + [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/gift_send"] parameters:parameters needCache:NO success:^(id responseObject) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {