Skip to content

Commit 5faa1a7

Browse files
committed
@ 某人
1 parent 2503a82 commit 5faa1a7

7 files changed

Lines changed: 12 additions & 6 deletions

File tree

Coding_iOS/Controllers/CommitFilesViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ - (void)refresh{
9191
_curProject = [Project new];
9292
_curProject.owner_user_name = _ownerGK;
9393
_curProject.name = _projectName;
94+
}
95+
if (![_curProject.id isKindOfClass:[NSNumber class]]) {
9496
[[Coding_NetAPIManager sharedManager] request_ProjectDetail_WithObj:_curProject andBlock:^(id data, NSError *error) {
9597
if (data) {
9698
weakSelf.curProject = data;

Coding_iOS/Controllers/MRPRDetailViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ - (void)refresh{
165165
_curProject = [Project new];
166166
_curProject.owner_user_name = _curMRPR.des_owner_name;
167167
_curProject.name = _curMRPR.des_project_name;
168+
}
169+
if (![_curProject.id isKindOfClass:[NSNumber class]]) {
168170
[[Coding_NetAPIManager sharedManager] request_ProjectDetail_WithObj:_curProject andBlock:^(id data, NSError *error) {
169171
if (data) {
170172
weakSelf.curProject = data;

Coding_iOS/Controllers/NProjectViewController/NProjectViewController.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111

1212
@interface NProjectViewController : BaseViewController
1313
@property (nonatomic, strong) Project *myProject;
14-
@property (nonatomic, assign) BOOL needUpdateVisit;
1514
@end

Coding_iOS/Controllers/NProjectViewController/NProjectViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
248248

249249
#pragma mark goTo VC
250250
- (void)goToIndex:(NSInteger)index{
251-
if (index == 0) {
251+
if (index == 0 && _myProject.current_user_role_id.integerValue >= 80) {
252252
__weak typeof(self) weakSelf = self;
253253
[[Coding_NetAPIManager sharedManager] request_Project_UpdateVisit_WithObj:_myProject andBlock:^(id data, NSError *error) {
254254
if (data) {

Coding_iOS/Controllers/RootControllers/Project_RootViewController.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ -(void)gotoNewProject{
192192
- (void)goToProject:(Project *)project{
193193
Projects *curPros = [_myProjectsDict objectForKey:[NSNumber numberWithUnsignedInteger:_myCarousel.currentItemIndex]];
194194
NProjectViewController *vc = [[NProjectViewController alloc] init];
195-
vc.needUpdateVisit = (curPros.type < ProjectsTypeTaProject);
196195
vc.myProject = project;
197196
[self.navigationController pushViewController:vc animated:YES];
198197
}

Coding_iOS/Models/Project.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#import <Foundation/Foundation.h>
1010

1111
@interface Project : NSObject
12-
@property (readwrite, nonatomic, strong) NSString *icon, *name, *owner_user_name, *backend_project_path, *full_name, *description_mine, *path, *parent_depot_path;
13-
@property (readwrite, nonatomic, strong) NSNumber *id, *owner_id, *is_public, *un_read_activities_count, *done, *processing, *star_count, *stared, *watch_count, *watched, *fork_count, *forked, *recommended, *pin;
12+
@property (readwrite, nonatomic, strong) NSString *icon, *name, *owner_user_name, *backend_project_path, *full_name, *description_mine, *path, *parent_depot_path, *current_user_role;
13+
@property (readwrite, nonatomic, strong) NSNumber *id, *owner_id, *is_public, *un_read_activities_count, *done, *processing, *star_count, *stared, *watch_count, *watched, *fork_count, *forked, *recommended, *pin, *current_user_role_id;
1414
@property (assign, nonatomic) BOOL isStaring, isWatching, isLoadingMember, isLoadingDetail;
1515

1616
+ (Project *)project_All;

Coding_iOS/Models/Project.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ -(NSDictionary *)toDeleteParamsWithPassword:(NSString *)password{
8484
}
8585

8686
- (NSString *)toMembersPath{
87-
return [NSString stringWithFormat:@"api/project/%d/members", self.id.intValue];
87+
if ([_id isKindOfClass:[NSNumber class]]) {
88+
return [NSString stringWithFormat:@"api/project/%d/members", self.id.intValue];
89+
}else{
90+
return [NSString stringWithFormat:@"api/user/%@/project/%@/members", _owner_user_name, _name];
91+
}
8892
}
8993
- (NSDictionary *)toMembersParams{
9094
return @{@"page" : [NSNumber numberWithInteger:1],

0 commit comments

Comments
 (0)