feat: 增加透过 blob 下载文件的支持
This commit is contained in:
8
bin/builders/common.ts
vendored
8
bin/builders/common.ts
vendored
@@ -5,6 +5,7 @@ import fs from 'fs/promises';
|
||||
import fs2 from 'fs-extra';
|
||||
import { npmDirectory } from '@/utils/dir.js';
|
||||
import logger from '@/options/logger.js';
|
||||
import URL from 'node:url';
|
||||
|
||||
|
||||
export async function promptText(message: string, initial?: string) {
|
||||
@@ -17,6 +18,10 @@ export async function promptText(message: string, initial?: string) {
|
||||
return response.content;
|
||||
}
|
||||
|
||||
function setSecurityConfigWithUrl(tauriConfig: any, url: string) {
|
||||
const {hostname} = URL.parse(url);
|
||||
tauriConfig.tauri.security.dangerousRemoteDomainIpcAccess[0].domain = hostname;
|
||||
}
|
||||
|
||||
export async function mergeTauriConfig(
|
||||
url: string,
|
||||
@@ -267,6 +272,9 @@ export async function mergeTauriConfig(
|
||||
}
|
||||
}
|
||||
|
||||
// 设置安全调用 window.__TAURI__ 的安全域名为设置的应用域名
|
||||
setSecurityConfigWithUrl(tauriConf, url);
|
||||
|
||||
// 保存配置文件
|
||||
let configPath = "";
|
||||
switch (process.platform) {
|
||||
|
||||
Reference in New Issue
Block a user