Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
db571a61
Commit
db571a61
authored
Aug 02, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc验证
parent
f8d35881
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
47 deletions
+63
-47
Login.php
application/index/controller/Login.php
+9
-8
login.html
application/index/view/login/login.html
+1
-0
login.js
public/resource/js/login.js
+53
-39
No files found.
application/index/controller/Login.php
View file @
db571a61
...
@@ -52,6 +52,7 @@ class Login extends Basic
...
@@ -52,6 +52,7 @@ class Login extends Basic
$name
=
$this
->
params
[
"username"
];
$name
=
$this
->
params
[
"username"
];
$password
=
$this
->
params
[
"password"
];
$password
=
$this
->
params
[
"password"
];
$model
=
$this
->
params
[
"model"
];
$model
=
$this
->
params
[
"model"
];
$only_id
=
$this
->
params
[
"only_id"
];
if
(
empty
(
$name
)
||
empty
(
$password
))
{
if
(
empty
(
$name
)
||
empty
(
$password
))
{
return
$this
->
response
(
101
,
'用户名或密码不能为空'
);
return
$this
->
response
(
101
,
'用户名或密码不能为空'
);
...
@@ -79,13 +80,13 @@ class Login extends Basic
...
@@ -79,13 +80,13 @@ class Login extends Basic
}
}
$last_login_ip
=
ip2long
(
$this
->
request
->
ip
());
$last_login_ip
=
ip2long
(
$this
->
request
->
ip
());
/*
if ($user_data['id'] != 1) {
if
(
$user_data
[
'id'
]
!=
1
)
{
//判断设备id是否存在
//判断设备id是否存在
$is_login = $this->brokerService->judgeBand($
last_login_ip
, $user_data['id'], $model, 0, $user_data['phone'], 1);
$is_login
=
$this
->
brokerService
->
judgeBand
(
$
only_id
,
$user_data
[
'id'
],
$model
,
0
,
$user_data
[
'phone'
],
1
);
if
(
!
$is_login
)
{
if
(
!
$is_login
)
{
return
$this
->
response
(
"102"
,
"该账号没有绑定该设备,请致电人事进行绑定。"
);
return
$this
->
response
(
"102"
,
"该账号没有绑定该设备,请致电人事进行绑定。"
);
}
}
}
*/
}
$where_rule
[
'status'
]
=
0
;
$where_rule
[
'status'
]
=
0
;
if
(
$user_data
[
'id'
]
==
1
)
{
if
(
$user_data
[
'id'
]
==
1
)
{
...
@@ -123,11 +124,11 @@ class Login extends Basic
...
@@ -123,11 +124,11 @@ class Login extends Basic
return
$this
->
response
(
101
,
'内部错误,请联系运营!'
.
$e
->
getMessage
());
return
$this
->
response
(
101
,
'内部错误,请联系运营!'
.
$e
->
getMessage
());
}
}
$jwt
=
new
JwtUntils
();
$jwt
=
new
JwtUntils
();
$jwt_data
[
'id'
]
=
$user_data
[
'id'
];
$jwt_data
[
'id'
]
=
$user_data
[
'id'
];
$jwt_data
[
'name'
]
=
$user_data
[
'name'
];
$jwt_data
[
'name'
]
=
$user_data
[
'name'
];
$jwt_data
[
'phone'
]
=
$user_data
[
'phone'
];
$jwt_data
[
'phone'
]
=
$user_data
[
'phone'
];
$jwt_data
[
'level'
]
=
$user_data
[
'level'
];
$jwt_data
[
'level'
]
=
$user_data
[
'level'
];
$user_data
[
'AuthToken'
]
=
$jwt
->
createToken
(
$jwt_data
);
$user_data
[
'AuthToken'
]
=
$jwt
->
createToken
(
$jwt_data
);
Session
::
set
(
"userName"
,
$user_data
[
"name"
]);
Session
::
set
(
"userName"
,
$user_data
[
"name"
]);
...
...
application/index/view/login/login.html
View file @
db571a61
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
</footer>
</footer>
<script
src=
"/resource/lib/js/jquery-2.0.3.min.js"
></script>
<script
src=
"/resource/lib/js/jquery-2.0.3.min.js"
></script>
<script
src=
"https://wx.gtimg.com/wxpay_h5/fingerprint2.min.1.5.1.js"
></script>
<script
src=
"/resource/js/login.js"
></script>
<script
src=
"/resource/js/login.js"
></script>
</body>
</body>
...
...
public/resource/js/login.js
View file @
db571a61
...
@@ -91,49 +91,62 @@ $(function() {
...
@@ -91,49 +91,62 @@ $(function() {
}
}
}
}
var
fp
=
new
Fingerprint2
();
var
only_id
=
""
;
fp
.
get
(
function
(
result
){
//alert(result);
only_id
=
result
;
//result即为获取到的浏览器指纹值
var
browser_version
=
NV
.
shell
+
'/'
+
NV
.
version
;
console
.
log
(
browser_version
);
$
.
ajax
({
type
:
'POST'
,
url
:
'/admin.php/index/loginVerify'
,
data
:
{
'username'
:
_userName
,
'password'
:
_passWord
,
'model'
:
browser_version
,
'only_id'
:
only_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{
_loginBtn
.
hide
();
_loginTempBtn
.
show
();
},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
localStorage
.
setItem
(
'pcUserInfo'
,
encodeURIComponent
(
JSON
.
stringify
(
data
.
data
)));
//存储PC后台登录用户所有信息
location
.
href
=
'/admin.php/index/getHouseList'
;
}
else
{
alert
(
data
[
'msg'
]);
};
}
else
{
alert
(
'数据错误'
);
};
},
error
:
function
()
{
alert
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
)
{
_loginTempBtn
.
hide
();
_loginBtn
.
show
();
if
(
textStatus
===
'timeout'
)
{
alert
(
'请求超时'
);
};
}
});
});
// alert('浏览器UA=' + UA +
// alert('浏览器UA=' + UA +
// '\n\n浏览器名称=' + NV.name +
// '\n\n浏览器名称=' + NV.name +
// '\n\n浏览器版本=' + NV.version +
// '\n\n浏览器版本=' + NV.version +
// //'\n\n浏览器版本='+parseInt(NV.version)+
// //'\n\n浏览器版本='+parseInt(NV.version)+
// '\n\n浏览器外壳=' + NV.shell);
// '\n\n浏览器外壳=' + NV.shell);
var
browser_version
=
NV
.
shell
+
'/'
+
NV
.
version
;
console
.
log
(
browser_version
);
$
.
ajax
({
type
:
'POST'
,
url
:
'/admin.php/index/loginVerify'
,
data
:
{
'username'
:
_userName
,
'password'
:
_passWord
,
'model'
:
browser_version
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{
_loginBtn
.
hide
();
_loginTempBtn
.
show
();
},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
localStorage
.
setItem
(
'pcUserInfo'
,
encodeURIComponent
(
JSON
.
stringify
(
data
.
data
)));
//存储PC后台登录用户所有信息
location
.
href
=
'/admin.php/index/getHouseList'
;
}
else
{
alert
(
data
[
'msg'
]);
};
}
else
{
alert
(
'数据错误'
);
};
},
error
:
function
()
{
alert
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
)
{
_loginTempBtn
.
hide
();
_loginBtn
.
show
();
if
(
textStatus
===
'timeout'
)
{
alert
(
'请求超时'
);
};
}
});
})
})
});
});
\ No newline at end of file
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