Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
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
wangtao
projecttwo
Commits
a23d313f
Commit
a23d313f
authored
May 26, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5.26
parent
f00549db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
7 deletions
+34
-7
PayController.php
app/api/controller/PayController.php
+4
-6
User.php
app/api/controller/mine/User.php
+29
-0
services.php
vendor/services.php
+1
-1
No files found.
app/api/controller/PayController.php
View file @
a23d313f
...
...
@@ -12,9 +12,7 @@ use think\App;
class
PayController
{
protected
$middleware
=
[
Auth
::
class
,
];
/**
* 创建支付订单
...
...
@@ -85,8 +83,8 @@ class PayController
// 发起支付
$alipay
=
Pay
::
alipay
(
PayService
::
getPayConfig
(
PayService
::
PAY_METHOD_ALIPAY
))
->
web
(
$order
);
return
$alipay
->
send
(
);
//
return redirect($alipay->getTargetUrl());
halt
(
$alipay
);
return
redirect
(
$alipay
->
getTargetUrl
());
}
catch
(
\Exception
$e
)
{
Log
::
error
(
"支付创建错误:
{
$orderNo
}
- "
.
$e
->
getMessage
());
return
json
([
'code'
=>
500
,
'msg'
=>
$e
->
getMessage
()]);
...
...
@@ -143,7 +141,7 @@ class PayController
$alipay
=
Pay
::
alipay
(
PayService
::
getPayConfig
(
PayService
::
PAY_METHOD_ALIPAY
));
try
{
$data
=
$alipay
->
verify
();
$data
=
Pay
::
alipay
()
->
callback
();
// 处理支付回调
$result
=
PayService
::
handlePaymentNotify
(
$data
->
out_trade_no
,
$data
->
all
());
...
...
app/api/controller/mine/User.php
View file @
a23d313f
...
...
@@ -229,5 +229,34 @@ class User extends BaseController
}
public
function
editPassword
(
Request
$request
)
{
$vo
=
(
new
UserValidate
())
->
goCheck
([
'confirm_password'
,
'password'
,
'old_password'
]);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$data
=
$request
->
param
();
$userId
=
$request
->
userId
;
$user
=
userModel
::
where
(
'id'
,
$userId
)
->
find
();
if
(
!
$user
)
{
return
$this
->
returnMsg
(
'用户不存在'
,
0
);
}
$data
[
'old_password'
]
=
md5
(
$data
[
'old_password'
]
.
$user
[
'salt'
]);
if
(
$data
[
'old_password'
]
!=
$user
[
'password'
])
{
return
$this
->
returnMsg
(
'密码不正确'
);
}
userModel
::
where
(
'id'
,
$userId
)
->
update
([
'password'
=>
md5
(
$data
[
'password'
]
.
$user
[
'salt'
])]);
return
$this
->
returnMsg
(
'success'
,
1
);
}
}
\ No newline at end of file
vendor/services.php
View file @
a23d313f
<?php
// This file is automatically generated at:2025-05-23 1
6:08:4
6
// This file is automatically generated at:2025-05-23 1
7:01:1
6
declare
(
strict_types
=
1
);
return
array
(
0
=>
'think\\captcha\\CaptchaService'
,
...
...
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