fix: uploaded file's path on windows (#484)

This commit is contained in:
lollipopkit🏳️‍⚧️
2024-07-23 19:59:58 +08:00
committed by GitHub
parent afda5fd4a4
commit 426e5689f8
7 changed files with 36 additions and 32 deletions

View File

@@ -2,6 +2,6 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 1025;
static const int script = 53;
static const int build = 1026;
static const int script = 54;
}

View File

@@ -9,6 +9,7 @@ abstract final class GithubIds {
'azkadev',
'kalashnikov',
'calvinweb',
'No06',
'QazCetelic',
'RainSunMe',
'FrancXPT',
@@ -20,6 +21,7 @@ abstract final class GithubIds {
'jaychoubaby',
'fecture',
'Tao173',
'Jasonzhu1207',
'QingAnLe',
'wxdjs',
'Aeorq',
@@ -72,7 +74,6 @@ abstract final class GithubIds {
'pgs666',
'FHU-yezi',
'ZRY233',
'Jasonzhu1207',
'sakuraanzu',
'licaon-kter',
'77160860',

View File

@@ -360,9 +360,10 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')}
void _goAuth() {
if (Stores.setting.useBioAuth.fetch()) {
if (BioAuthPage.route.isAlreadyIn) return;
BioAuthPage.route.go(context, args: BioAuthPageArgs(
onAuthSuccess: () => _shouldAuth = false,
));
BioAuthPage.route.go(
context,
args: BioAuthPageArgs(onAuthSuccess: () => _shouldAuth = false),
);
}
}

View File

@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:dartssh2/dartssh2.dart';
import 'package:fl_lib/fl_lib.dart';
@@ -212,7 +213,8 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
context.showSnackBar('remote path is null');
return;
}
final remotePath = '$remoteDir/${path.split('/').last}';
final fileName = path.split(Platform.pathSeparator).lastOrNull;
final remotePath = '$remoteDir/$fileName';
Loggers.app.info('SFTP upload local: $path, remote: $remotePath');
Pros.sftp.add(
SftpReq(widget.spi, remotePath, path, SftpReqType.upload),