摘要: http://www.flounder.com/ebcdictoascii1.htm https://www.browserling.com/tools/text-to-ascii https://theasciicode.com.ar/extended-ascii-code/acute-accen 阅读全文
posted @ 2022-04-28 17:43 jamstack 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 背景: laravel的Str::random或许大家都不陌生,Str::random定义在src/Illuminate/Support/Str.php,但是你知道它都有哪些应用场景吗? 先来看看,Str::random的代码逻辑,不要被最外层的while骗了,实际上这个while只会执行一次 pu 阅读全文
posted @ 2022-04-28 16:21 jamstack 阅读(828) 评论(0) 推荐(0) 编辑
摘要: 背景: 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 阅读(646) 评论(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 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 下面这篇文章对sanctum介绍的比较全面,可以作为参考 https://learnku.com/docs/laravel/8.x/sanctum/9421 阅读全文
posted @ 2022-04-28 13:46 jamstack 阅读(107) 评论(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 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 参考资料: https://www.geeksforgeeks.org/new-self-vs-new-static-in-php/ 阅读全文
posted @ 2022-04-28 02:25 jamstack 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 背景: 在之前的文章里,介绍了APP_KEY的生成原理和作用,APP_KEY其中的一个主要目的就是用于laravel实现对cookie的加密。 laravel首先会通过src/Illuminate/Encryption/EncryptionServiceProvider.php里的parseKey方 阅读全文
posted @ 2022-04-28 01:31 jamstack 阅读(100) 评论(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 阅读(191) 评论(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 阅读(22) 评论(0) 推荐(0) 编辑