摘要:
背景: get请求/sanctum/csrf-cookie,常用于登录,代码如下: return this.http.get<any>(this.apiURL + ':' + this.port + '/sanctum/csrf-cookie', { withCredentials: true }) 阅读全文
posted @ 2022-04-28 14:46
jamstack
阅读(741)
评论(0)
推荐(0)
摘要:
Short answer: withCredentials() makes your browser include cookies and authentication headers in your XHR request. If your service depends on any cook 阅读全文
posted @ 2022-04-28 14:11
jamstack
阅读(26)
评论(0)
推荐(0)
摘要:
下面这篇文章对sanctum介绍的比较全面,可以作为参考 https://learnku.com/docs/laravel/8.x/sanctum/9421 阅读全文
posted @ 2022-04-28 13:46
jamstack
阅读(114)
评论(0)
推荐(0)
摘要:
背景: 父模块的pom.xml引入jwt的依赖,如下: <!-- jwt --> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt-api</artifactId> <version>0.11.1</version> < 阅读全文
posted @ 2022-04-28 13:33
jamstack
阅读(406)
评论(0)
推荐(0)
摘要:
参考资料: https://www.geeksforgeeks.org/new-self-vs-new-static-in-php/ 阅读全文
posted @ 2022-04-28 02:25
jamstack
阅读(16)
评论(0)
推荐(0)
摘要:
背景: 在之前的文章里,介绍了APP_KEY的生成原理和作用,APP_KEY其中的一个主要目的就是用于laravel实现对cookie的加密。 laravel首先会通过src/Illuminate/Encryption/EncryptionServiceProvider.php里的parseKey方 阅读全文
posted @ 2022-04-28 01:31
jamstack
阅读(129)
评论(0)
推荐(0)
摘要:
有两种方法 第一种: use Illuminate\Support\Facades\Log; Log::info(json_encode($user); 第二种: use Illuminate\Support\Facades\Log; Log::info(print_r($user, true)); 阅读全文
posted @ 2022-04-28 01:16
jamstack
阅读(213)
评论(0)
推荐(0)
摘要:
Gates are simply closures that determine if a user is authorized to perform a given action. 参考资料: https://laravel.com/docs/9.x/authorization 阅读全文
posted @ 2022-04-28 01:11
jamstack
阅读(34)
评论(0)
推荐(0)