Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
万
万科
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
万科
Commits
5959242c
Commit
5959242c
authored
9 years ago
by
Achilles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add authorizedorgs
parent
109f149b
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
120 additions
and
70 deletions
+120
-70
ICRSystemHeaderView.m
vanke/3rd/General/Views/ICRSystemHeaderView.m
+7
-9
VankeConfig.h
vanke/VankeConfig.h
+2
-5
VankeBaseAPI.m
vanke/controller/VankeBaseAPI.m
+1
-1
VankeUserLoginAPI.h
vanke/controller/VankeUserLoginAPI.h
+17
-14
VankeUserLoginAPI.m
vanke/controller/VankeUserLoginAPI.m
+4
-1
VankeCommonModel.h
vanke/model/VankeCommonModel.h
+43
-5
VankeCommonModel.m
vanke/model/VankeCommonModel.m
+38
-24
VankeUserModel.m
vanke/model/VankeUserModel.m
+3
-6
VankeAffairsBoard_iPhone.m
.../view_iPhone/templates/affairs/VankeAffairsBoard_iPhone.m
+1
-1
VankeLoginBoard_iPhone.m
vanke/view_iPhone/templates/login/VankeLoginBoard_iPhone.m
+1
-1
ICRSystemViewController.m
.../view_iPhone/templates/settings/ICRSystemViewController.m
+1
-1
VankeSettingsBoard_iPhone.m
...iew_iPhone/templates/settings/VankeSettingsBoard_iPhone.m
+2
-2
No files found.
vanke/3rd/General/Views/ICRSystemHeaderView.m
View file @
5959242c
...
...
@@ -159,17 +159,15 @@
@implementation
ICRSystemHeaderView
(
Configure
)
-
(
void
)
updateWithUserUtil
{
// ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
// [self updateWithCompanyName:userUtil.orgName
// companyIcon:nil
// user:userUtil.displayName
// code:userUtil.orgCode];
-
(
void
)
updateWithUserUtil
{
VankeCommonModel
*
userModel
=
[
VankeCommonModel
sharedInstance
];
User
*
user
=
[
userModel
currentUser
];
Enterpirse
*
ent
=
[
userModel
currentEnterprise
];
LoginResponseData
*
data
=
[
userModel
getLoginInfo
];
if
(
nil
==
data
)
{
return
;
}
User
*
user
=
[
data
getUser
];
Enterpirse
*
ent
=
[
data
getEnterprise
];
[
self
updateWithCompanyName
:
ent
.
name
companyIcon
:
nil
user
:
user
.
name
...
...
This diff is collapsed.
Click to expand it.
vanke/VankeConfig.h
View file @
5959242c
...
...
@@ -9,11 +9,8 @@
#ifndef VankeConfig_h
#define VankeConfig_h
// 当前用户
#define KEY_CURRENT_USER @"VANKE_CUR_USER"
// 当前企业
#define KEY_CURRENT_ENT @"VANKE_CUR_ENT"
// 当前用户信息
#define KEY_CURRENT_USER_INFO @"VANKE_CUR_USER_INFO"
// 当前用户密码
#define KEY_CURRENT_USER_PWD @"VANKE_CUR_USER_PWD"
...
...
This diff is collapsed.
Click to expand it.
vanke/controller/VankeBaseAPI.m
View file @
5959242c
...
...
@@ -58,7 +58,7 @@
}
-
(
VankeBaseAPI
*
)
addEnterpriseIdToHeader
:
(
BeeHTTPRequest
*
)
req
{
Enterpirse
*
ent
=
[[
VankeCommonModel
sharedInstance
]
currentEnt
erprise
];
Enterpirse
*
ent
=
[[
VankeCommonModel
sharedInstance
]
currentEnt
];
if
(
nil
!=
ent
&&
!
[
VankeUtil
isBlankString
:
ent
.
uuid
])
{
req
.
HEADER
(
@"enterprise"
,
ent
.
uuid
);
}
...
...
This diff is collapsed.
Click to expand it.
vanke/controller/VankeUserLoginAPI.h
View file @
5959242c
...
...
@@ -47,6 +47,20 @@
@end
// 授权组织
@interface
AuthorizedOrg
:
BeeActiveObject
// 标识
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
// 代码
@property
(
nonatomic
,
strong
)
NSString
*
code
;
// 名称
@property
(
nonatomic
,
strong
)
NSString
*
name
;
// 图片
@property
(
nonatomic
,
strong
)
NSString
*
picture
;
@end
// 登录响应数据
@interface
LoginResponseData
:
BeeActiveObject
...
...
@@ -72,26 +86,15 @@
// 企业认证码
@property
(
nonatomic
,
strong
)
NSString
*
authenticode
;
// 授权组织
@property
(
nonatomic
,
strong
)
NSArray
*
authorizedOrgs
;
-
(
User
*
)
getUser
;
-
(
Enterpirse
*
)
getEnterprise
;
@end
// 授权组织
@interface
AuthorizedOrg
:
BeeActiveObject
// 标识
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
// 代码
@property
(
nonatomic
,
strong
)
NSString
*
code
;
// 名称
@property
(
nonatomic
,
strong
)
NSString
*
name
;
// 图片
@property
(
nonatomic
,
strong
)
NSString
*
picture
;
@end
// 登录请求返回
@interface
LoginResponse
:
VankeResponse
@property
(
nonatomic
,
strong
)
LoginResponseData
*
data
;
...
...
This diff is collapsed.
Click to expand it.
vanke/controller/VankeUserLoginAPI.m
View file @
5959242c
...
...
@@ -24,7 +24,7 @@
return
;
}
NSString
*
url
=
[
NSString
stringWithFormat
:
@"/user/login/%@"
,
self
.
userName
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"/
wanke/
user/login/%@"
,
self
.
userName
];
NSString
*
encryptPwd
=
[
VankeUtil
md5
:
self
.
password
];
NSDictionary
*
dict
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:
self
.
authenticode
,
@"authenticode"
,
...
...
@@ -95,6 +95,9 @@
@synthesize
enterprise_code
;
@synthesize
enterprise_name
;
@synthesize
authenticode
;
@synthesize
authorizedOrgs
;
CONVERT_PROPERTY_CLASS
(
authorizedOrgs
,
AuthorizedOrg
)
-
(
User
*
)
getUser
{
if
([
VankeUtil
isBlankString
:
self
.
user_uuid
])
{
...
...
This diff is collapsed.
Click to expand it.
vanke/model/VankeCommonModel.h
View file @
5959242c
...
...
@@ -16,17 +16,55 @@
AS_SINGLETON
(
VankeCommonModel
)
-
(
void
)
saveLoginUser
:
(
User
*
)
user
password
:
(
NSString
*
)
password
enterprise
:
(
Enterpirse
*
)
enterprise
;
/**
* 保存登录信息
*
* @param info 登录请求响应,传入nil表示清空当前人员信息
* @param password 密码
*/
-
(
void
)
saveLoginInfo
:
(
LoginResponseData
*
)
info
password
:
(
NSString
*
)
password
;
/**
* 取得当前登录人员信息
*
* @return 人员信息,找不到返回nil
*/
-
(
LoginResponseData
*
)
getLoginInfo
;
/**
* 删除当前登录信息
*/
-
(
void
)
removeLoginInfo
;
/**
* 当前登录人员基本信息
*
* @return 人员基本信息,找不到返回nil.
*/
-
(
User
*
)
currentUser
;
-
(
Enterpirse
*
)
currentEnterprise
;
/**
* 当前登录人员的所属组织信息
*
* @return 组织基本信息,找不到返回nil.
*/
-
(
Enterpirse
*
)
currentEnt
;
/**
* 当前人员的授权组织列表
*
* @return 组织列表,找不到nil
*/
-
(
NSArray
*
)
getAuthOrgs
;
-
(
NSString
*
)
currentUserPassword
;
/**
* 当前登录人员的登录密码
*
* @return 明文密码,找不到返回nil.
*/
-
(
NSString
*
)
currentUserPwd
;
-
(
void
)
removeCurrentUser
;
-
(
NSArray
*
)
getAuthorizedOrgs
;
@end
...
...
This diff is collapsed.
Click to expand it.
vanke/model/VankeCommonModel.m
View file @
5959242c
...
...
@@ -16,47 +16,57 @@
DEF_SINGLETON
(
VankeCommonModel
)
-
(
void
)
saveLoginUser
:
(
User
*
)
user
password
:
(
NSString
*
)
password
enterprise
:
(
Enterpirse
*
)
enterprise
{
if
(
nil
!=
user
)
{
[
self
userDefaultsWrite
:[
user
objectToDictionary
]
forKey
:
KEY_CURRENT_USER
];
}
if
(
nil
!=
enterprise
)
{
[
self
userDefaultsWrite
:[
enterprise
objectToDictionary
]
forKey
:
KEY_CURRENT_ENT
];
-
(
void
)
saveLoginInfo
:
(
LoginResponseData
*
)
info
password
:
(
NSString
*
)
password
{
if
(
nil
==
info
)
{
[
self
removeLoginInfo
];
return
;
}
[
self
userDefaultsWrite
:[
info
objectToDictionary
]
forKey
:
KEY_CURRENT_USER_INFO
];
[
self
keychainWrite
:
password
forKey
:
KEY_CURRENT_USER_PWD
];
}
-
(
User
*
)
currentUser
{
NSDictionary
*
dict
=
[
self
userDefaultsRead
:
KEY_CURRENT_USER
];
-
(
LoginResponseData
*
)
getLoginInfo
{
NSDictionary
*
dict
=
[
self
userDefaultsRead
:
KEY_CURRENT_USER_INFO
];
if
(
nil
==
dict
)
{
return
nil
;
}
return
[
User
objectFromDictionary
:
dict
];
return
[
LoginResponseData
objectFromDictionary
:
dict
];
}
-
(
Enterpirse
*
)
currentEnterprise
{
NSDictionary
*
dict
=
[
self
userDefaultsRead
:
KEY_CURRENT_ENT
];
if
(
nil
==
dict
)
{
return
nil
;
}
return
[
Enterpirse
objectFromDictionary
:
dict
];
-
(
void
)
removeLoginInfo
{
[
self
userDefaultsRemove
:
KEY_CURRENT_USER_INFO
];
[
self
keychainDelete
:
KEY_CURRENT_USER_PWD
];
}
-
(
NSString
*
)
currentUserPassword
{
return
[
self
keychainRead
:
KEY_CURRENT_USER_PWD
];
-
(
User
*
)
currentUser
{
LoginResponseData
*
data
=
[
self
getLoginInfo
];
if
(
nil
!=
data
)
{
return
[
data
getUser
];
}
else
{
return
nil
;
}
}
-
(
void
)
removeCurrentUser
{
[
self
userDefaultsRemove
:
KEY_CURRENT_USER
];
[
self
userDefaultsRemove
:
KEY_CURRENT_ENT
];
[
self
keychainDelete
:
KEY_CURRENT_USER_PWD
];
-
(
Enterpirse
*
)
currentEnt
{
LoginResponseData
*
data
=
[
self
getLoginInfo
];
if
(
nil
!=
data
)
{
return
[
data
getEnterprise
];
}
else
{
return
nil
;
}
}
-
(
NSArray
*
)
getAuthorizedOrgs
{
-
(
NSArray
*
)
getAuthOrgs
{
// LoginResponseData *data = [self getLoginInfo];
// if (nil != data) {
// return data.authorizedOrgs;
// } else {
// return nil;
// }
// TODO FOR TEST
NSMutableArray
*
ary
=
[[
NSMutableArray
alloc
]
initWithCapacity
:
20
];
for
(
int
i
=
0
;
i
<
20
;
++
i
)
{
AuthorizedOrg
*
org
=
[[
AuthorizedOrg
alloc
]
init
];
...
...
@@ -69,4 +79,8 @@ DEF_SINGLETON(VankeCommonModel)
return
ary
;
}
-
(
NSString
*
)
currentUserPwd
{
return
[
self
keychainRead
:
KEY_CURRENT_USER_PWD
];
}
@end
This diff is collapsed.
Click to expand it.
vanke/model/VankeUserModel.m
View file @
5959242c
...
...
@@ -77,7 +77,7 @@
-
(
void
)
autoLogin
{
User
*
curUser
=
[[
VankeCommonModel
sharedInstance
]
currentUser
];
NSString
*
userName
=
curUser
.
code
;
NSString
*
password
=
[[
VankeCommonModel
sharedInstance
]
currentUserP
asswor
d
];
NSString
*
password
=
[[
VankeCommonModel
sharedInstance
]
currentUserP
w
d
];
[
self
login
:
userName
password
:
password
];
}
...
...
@@ -85,12 +85,9 @@
LoginResponse
*
resp
=
[
self
getServerResp
];
if
(
nil
==
resp
||
nil
==
resp
.
data
)
{
return
;
}
else
{
[[
VankeCommonModel
sharedInstance
]
saveLoginInfo
:
resp
.
data
password
:
password
];
}
LoginResponseData
*
respData
=
resp
.
data
;
User
*
user
=
[
respData
getUser
];
Enterpirse
*
ent
=
[
respData
getEnterprise
];
[[
VankeCommonModel
sharedInstance
]
saveLoginUser
:
user
password
:
password
enterprise
:
ent
];
}
@end
This diff is collapsed.
Click to expand it.
vanke/view_iPhone/templates/affairs/VankeAffairsBoard_iPhone.m
View file @
5959242c
...
...
@@ -44,7 +44,7 @@ DEF_OUTLET( BeeUIButton, btnServiceApply )
-
(
void
)
load
{
VankeCommonModel
*
userModel
=
[
VankeCommonModel
sharedInstance
];
authorizedOrgs
=
[
userModel
getAuth
orized
Orgs
];
authorizedOrgs
=
[
userModel
getAuthOrgs
];
}
-
(
void
)
unload
...
...
This diff is collapsed.
Click to expand it.
vanke/view_iPhone/templates/login/VankeLoginBoard_iPhone.m
View file @
5959242c
...
...
@@ -100,7 +100,7 @@ ON_LOAD_DATAS( signal )
User
*
user
=
[
userModel
currentUser
];
if
(
nil
!=
user
)
{
$
(
self
.
txtUserName
).
DATA
(
user
.
code
);
$
(
self
.
txtPwd
).
DATA
([
userModel
currentUserP
asswor
d
]);
$
(
self
.
txtPwd
).
DATA
([
userModel
currentUserP
w
d
]);
}
else
{
[
self
.
txtUserName
becomeFirstResponder
];
}
...
...
This diff is collapsed.
Click to expand it.
vanke/view_iPhone/templates/settings/ICRSystemViewController.m
View file @
5959242c
...
...
@@ -187,7 +187,7 @@ ON_DID_APPEAR( signal )
-
(
void
)
doLogout
{
// 删除当前用户
VankeCommonModel
*
userModel
=
[
VankeCommonModel
sharedInstance
];
[
userModel
remove
CurrentUser
];
[
userModel
remove
LoginInfo
];
[
self
postNotification
:
self
.
SUCC_LOGOUT
];
}
...
...
This diff is collapsed.
Click to expand it.
vanke/view_iPhone/templates/settings/VankeSettingsBoard_iPhone.m
View file @
5959242c
...
...
@@ -128,7 +128,7 @@ ON_DID_DISAPPEAR( signal )
VankeCommonModel
*
userModel
=
[
VankeCommonModel
sharedInstance
];
User
*
user
=
[
userModel
currentUser
];
Enterpirse
*
ent
=
[
userModel
currentEnt
erprise
];
Enterpirse
*
ent
=
[
userModel
currentEnt
];
switch
(
indexPath
.
section
)
{
case
0
:
...
...
@@ -219,7 +219,7 @@ ON_DID_DISAPPEAR( signal )
-
(
void
)
doLogout
{
// 删除当前用户
VankeCommonModel
*
userModel
=
[
VankeCommonModel
sharedInstance
];
[
userModel
remove
CurrentUser
];
[
userModel
remove
LoginInfo
];
[
self
postNotification
:
self
.
SUCC_LOGOUT
];
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment