Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
U
User
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
zhangjun
User
Commits
a7c58670
Commit
a7c58670
authored
Jul 07, 2022
by
zhangjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
42916212
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
8 deletions
+57
-8
constants.php
esf_core/config/constants.php
+6
-4
function_helper.php
esf_core/helpers/function_helper.php
+0
-0
user_helper.php
esf_core/helpers/user_helper.php
+30
-1
User_class.php
esf_core/libraries/User_class.php
+2
-2
user_model.php
esf_core/models/user_model.php
+19
-1
No files found.
esf_core/config/constants.php
View file @
a7c58670
...
@@ -388,11 +388,13 @@ define('GB_SEND_SMS_URL','http://user.house365.com/');
...
@@ -388,11 +388,13 @@ define('GB_SEND_SMS_URL','http://user.house365.com/');
// 提交忘记密码接口地址
// 提交忘记密码接口地址
define
(
'GB_FORGET_SMS_URL'
,
'http://user.house365.com/'
);
define
(
'GB_FORGET_SMS_URL'
,
'http://user.house365.com/'
);
// 修改手机页面地址
// 修改手机页面地址
define
(
'GB_EDIT_PHONE_URL'
,
'http://newrent.house365.com/user-center/edit-phone'
);
define
(
'GB_EDIT_PHONE_URL'
,
'http://newrent
test
.house365.com/user-center/edit-phone'
);
// 修改密码页面地址
// 修改密码页面地址
define
(
'GB_EDIT_PWD_URL'
,
'http://newrent.house365.com/user-center/edit-pwd'
);
define
(
'GB_EDIT_PWD_URL'
,
'http://newrenttest.house365.com/user-center/edit-pwd'
);
// 基于个人用户ID获取用户数据
define
(
'GB_GET_USER_INFO_BY_USER_ID_URL'
,
'http://newrenttest.house365.com/api/tf-app/get-user-info-by-personal-id'
);
// 基于sso_token获取用户数据
define
(
'GB_GET_USER_INFO_BY_SSO_URL'
,
'http://ucentertest.house365.com/index/user/info'
);
if
(
$_SERVER
[
'SERVER_ADDR'
]
==
'192.168.105.106'
)
if
(
$_SERVER
[
'SERVER_ADDR'
]
==
'192.168.105.106'
)
...
...
esf_core/helpers/function_helper.php
View file @
a7c58670
This diff is collapsed.
Click to expand it.
esf_core/helpers/user_helper.php
View file @
a7c58670
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
$ci
->
load
->
model
(
'user_model'
);
$ci
->
load
->
model
(
'user_model'
);
getLoginInfoBySSO
();
getLoginInfoBySSO
Ucenter
();
if
(
!
empty
(
$_COOKIE
[
'esfuserid'
])
&&
!
empty
(
$_COOKIE
[
'esfpassword'
]))
if
(
!
empty
(
$_COOKIE
[
'esfuserid'
])
&&
!
empty
(
$_COOKIE
[
'esfpassword'
]))
{
{
...
@@ -67,6 +67,35 @@
...
@@ -67,6 +67,35 @@
return
$info
;
return
$info
;
}
}
function
getLoginInfoBySSOUcenter
(){
if
(
empty
(
$_COOKIE
[
'sso_token'
])){
return
false
;
}
$ci
=
&
get_instance
();
if
(
empty
(
$_COOKIE
[
'esfuserid'
])
||
empty
(
$_COOKIE
[
'esfpassword'
])){
$url
=
GB_GET_USER_INFO_BY_SSO_URL
;
$cookieStr
=
"sso_token="
.
$_COOKIE
[
'sso_token'
];
$info
=
curl_get_contents_new
(
$url
,
''
,
$cookieStr
);
if
(
is_array
(
$info
)
&&
!
empty
(
$info
)){
if
(
isset
(
$info
[
'data'
][
'id'
])
&&
$info
[
'data'
][
'id'
])
{
$passport_uid
=
$info
[
'data'
][
'id'
];
$ci
->
load
->
model
(
'user_model'
);
$user
=
$ci
->
user_model
->
get_data
(
array
(
'form_name'
=>
'personal_user'
,
'where'
=>
array
(
'passport_uid'
=>
$passport_uid
),
'select'
=>
array
(
'id'
,
'telno'
,
'password'
)),
'dbuser'
);
if
(
$user
){
$esfuserid
=
$user
[
0
][
'id'
];
$esfpassword
=
$user
[
0
][
'password'
];
setcookie
(
'esfuserid'
,
$esfuserid
,
time
()
+
3600
*
24
*
7
,
'/'
,
'.house365.com'
);
setcookie
(
'esfpassword'
,
$esfpassword
,
time
()
+
3600
*
24
*
7
,
'/'
,
'.house365.com'
);
}
}
}
else
{
return
false
;
}
}
return
$info
;
}
function
getmesnumbyuidwd
()
function
getmesnumbyuidwd
()
{
{
...
...
esf_core/libraries/User_class.php
View file @
a7c58670
...
@@ -26,7 +26,7 @@ class User_class
...
@@ -26,7 +26,7 @@ class User_class
if
(
$telno
==
''
)
if
(
$telno
==
''
)
{
{
$temp
=
$CI
->
user_model
->
getuserdetail
(
$result
);
$temp
=
$CI
->
user_model
->
getuserdetail
Ucenter
(
$result
);
$telno
=
$temp
[
'telno'
];
$telno
=
$temp
[
'telno'
];
}
}
$password_encrypt
=
passport_encrypt
(
$password
);
$password_encrypt
=
passport_encrypt
(
$password
);
...
@@ -71,7 +71,7 @@ class User_class
...
@@ -71,7 +71,7 @@ class User_class
$CI
->
load
->
model
(
'user_model'
);
$CI
->
load
->
model
(
'user_model'
);
//查询上次登录时间
//查询上次登录时间
$last_logintime
=
$CI
->
user_model
->
getuserdetail
(
$result
);
$last_logintime
=
$CI
->
user_model
->
getuserdetail
Ucenter
(
$result
);
if
(
date
(
"Y-m-d"
,
$last_logintime
[
'lastlogintime'
])
!=
date
(
"Y-m-d"
))
if
(
date
(
"Y-m-d"
,
$last_logintime
[
'lastlogintime'
])
!=
date
(
"Y-m-d"
))
{
{
...
...
esf_core/models/user_model.php
View file @
a7c58670
...
@@ -557,7 +557,7 @@ class User_model extends MY_Model
...
@@ -557,7 +557,7 @@ class User_model extends MY_Model
if
(
$check_login
>
0
)
if
(
$check_login
>
0
)
{
{
$_SESSION
[
'esfuserid'
]
=
$check_login
;
$_SESSION
[
'esfuserid'
]
=
$check_login
;
$user
=
$this
->
getuserdetail
(
$check_login
);
$user
=
$this
->
getuserdetail
Ucenter
(
$check_login
);
//赋值SESSION
//赋值SESSION
$array
=
array
(
'esfuserid'
=>
$user
[
'id'
]
,
'esfpassword'
=>
$user
[
'password'
]
,
'esfusername'
=>
$user
[
'username'
]
,
'esfusertelno'
=>
$user
[
'telno'
]
,
'esfusercity'
=>
GB_CITY
,
'esfshowname'
=>
$_COOKIE
[
'esfshowname'
]);
$array
=
array
(
'esfuserid'
=>
$user
[
'id'
]
,
'esfpassword'
=>
$user
[
'password'
]
,
'esfusername'
=>
$user
[
'username'
]
,
'esfusertelno'
=>
$user
[
'telno'
]
,
'esfusercity'
=>
GB_CITY
,
'esfshowname'
=>
$_COOKIE
[
'esfshowname'
]);
...
@@ -795,6 +795,24 @@ class User_model extends MY_Model
...
@@ -795,6 +795,24 @@ class User_model extends MY_Model
}
}
}
}
/**
* 验证是否该用户已注册过手机号
* @param type $uid
* @return string
*/
function
getuserdetailUcenter
(
$uid
)
{
$url
=
GB_GET_USER_INFO_BY_USER_ID_URL
.
'?uid='
.
$uid
;
$userRes
=
curl_get_contents
(
$url
);
$userInfo
=
!
empty
(
$userRes
)
?
json_decode
(
$userRes
,
1
)
:
array
();
if
(
isset
(
$userInfo
[
'data'
])
&&
!
empty
(
$userInfo
[
'data'
]))
{
return
$userInfo
[
'data'
];
}
else
{
return
array
();
}
}
/**
/**
* 获取所有的房源特色标签
* 获取所有的房源特色标签
...
...
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