0%

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if (! function_exists('dd')) {
/**
* Dump the passed variables and end the script.
*
* @param mixed $args
* @return void
*/
function dd(...$args)
{
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Headers: *');
http_response_code(500);

foreach ($args as $x) {
(new Illuminate\Support\Debug\Dumper)->dump($x);
}

die(1);
}
}

解决方法:https://github.com/laravel/passport/issues/221

In your oauth_clients table, do the values you have above exist exactly as you have them in your database?

oauth_clients

1
2
3
id - 3
secret - 3TfJGj4rrvOQvjZkI8dDqx78ouH99F2DuIMKHoKH
redirect - http://consumer.dev/callback

If it doesn't exist exactly like that in the database for passport.dev then it will throw the invalid_client error. Please be sure to check that and we will see if any further investigation is needed.

x

还需要查看 oauth_clients 表的 password_client 是否为 1

  • 什么是嵌套事务? 一般情况下我们都是一个 begin, 一个 commitrollBack, 但是有可能我们有种场景需要 begin 然后在事务里面再开一个事务, 这就是嵌套事务.

  • MySQL 嵌套事务支持

    • MySQL 里面有个 savepoint 关键字, 可以模拟嵌套事务, 但事实上并不是真正的嵌套事务, 仍然是一个事务.
    • savepoint 的用处, 我们可以回滚事务内的部分修改
  • Laravel 嵌套事务使用

    • DB::beginTransaction() 里面再次使用 DB::beginTransaction() 即可, 但需要注意开启事务的次数需要和 commitrollBack 的次数对应