Use Beijing business date for subscription delivery paths
This commit is contained in:
1 parent
d8aa76e7ad
commit
0a1698b69d
3 files changed
+98
-2
No files matched your search
@@ -8,6 +8,7 @@
|
||||
use App\Services\TomTool\Telegram\Slave as TeleSlave;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Carbon\CarbonImmutable;
|
||||
|
||||
class FreenodeController extends Controller
|
||||
{
|
||||
@@ -22,7 +23,8 @@ public function filePut(Request $oRequest)
|
||||
$sSubSiteCodeShort = $aData["site_code_short"];
|
||||
$aRaw = $aData["raw"];
|
||||
|
||||
$sDate = date('Ymd');
|
||||
// Subscription links use Beijing's calendar day, independently of app.timezone.
|
||||
$sDate = CarbonImmutable::now('Asia/Shanghai')->format('Ymd');
|
||||
$sSuffix = "nodes";
|
||||
$sRawKey = $sDate . $sSuffix;
|
||||
$sUniqueToken = hash_hmac('sha256', $sRawKey, 'wocaonide');
|
||||
@@ -47,7 +49,7 @@ public function filePut(Request $oRequest)
|
||||
}
|
||||
|
||||
$sFileSavePath = $sSubSiteCodeShort."/".$sShortToken;
|
||||
$sFileSaveName = date("Ymd")."-".$sClient.$sExtension;
|
||||
$sFileSaveName = $sDate."-".$sClient.$sExtension;
|
||||
$sFilePathFull = $sFileSavePath."/".$sFileSaveName;
|
||||
|
||||
if (!File::isDirectory($sFileSavePath)) {
|
||||
|
||||
Reference in new issue
Block a user