1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Http\Controllers\Costco;
- class CostcoController
- {
- public function index()
- {
- if (request()->cookie('password') == '菇兔君' || ($_COOKIE['password'] ?? null) == '菇兔君') {
- return \Storage::disk('secret_folder')->get(md5('costco') . '.html');
- } else {
- return '<script>
- let password = prompt("請輸入密碼");
- console.log(password);
- document.cookie = `password=${password};`;
- location.reload();
- </script>';
- }
- }
- public function serviceWorker()
- {
- $content = view('service-worker.file', [
- 'filesToCaches' => [
- '/storage/costco/register-serviceworker.js',
- '/storage/costco/costco-icons.woff',
- '/storage/costco/logo.png',
- '/storage/costco/avatar.jpg',
- '/storage/costco/bar.png',
- '/storage/costco/menu.jpg',
- '/storage/costco/480.png',
- '/storage/costco/JsBarcode.all.min.js',
- '/costco/',
- ]
- ]);
- $response = \Response::make($content);
- $response->header('Content-Type', 'application/javascript; charset=utf-8');
- return $response;
- }
- }
|