mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: check sb server status
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -60,7 +60,7 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
_checkServerStatus() {
|
||||
Request()
|
||||
.get(
|
||||
'$_blockServer/api/status',
|
||||
'$_blockServer/api/status/uptime',
|
||||
options: Options(
|
||||
headers: {
|
||||
'env': '',
|
||||
@@ -68,15 +68,17 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
'x-bili-mid': '',
|
||||
'x-bili-aurora-eid': '',
|
||||
'x-bili-aurora-zone': '',
|
||||
'cookie':
|
||||
'buvid3= ; SESSDATA= ; bili_jct= ; DedeUserID= ; DedeUserID__ckMd5= ; sid= ',
|
||||
},
|
||||
),
|
||||
)
|
||||
.then((res) {
|
||||
if (res.data is Map) {
|
||||
setState(() {
|
||||
_serverStatus = res.data['uptime'] != null;
|
||||
});
|
||||
}
|
||||
setState(() {
|
||||
_serverStatus = res.statusCode == 200 &&
|
||||
res.data is String &&
|
||||
(double.tryParse(res.data) ?? int.tryParse(res.data)) != null;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user