Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mancheng
Commits
eb8aa65b
Commit
eb8aa65b
authored
Jun 27, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230619
parent
2f4da1f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
apps/view_user/view.py
+1
-1
apps/view_xiaocx/view.py
+10
-3
No files found.
apps/view_user/view.py
View file @
eb8aa65b
...
@@ -248,7 +248,7 @@ def login_bypwd():
...
@@ -248,7 +248,7 @@ def login_bypwd():
if
access_nums
:
if
access_nums
:
if
int
(
access_nums
.
decode
())
>=
constants
.
LOGIN_ERROR_TIMES
:
if
int
(
access_nums
.
decode
())
>=
constants
.
LOGIN_ERROR_TIMES
:
lock_time
=
redis_store
.
ttl
(
'jincheng_access_nums_{}'
.
format
(
user_ip
))
lock_time
=
redis_store
.
ttl
(
'jincheng_access_nums_{}'
.
format
(
user_ip
))
return
jsonify
(
code
=
RET
.
LOCKTIME
,
msg
=
"ip锁定倒计时中
....."
,
lock_time
=
lock_time
)
return
jsonify
(
code
=
RET
.
LOCKTIME
,
msg
=
"ip锁定倒计时中
,还剩{}秒!"
.
format
(
lock_time
)
,
lock_time
=
lock_time
)
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
else
:
else
:
...
...
apps/view_xiaocx/view.py
View file @
eb8aa65b
...
@@ -300,7 +300,7 @@ def introduction_meet():
...
@@ -300,7 +300,7 @@ def introduction_meet():
flag
=
req_dict
.
get
(
"flag"
)
flag
=
req_dict
.
get
(
"flag"
)
try
:
try
:
meet_obj_list
=
IntroductionMeet
.
query
.
filter
(
IntroductionMeet
.
flag
==
flag
)
.
paginate
(
page
,
perpage
)
.
items
meet_obj_list
=
IntroductionMeet
.
query
.
filter
(
IntroductionMeet
.
flag
==
flag
)
.
order_by
(
IntroductionMeet
.
time
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
meet_count
=
IntroductionMeet
.
query
.
count
()
meet_count
=
IntroductionMeet
.
query
.
count
()
data
=
[{
data
=
[{
...
@@ -1006,14 +1006,20 @@ def wechat_login():
...
@@ -1006,14 +1006,20 @@ def wechat_login():
# 参数获取与校验
# 参数获取与校验
req_dict
=
request
.
get_json
()
req_dict
=
request
.
get_json
()
code
=
req_dict
.
get
(
'code'
)
# 微信登录code
code
=
req_dict
.
get
(
'code'
)
# 微信登录code
flag
=
req_dict
.
get
(
'flag'
)
# 微信登录code
print
(
flag
)
# 校验参数完整性
# 校验参数完整性
if
not
all
([
code
]):
if
not
all
([
code
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"Parameter incompleteness!"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"Parameter incompleteness!"
)
# app_id = 'wx67c0a99d684274f8'
# app_id = 'wx67c0a99d684274f8'
# app_secret = 'd89755bb5d2d3f85e97d0f08c30dbebc'
# app_secret = 'd89755bb5d2d3f85e97d0f08c30dbebc'
app_id
=
'wx78f5fa8193a9d06a'
if
flag
==
1
:
# 投资晋城
app_secret
=
'c7a57d430061fb4ca131e5148ff0e6fe'
app_id
=
'wx78f5fa8193a9d06a'
app_secret
=
'c7a57d430061fb4ca131e5148ff0e6fe'
if
flag
==
2
:
# jinlaitou
app_id
=
'wx67c0a99d684274f8'
app_secret
=
'd89755bb5d2d3f85e97d0f08c30dbebc'
data
=
{
"code"
:
code
}
data
=
{
"code"
:
code
}
# 获取token
# 获取token
url
=
u'https://api.weixin.qq.com/cgi-bin/token'
url
=
u'https://api.weixin.qq.com/cgi-bin/token'
...
@@ -1029,6 +1035,7 @@ def wechat_login():
...
@@ -1029,6 +1035,7 @@ def wechat_login():
# 获取电话号码
# 获取电话号码
url1
=
u"https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token={}"
.
format
(
access_token
)
url1
=
u"https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token={}"
.
format
(
access_token
)
res1
=
requests
.
post
(
url1
,
json
=
data
)
.
json
()
res1
=
requests
.
post
(
url1
,
json
=
data
)
.
json
()
print
(
res1
)
user_info
=
''
user_info
=
''
if
res1
[
'errmsg'
]
==
'ok'
:
if
res1
[
'errmsg'
]
==
'ok'
:
mobile
=
res1
[
'phone_info'
][
"phoneNumber"
]
mobile
=
res1
[
'phone_info'
][
"phoneNumber"
]
...
...
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