mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 22:33:42 +00:00
fix
This commit is contained in:
1 parent
0b1d6ca1f6
commit
864e6b0477
3 files changed
+13
-3
No files matched your search
+5
-1
@@ -46,7 +46,11 @@ var apiMap = map[string]func(params json.RawMessage) (data any, err error){
|
|||||||
return false, nil
|
return false, nil
|
||||||
},
|
},
|
||||||
"create": func(params json.RawMessage) (data any, err error) {
|
"create": func(params json.RawMessage) (data any, err error) {
|
||||||
err = browser.OpenURL(fmt.Sprintf("%s:///create?params=%s", identifier, string(params)))
|
var strParams string
|
||||||
|
if err = json.Unmarshal(params, &strParams); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = browser.OpenURL(fmt.Sprintf("%s:///create?params=%s", identifier, strParams))
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -337,7 +337,8 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
|||||||
if (uri.path == "/create") {
|
if (uri.path == "/create") {
|
||||||
final params = uri.queryParameters["params"];
|
final params = uri.queryParameters["params"];
|
||||||
if (params?.isNotEmpty == true) {
|
if (params?.isNotEmpty == true) {
|
||||||
final paramsJson = String.fromCharCodes(base64Decode(params!));
|
final paramsJson =
|
||||||
|
String.fromCharCodes(base64Decode(base64.normalize(params!)));
|
||||||
Get.rootDelegate.offAndToNamed(Routes.REDIRECT,
|
Get.rootDelegate.offAndToNamed(Routes.REDIRECT,
|
||||||
arguments: RedirectArgs(Routes.CREATE,
|
arguments: RedirectArgs(Routes.CREATE,
|
||||||
arguments:
|
arguments:
|
||||||
|
|||||||
@@ -36,7 +36,12 @@ Future<void> doInstallHost() async {
|
|||||||
// Check if host binary is not installed
|
// Check if host binary is not installed
|
||||||
if (!await File(hostPath).exists()) {
|
if (!await File(hostPath).exists()) {
|
||||||
final hostData = await getHostAssetData();
|
final hostData = await getHostAssetData();
|
||||||
await File(hostPath).writeAsBytes(hostData);
|
final file = File(hostPath);
|
||||||
|
await file.writeAsBytes(hostData);
|
||||||
|
// Add execute permission
|
||||||
|
if (!Platform.isWindows) {
|
||||||
|
await Process.run('chmod', ['+x', hostPath]);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check if host binary is outdated
|
// Check if host binary is outdated
|
||||||
|
|||||||
Reference in new issue
Block a user