Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
dbe69020
Commit
dbe69020
authored
Sep 10, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Plain Diff
update: 处理冲突
parents
1cc9d547
824b111a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
GoodsService.php
application/services/goods/GoodsService.php
+3
-1
UserService.php
application/services/user/UserService.php
+17
-2
No files found.
application/services/goods/GoodsService.php
View file @
dbe69020
...
...
@@ -272,7 +272,9 @@ class GoodsService
$skuParams
[
'online_status'
]
=
0
;
break
;
default
:
# code...
$skuParams
[
'online_type'
]
=
1
;
$skuParams
[
'online_status'
]
=
0
;
$skuParams
[
'online_start_time'
]
=
date
(
"Y-m-d H:i:s"
);
break
;
}
...
...
application/services/user/UserService.php
View file @
dbe69020
...
...
@@ -26,7 +26,6 @@ class UserService
public
static
function
wechatLogin
(
$params
)
{
$code
=
!
empty
(
$params
[
'code'
])
?
$params
[
'code'
]
:
''
;
//小程序授权code
$openid
=
!
empty
(
$params
[
'openid'
])
?
$params
[
'openid'
]
:
''
;
//小程序授权code
if
(
empty
(
$code
)
&&
empty
(
$openid
))
{
...
...
@@ -34,6 +33,21 @@ class UserService
throw
new
UserException
([
'cus'
=>
0
]);
}
$redis
=
RedisUtil
::
getInstance
(
'cache'
);
$key
=
"wx_wechat_login_"
.
$code
;
$keyCode
=
"wx_wechat_login_code_"
.
$code
;
$lock
=
FrequencyLockUtil
::
isLocked
(
$key
,
1
,
120
);
if
(
$lock
)
{
sleep
(
1
);
$user
=
$redis
->
get
(
$keyCode
);
if
(
!
empty
(
$user
))
{
$user
=
json_decode
(
$user
,
true
);
}
FileLog
::
error
(
"wechatLogin: lock"
,
json_encode
(
$user
,
JSON_UNESCAPED_UNICODE
),
''
,
'jianghaiming@yidian-inc.com'
);
FileLog
::
error
(
"wechatLogin: lock--params"
,
json_encode
(
$params
,
JSON_UNESCAPED_UNICODE
),
''
,
'jianghaiming@yidian-inc.com'
);
return
$user
;
}
//需要授权微信
//if (empty($openid)) {
$appid
=
\Yaf\Registry
::
get
(
'config'
)
->
wechat
->
appid
;
...
...
@@ -107,8 +121,9 @@ class UserService
];
$newWechatId
=
UserWechatBind
::
save
(
$insert
,
[
'openid'
=>
$openid
]);
}
$user
[
'third_session'
]
=
self
::
generate3rdSession
(
$openid
);
$redis
->
set
(
$keyCode
,
json_encode
(
$user
),
120
);
return
$user
;
}
...
...
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