微信登陆,bug修改
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user