From 9be7bbfe48af5b43946eef4a151613e4e6ff13cc Mon Sep 17 00:00:00 2001 From: QQQ <3671373519@qq.com> Date: Fri, 17 May 2024 15:34:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=BB=E5=8F=96=20AccountI?= =?UTF-8?q?nfo=20=E6=97=B6=E7=9A=84=E5=88=A4=E6=96=AD=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=96=B9=E6=B3=95=E6=95=88=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi/Structure/MVP/Model/AccountInfoStorage.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/YuMi/Structure/MVP/Model/AccountInfoStorage.m b/YuMi/Structure/MVP/Model/AccountInfoStorage.m index 601b9cc9..bda503b0 100644 --- a/YuMi/Structure/MVP/Model/AccountInfoStorage.m +++ b/YuMi/Structure/MVP/Model/AccountInfoStorage.m @@ -52,7 +52,15 @@ static AccountInfoStorage *_instance = nil; if (self.accountModel != nil) { return self.accountModel; } + + if ([[NSFileManager defaultManager] fileExistsAtPath:[self getFilePath]] == NO) { + return nil; + } + NSData *data = [[NSData alloc] initWithContentsOfFile:[self getFilePath]]; + if (data == nil) { + return nil; + } NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data]; //解档出数据模型