微信登陆,bug修改

This commit is contained in:
kai60
2020-01-09 09:25:43 +08:00
parent 82590f8fba
commit bfb68dd81c
62 changed files with 5105 additions and 275 deletions
@@ -238,7 +238,9 @@
-(void)initImageView{
UserModel*userModel=[[DataCenter defaultDtacenter]valueForKey:@"UserLogIn"];
NSString*wechatImgUrl=[[NSUserDefaults standardUserDefaults] stringForKey:@"wechatImgUrl"];
NSString*fullpath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:@"avatar.png"];
UIImage*saveImage=[[UIImage alloc]initWithContentsOfFile:fullpath];
if (saveImage==nil) {
@@ -260,14 +262,28 @@
// [_iconImageButton setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:@"userIcon%d.png",i]] forState:UIControlStateNormal];
NSString*str=[NSString stringWithFormat:@"%@%@",kGetIconUrl,userModel.userImg];
if (wechatImgUrl.length)
{
str=wechatImgUrl;
}
[self.userImg sd_setImageWithURL:[NSURL URLWithString:str] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
NSLog(@"error=%@,%@",error,image);
}];
[self.userImg sd_setImageWithURL:[NSURL URLWithString:str]];
}
}
}else{
NSString*str=[NSString stringWithFormat:@"%@%@",kGetIconUrl,userModel.userImg];
if (wechatImgUrl.length)
{
str=wechatImgUrl;
}
if ([str isEqualToString:kGetIconUrl]) {
//int i = (arc4random()%7) + 1;// 设置随机头像
int i = 1;