mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 09:19:56 -05:00
Fix: WebUI Auth & Tauri Auth
This commit is contained in:
@@ -3,6 +3,7 @@ import { getCurrentWindow } from '@tauri-apps/api
|
||||
import { listen } from '@tauri-apps/api/event'
|
||||
import { open } from '@tauri-apps/plugin-dialog'
|
||||
import { readFile, writeFile } from '@tauri-apps/plugin-fs'
|
||||
import { fetch as tauriFetch } from '@tauri-apps/plugin-http'
|
||||
import { open as openUrl } from '@tauri-apps/plugin-shell'
|
||||
import { getVersion } from '@tauri-apps/api/app'
|
||||
import { connect, disconnect, setActivity, clearActivity } from 'tauri-plugin-discord-rpc-api'
|
||||
@@ -116,6 +117,12 @@ export class TauriAdapter implements PlatformAdapter {
|
||||
return invoke('get_auto_backup_dir')
|
||||
}
|
||||
|
||||
async fetchImage(url: string, headers: Record<string, string>): Promise<Blob> {
|
||||
const res = await tauriFetch(url, { method: 'GET', headers })
|
||||
if (!res.ok) throw new Error(`${res.status}`)
|
||||
return res.blob()
|
||||
}
|
||||
|
||||
async launchServer(config: ServerLaunchConfig): Promise<void> {
|
||||
await invoke('spawn_server', {
|
||||
binary: config.binary ?? '',
|
||||
|
||||
Reference in New Issue
Block a user