mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-09 08:48:21 +08:00
🐛 修复分享功能异常
This commit is contained in:
@@ -16,11 +16,16 @@
|
||||
"sql:allow-load",
|
||||
"sql:allow-execute",
|
||||
"sql:default",
|
||||
"webview:allow-set-webview-zoom",
|
||||
"webview:default",
|
||||
"window:allow-center",
|
||||
"window:allow-close",
|
||||
"window:allow-destroy",
|
||||
"window:allow-set-size",
|
||||
"window:allow-set-title",
|
||||
"window:allow-set-fullscreen",
|
||||
"window:allow-show",
|
||||
"window:default",
|
||||
{
|
||||
"identifier": "http:default",
|
||||
"allow": [
|
||||
|
||||
@@ -7,35 +7,79 @@
|
||||
"dialog:allow-message",
|
||||
"dialog:default",
|
||||
"event:allow-emit",
|
||||
"http:allow-fetch",
|
||||
"webview:allow-set-webview-zoom",
|
||||
"webview:default",
|
||||
"window:allow-center",
|
||||
"window:default",
|
||||
"path:allow-resolve-directory",
|
||||
"path:default",
|
||||
{
|
||||
"identifier": "fs:allow-exists",
|
||||
"allow": [{ "path": "**" }]
|
||||
"allow": [
|
||||
{
|
||||
"path": "**"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "fs:allow-mkdir",
|
||||
"allow": [{ "path": "**" }]
|
||||
"allow": [
|
||||
{
|
||||
"path": "**"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "fs:allow-read-dir",
|
||||
"allow": [{ "path": "**" }]
|
||||
"allow": [
|
||||
{
|
||||
"path": "**"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "fs:allow-read-text-file",
|
||||
"allow": [{ "path": "**" }]
|
||||
"allow": [
|
||||
{
|
||||
"path": "**"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "fs:allow-remove",
|
||||
"allow": [{ "path": "**" }]
|
||||
"allow": [
|
||||
{
|
||||
"path": "**"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "fs:allow-write-file",
|
||||
"allow": [{ "path": "**" }]
|
||||
"allow": [
|
||||
{
|
||||
"path": "**"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "fs:allow-write-text-file",
|
||||
"allow": [{ "path": "**" }]
|
||||
"allow": [
|
||||
{
|
||||
"path": "**"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "http:default",
|
||||
"allow": [
|
||||
{
|
||||
"url": "https://*.miyoushe.com/*"
|
||||
},
|
||||
{
|
||||
"url": "https://*.mihoyo.com/*"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"remote": {
|
||||
|
||||
@@ -21,11 +21,16 @@
|
||||
"sql:allow-load",
|
||||
"sql:allow-execute",
|
||||
"sql:default",
|
||||
"webview:allow-set-webview-zoom",
|
||||
"webview:default",
|
||||
"window:allow-center",
|
||||
"window:allow-close",
|
||||
"window:allow-destroy",
|
||||
"window:allow-set-size",
|
||||
"window:allow-set-title",
|
||||
"window:allow-set-fullscreen",
|
||||
"window:allow-show",
|
||||
"window:default",
|
||||
{
|
||||
"identifier": "fs:allow-exists",
|
||||
"allow": [{ "path": "**" }]
|
||||
|
||||
@@ -25,9 +25,12 @@
|
||||
"sql:allow-execute",
|
||||
"sql:default",
|
||||
"webview:allow-create-webview-window",
|
||||
"webview:allow-set-webview-zoom",
|
||||
"webview:default",
|
||||
"window:allow-center",
|
||||
"window:allow-close",
|
||||
"window:allow-destroy",
|
||||
"window:allow-set-size",
|
||||
"window:default",
|
||||
"window:allow-is-minimized",
|
||||
"window:allow-set-title",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,157 +1 @@
|
||||
{
|
||||
"DevJson": {
|
||||
"identifier": "DevJson",
|
||||
"description": "Capability for the dev json window",
|
||||
"local": true,
|
||||
"windows": ["Dev_JSON"],
|
||||
"permissions": [
|
||||
"app:allow-version",
|
||||
"app:default",
|
||||
"event:allow-listen",
|
||||
"event:default",
|
||||
"http:allow-fetch",
|
||||
"log:allow-log",
|
||||
"log:default",
|
||||
"path:allow-resolve-directory",
|
||||
"path:default",
|
||||
"sql:allow-load",
|
||||
"sql:allow-execute",
|
||||
"sql:default",
|
||||
"window:allow-close",
|
||||
"window:allow-destroy",
|
||||
"window:allow-set-title",
|
||||
"window:allow-set-fullscreen",
|
||||
"window:allow-show",
|
||||
{
|
||||
"identifier": "http:default",
|
||||
"allow": [{ "url": "https://*.miyoushe.com/*" }, { "url": "https://*.mihoyo.com/*" }]
|
||||
}
|
||||
],
|
||||
"platforms": ["windows", "macOS"]
|
||||
},
|
||||
"Mys": {
|
||||
"identifier": "Mys",
|
||||
"description": "Capability for the mys client window",
|
||||
"remote": { "urls": ["https://*.mihoyo.com/*", "https://*.miyoushe.com/*"] },
|
||||
"local": true,
|
||||
"windows": ["mhy_client"],
|
||||
"permissions": [
|
||||
"dialog:allow-message",
|
||||
"dialog:default",
|
||||
"event:allow-emit",
|
||||
"path:allow-resolve-directory",
|
||||
"path:default",
|
||||
{ "identifier": "fs:allow-exists", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-mkdir", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-read-dir", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-read-text-file", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-remove", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-write-file", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-write-text-file", "allow": [{ "path": "**" }] }
|
||||
],
|
||||
"platforms": ["windows", "macOS"]
|
||||
},
|
||||
"SubWindow": {
|
||||
"identifier": "SubWindow",
|
||||
"description": "Capability for the sub window",
|
||||
"local": true,
|
||||
"windows": ["Sub_window"],
|
||||
"permissions": [
|
||||
"app:allow-version",
|
||||
"app:default",
|
||||
"dialog:allow-save",
|
||||
"dialog:default",
|
||||
"event:allow-listen",
|
||||
"event:default",
|
||||
"fs:default",
|
||||
"http:allow-fetch",
|
||||
"log:allow-log",
|
||||
"log:default",
|
||||
"path:allow-resolve-directory",
|
||||
"path:default",
|
||||
"shell:allow-open",
|
||||
"shell:default",
|
||||
"sql:allow-load",
|
||||
"sql:allow-execute",
|
||||
"sql:default",
|
||||
"window:allow-close",
|
||||
"window:allow-destroy",
|
||||
"window:allow-set-title",
|
||||
"window:allow-set-fullscreen",
|
||||
"window:allow-show",
|
||||
{ "identifier": "fs:allow-exists", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-mkdir", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-read-dir", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-read-text-file", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-remove", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-write-file", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-write-text-file", "allow": [{ "path": "**" }] },
|
||||
{
|
||||
"identifier": "http:default",
|
||||
"allow": [{ "url": "https://*.miyoushe.com/*" }, { "url": "https://*.mihoyo.com/*" }]
|
||||
}
|
||||
],
|
||||
"platforms": ["windows", "macOS"]
|
||||
},
|
||||
"TeyvatGuide": {
|
||||
"identifier": "TeyvatGuide",
|
||||
"description": "Capability for the main window",
|
||||
"local": true,
|
||||
"windows": ["TeyvatGuide"],
|
||||
"permissions": [
|
||||
"app:allow-version",
|
||||
"app:default",
|
||||
"dialog:allow-save",
|
||||
"dialog:default",
|
||||
"event:allow-listen",
|
||||
"event:default",
|
||||
"fs:default",
|
||||
"http:allow-fetch",
|
||||
"log:allow-log",
|
||||
"log:default",
|
||||
"path:allow-resolve-directory",
|
||||
"path:default",
|
||||
"process:allow-exit",
|
||||
"process:default",
|
||||
"shell:allow-execute",
|
||||
"shell:allow-open",
|
||||
"shell:default",
|
||||
"sql:allow-load",
|
||||
"sql:allow-execute",
|
||||
"sql:default",
|
||||
"webview:allow-create-webview-window",
|
||||
"webview:default",
|
||||
"window:allow-close",
|
||||
"window:allow-destroy",
|
||||
"window:default",
|
||||
"window:allow-is-minimized",
|
||||
"window:allow-set-title",
|
||||
"window:allow-set-focus",
|
||||
"window:allow-show",
|
||||
"window:allow-unminimize",
|
||||
{ "identifier": "fs:allow-exists", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-mkdir", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-read-dir", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-read-text-file", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-remove", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-write-file", "allow": [{ "path": "**" }] },
|
||||
{ "identifier": "fs:allow-write-text-file", "allow": [{ "path": "**" }] },
|
||||
{
|
||||
"identifier": "http:default",
|
||||
"allow": [
|
||||
{ "url": "https://*.miyoushe.com/*" },
|
||||
{ "url": "https://*.mihoyo.com/*" },
|
||||
{ "url": "https://homa.snapgenshin.com/*" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "shell:allow-execute",
|
||||
"allow": [
|
||||
{ "args": true, "cmd": "explorer", "name": "win_open" },
|
||||
{ "args": true, "cmd": "open", "name": "mac_open" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"platforms": ["windows", "macOS"]
|
||||
}
|
||||
}
|
||||
{"DevJson":{"identifier":"DevJson","description":"Capability for the dev json window","local":true,"windows":["Dev_JSON"],"permissions":["app:allow-version","app:default","event:allow-listen","event:default","http:allow-fetch","log:allow-log","log:default","path:allow-resolve-directory","path:default","sql:allow-load","sql:allow-execute","sql:default","webview:allow-set-webview-zoom","webview:default","window:allow-center","window:allow-close","window:allow-destroy","window:allow-set-size","window:allow-set-title","window:allow-set-fullscreen","window:allow-show","window:default",{"identifier":"http:default","allow":[{"url":"https://*.miyoushe.com/*"},{"url":"https://*.mihoyo.com/*"}]}],"platforms":["windows","macOS"]},"Mys":{"identifier":"Mys","description":"Capability for the mys client window","remote":{"urls":["https://*.mihoyo.com/*","https://*.miyoushe.com/*"]},"local":true,"windows":["mhy_client"],"permissions":["dialog:allow-message","dialog:default","event:allow-emit","http:allow-fetch","webview:allow-set-webview-zoom","webview:default","window:allow-center","window:default","path:allow-resolve-directory","path:default",{"identifier":"fs:allow-exists","allow":[{"path":"**"}]},{"identifier":"fs:allow-mkdir","allow":[{"path":"**"}]},{"identifier":"fs:allow-read-dir","allow":[{"path":"**"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"**"}]},{"identifier":"fs:allow-remove","allow":[{"path":"**"}]},{"identifier":"fs:allow-write-file","allow":[{"path":"**"}]},{"identifier":"fs:allow-write-text-file","allow":[{"path":"**"}]},{"identifier":"http:default","allow":[{"url":"https://*.miyoushe.com/*"},{"url":"https://*.mihoyo.com/*"}]}],"platforms":["windows","macOS"]},"SubWindow":{"identifier":"SubWindow","description":"Capability for the sub window","local":true,"windows":["Sub_window"],"permissions":["app:allow-version","app:default","dialog:allow-save","dialog:default","event:allow-listen","event:default","fs:default","http:allow-fetch","log:allow-log","log:default","path:allow-resolve-directory","path:default","shell:allow-open","shell:default","sql:allow-load","sql:allow-execute","sql:default","webview:allow-set-webview-zoom","webview:default","window:allow-center","window:allow-close","window:allow-destroy","window:allow-set-size","window:allow-set-title","window:allow-set-fullscreen","window:allow-show","window:default",{"identifier":"fs:allow-exists","allow":[{"path":"**"}]},{"identifier":"fs:allow-mkdir","allow":[{"path":"**"}]},{"identifier":"fs:allow-read-dir","allow":[{"path":"**"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"**"}]},{"identifier":"fs:allow-remove","allow":[{"path":"**"}]},{"identifier":"fs:allow-write-file","allow":[{"path":"**"}]},{"identifier":"fs:allow-write-text-file","allow":[{"path":"**"}]},{"identifier":"http:default","allow":[{"url":"https://*.miyoushe.com/*"},{"url":"https://*.mihoyo.com/*"}]}],"platforms":["windows","macOS"]},"TeyvatGuide":{"identifier":"TeyvatGuide","description":"Capability for the main window","local":true,"windows":["TeyvatGuide"],"permissions":["app:allow-version","app:default","dialog:allow-save","dialog:default","event:allow-listen","event:default","fs:default","http:allow-fetch","log:allow-log","log:default","path:allow-resolve-directory","path:default","process:allow-exit","process:default","shell:allow-execute","shell:allow-open","shell:default","sql:allow-load","sql:allow-execute","sql:default","webview:allow-create-webview-window","webview:allow-set-webview-zoom","webview:default","window:allow-center","window:allow-close","window:allow-destroy","window:allow-set-size","window:default","window:allow-is-minimized","window:allow-set-title","window:allow-set-focus","window:allow-show","window:allow-unminimize",{"identifier":"fs:allow-exists","allow":[{"path":"**"}]},{"identifier":"fs:allow-mkdir","allow":[{"path":"**"}]},{"identifier":"fs:allow-read-dir","allow":[{"path":"**"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"**"}]},{"identifier":"fs:allow-remove","allow":[{"path":"**"}]},{"identifier":"fs:allow-write-file","allow":[{"path":"**"}]},{"identifier":"fs:allow-write-text-file","allow":[{"path":"**"}]},{"identifier":"http:default","allow":[{"url":"https://*.miyoushe.com/*"},{"url":"https://*.mihoyo.com/*"},{"url":"https://homa.snapgenshin.com/*"}]},{"identifier":"shell:allow-execute","allow":[{"args":true,"cmd":"explorer","name":"win_open"},{"args":true,"cmd":"open","name":"mac_open"}]}],"platforms":["windows","macOS"]}}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -115,14 +115,11 @@ class TGClient {
|
||||
defaultPath: saveDefault,
|
||||
});
|
||||
if(savePath !== null) {
|
||||
var resBlob = await window.__TAURI_PLUGIN_HTTP__.fetch('${url}',{
|
||||
var resp = await window.__TAURI_PLUGIN_HTTP__.fetch('${url}',{
|
||||
method: 'GET'
|
||||
}).then(res => res.blob());
|
||||
var buffer = new Uint8Array(await resBlob.arrayBuffer());
|
||||
await window.__TAURI_PLUGIN_FS__.writeBinaryFile({
|
||||
contents: buffer,
|
||||
path: savePath
|
||||
});
|
||||
}).then(res => res.arrayBuffer());
|
||||
var buffer = new Uint8Array(resp);
|
||||
await window.__TAURI_PLUGIN_FS__.writeFile(savePath, buffer);
|
||||
alert('保存成功');
|
||||
}
|
||||
})();`;
|
||||
@@ -819,8 +816,7 @@ class TGClient {
|
||||
* @returns {Promise<void>} - 无返回值
|
||||
*/
|
||||
async share(arg: TGApp.Plugins.JSBridge.Arg<TGApp.Plugins.JSBridge.SharePayload>): Promise<void> {
|
||||
// 如果有数据
|
||||
if (arg.payload.type === "image" && arg.payload.content?.image_url !== undefined) {
|
||||
if (arg.payload.type === "default") {
|
||||
const image = arg.payload.content.image_url;
|
||||
const format = image.split(".").pop();
|
||||
const executeJS = this.getSaveImgJS(image, format ?? "png");
|
||||
@@ -902,6 +898,14 @@ class TGClient {
|
||||
return;
|
||||
}
|
||||
if (arg.payload.type === "image") {
|
||||
if (arg.payload.content?.image_url !== undefined) {
|
||||
const image = arg.payload.content.image_url;
|
||||
const format = image.split(".").pop();
|
||||
const executeJS = this.getSaveImgJS(image, format ?? "png");
|
||||
await core.invoke("execute_js", { label: "mhy_client", js: executeJS });
|
||||
await this.callback(arg.callback, {});
|
||||
return;
|
||||
}
|
||||
if (arg.payload.content?.image_base64 !== undefined) {
|
||||
let image = arg.payload.content.image_base64;
|
||||
image = `data:image/png;base64,${image}`;
|
||||
|
||||
19
src/vite-env.d.ts
vendored
19
src/vite-env.d.ts
vendored
@@ -1,10 +1,12 @@
|
||||
/**
|
||||
* @file vite-env.d.ts
|
||||
* @description vite-env.d.ts
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Beta v0.3.3
|
||||
* @description 全局类型定义文件
|
||||
* @since Beta v0.5.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description vue 文件类型声明
|
||||
*/
|
||||
declare module "*.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
const component: DefineComponent<object, object, any>;
|
||||
@@ -48,3 +50,14 @@ interface ImportMetaEnv {
|
||||
declare interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 极验验证的请求方法-请求参数
|
||||
* @param {TGApp.BBS.Geetest.InitGeetestParams} params
|
||||
* @param {(captchaObj: TGApp.BBS.Geetest.GeetestCaptcha) => void} callback
|
||||
* @return void
|
||||
*/
|
||||
declare function initGeetest(
|
||||
params: TGApp.Plugins.Mys.Geetest.InitGeetestParams,
|
||||
callback: (captchaObj: TGApp.Plugins.Mys.Geetest.GeetestCaptcha) => void,
|
||||
): void;
|
||||
|
||||
Reference in New Issue
Block a user