JLChen
2021-04-19 b7fa25faef4decf509a998ae861f059896ea6093
Demo/EZOpensdk_iOS_4.15.1_build20201104/Demo/EZOpenSDKDemo/UIViewControllers/EZDeviceTableViewController.m
@@ -43,9 +43,17 @@
@implementation EZDeviceTableViewController
-(void)viewWillDisappear:(BOOL)animated
{
    //    self.navigationController.navigationBarHidden = YES;//2021-02-01 添加隐藏navigationBarHidden
}
- (void)viewDidLoad
{
    [super viewDidLoad];
//    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
//     forBarMetrics:UIBarMetricsDefault];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
@@ -58,6 +66,8 @@
    //    self.title.
    
    self.logoutBtn.title = NSLocalizedString(@"Logout", @"注销");
    self.logoutBtn.title = @"";
    [self.logoutBtn setEnabled: NO];
    
    [self checkEZIsLogin];
}
@@ -66,6 +76,9 @@
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;//2021-02-01
    if (_needRefresh)
    {
        _needRefresh = NO;
@@ -105,12 +118,12 @@
                //            self.navigationItem.rightBarButtonItem = self.addButton;
            }];
        }else{
            [[EZGlobalSDK class] getAreaList:^(NSArray *areaList, NSError *error) {
            [EZOPENSDK getAreaList:^(NSArray *areaList, NSError *error) {
                EZAreaInfo *areaInfo = areaList.firstObject;
                [[EZGlobalSDK class] openLoginPage:[NSString stringWithFormat:@"%ld",(long)areaInfo.id]
                [EZOPENSDK openLoginPage:[NSString stringWithFormat:@"%ld",(long)areaInfo.id]
                              completion:^(EZAccessToken *accessToken) {
                    [[GlobalKit shareKit] setAccessToken:accessToken.accessToken];
                    [[EZGlobalSDK class] setAccessToken:accessToken.accessToken];
                    [EZOPENSDK setAccessToken:accessToken.accessToken];
                    [self addRefreshKit];
                    //                                            self.navigationItem.rightBarButtonItem = self.addButton;
                }];