Skip to content

Commit 80fc736

Browse files
author
hourunjing
committed
任务选择项目时,只能选私有项目
1 parent 637ba55 commit 80fc736

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CodingForiPad/Manager/COSession.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ - (NSError *)checkLoginSuccess:(CODataResponse *)response
7373
// 二次认证
7474
NSString *msg = [response displayMsg];
7575
error = [NSError errorWithDomain:@"net.coding.ipad" code:OPErrorCodeNeedAuthCode userInfo:@{NSLocalizedDescriptionKey: msg, NSLocalizedFailureReasonErrorKey : msg}];
76+
} else if (response.msg[@"email"] || response.msg[@"j_captcha_error"]) {
77+
// 用户名密码、验证码
78+
NSString *msg = [response displayMsg];
79+
error = [NSError errorWithDomain:@"net.coding.ipad" code:response.code userInfo:@{NSLocalizedDescriptionKey: msg, NSLocalizedFailureReasonErrorKey : msg}];
7680
}
7781
}
7882
else {

CodingForiPad/ViewController/Base/COAddTask2ProjectController.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ - (void)didReceiveMemoryWarning {
5252

5353
- (void)loadData
5454
{
55-
COProjectsRequest *request = [COProjectsRequest alloc];
55+
COProjectsRequest *request = [COProjectsRequest request];
5656
request.type = @"all";
5757
request.sort = @"hot";
5858
request.page = 1;// 增加页面呢
@@ -70,6 +70,10 @@ - (void)loadData
7070

7171
- (void)showData:(NSArray *)data
7272
{
73+
data = [data filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"isPublic == %d", NO]];
74+
if (data.count <= 0) {
75+
return;
76+
}
7377
self.originData = [NSMutableArray arrayWithArray:data];
7478
// 页面判断
7579
[self.data addObjectsFromArray:data];

0 commit comments

Comments
 (0)