mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
✏️ 继续修正 import
This commit is contained in:
@@ -9,19 +9,19 @@ import type { Event } from "@tauri-apps/api/event";
|
||||
import type { UnlistenFn } from "@tauri-apps/api/helpers/event";
|
||||
import { appWindow, WebviewWindow } from "@tauri-apps/api/window";
|
||||
|
||||
import showSnackbar from "../components/func/snackbar";
|
||||
import TGSqlite from "../plugins/Sqlite";
|
||||
import { useAppStore } from "../store/modules/app";
|
||||
import { useUserStore } from "../store/modules/user";
|
||||
import TGConstant from "../web/constant/TGConstant";
|
||||
import { getCookieTokenBySToken } from "../web/request/getCookieToken";
|
||||
import TGRequest from "../web/request/TGRequest";
|
||||
import { getDS4JS } from "../web/utils/getRequestHeader";
|
||||
import showSnackbar from "../components/func/snackbar.js";
|
||||
import TGSqlite from "../plugins/Sqlite/index.js";
|
||||
import { useAppStore } from "../store/modules/app.js";
|
||||
import { useUserStore } from "../store/modules/user.js";
|
||||
import TGConstant from "../web/constant/TGConstant.js";
|
||||
import { getCookieTokenBySToken } from "../web/request/getCookieToken.js";
|
||||
import TGRequest from "../web/request/TGRequest.js";
|
||||
import { getDS4JS } from "../web/utils/getRequestHeader.js";
|
||||
|
||||
import { parseLink } from "./linkParser";
|
||||
import TGLogger from "./TGLogger";
|
||||
import { createPost } from "./TGWindow";
|
||||
import { getDeviceInfo } from "./toolFunc";
|
||||
import { parseLink } from "./linkParser.js";
|
||||
import TGLogger from "./TGLogger.js";
|
||||
import { createPost } from "./TGWindow.js";
|
||||
import { getDeviceInfo } from "./toolFunc.js";
|
||||
|
||||
// invoke 参数
|
||||
interface InvokeArg {
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
import { dialog, fs, http, path } from "@tauri-apps/api";
|
||||
import html2canvas from "html2canvas";
|
||||
|
||||
import showConfirm from "../components/func/confirm";
|
||||
import showSnackbar from "../components/func/snackbar";
|
||||
import showConfirm from "../components/func/confirm.js";
|
||||
import showSnackbar from "../components/func/snackbar.js";
|
||||
|
||||
import TGLogger from "./TGLogger";
|
||||
import { bytesToSize } from "./toolFunc";
|
||||
import TGLogger from "./TGLogger.js";
|
||||
import { bytesToSize } from "./toolFunc.js";
|
||||
|
||||
/**
|
||||
* @description 保存图片-canvas
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { invoke, window as TauriWindow } from "@tauri-apps/api";
|
||||
import type { WindowOptions } from "@tauri-apps/api/window";
|
||||
|
||||
import TGLogger from "./TGLogger";
|
||||
import TGLogger from "./TGLogger.js";
|
||||
|
||||
/**
|
||||
* @description 创建TG窗口
|
||||
@@ -50,7 +50,7 @@ export function createTGWindow(
|
||||
.then(() => {
|
||||
createTGWindow(url, label, title, width, height, resizable, visible);
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch((err: unknown) => {
|
||||
console.error(err);
|
||||
});
|
||||
} else {
|
||||
@@ -61,11 +61,11 @@ export function createTGWindow(
|
||||
.then(() => {
|
||||
console.log(`[createTGWindow][${label}] ${title} created.`);
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch((err: unknown) => {
|
||||
console.error(err);
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch((err: unknown) => {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ export async function verifyUiafData(path: string): Promise<boolean> {
|
||||
try {
|
||||
const fileJson = JSON.parse(fileData);
|
||||
if (!validate(fileJson)) {
|
||||
if (validate.errors === undefined || validate.errors === null) return false;
|
||||
const error: ErrorObject = validate.errors[0];
|
||||
showSnackbar({
|
||||
text: `${error.instancePath || error.schemaPath} ${error.message}`,
|
||||
@@ -89,6 +90,7 @@ export async function verifyUiafDataClipboard(): Promise<boolean> {
|
||||
try {
|
||||
const fileJson = JSON.parse(data);
|
||||
if (!validate(fileJson)) {
|
||||
if (validate.errors === undefined || validate.errors === null) return false;
|
||||
const error: ErrorObject = validate.errors[0];
|
||||
showSnackbar({
|
||||
text: `${error.instancePath || error.schemaPath} ${error.message}`,
|
||||
|
||||
@@ -12,7 +12,7 @@ import showSnackbar from "../components/func/snackbar.js";
|
||||
import { UigfSchema } from "../data/index.js";
|
||||
|
||||
import TGLogger from "./TGLogger.js";
|
||||
import { timestampToDate } from "./toolFunc";
|
||||
import { timestampToDate } from "./toolFunc.js";
|
||||
|
||||
/**
|
||||
* @description 获取 UIGF 时区
|
||||
@@ -83,6 +83,7 @@ export async function verifyUigfData(path: string): Promise<boolean> {
|
||||
try {
|
||||
const fileJson = JSON.parse(fileData);
|
||||
if (!validate(fileJson)) {
|
||||
if (!validate.errors || validate.errors.length === 0) return false;
|
||||
const error: ErrorObject = validate.errors[0];
|
||||
showSnackbar({
|
||||
text: `${error.instancePath || error.schemaPath} ${error.message}`,
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
import { emit } from "@tauri-apps/api/event";
|
||||
|
||||
import showConfirm from "../components/func/confirm";
|
||||
import showSnackbar from "../components/func/snackbar";
|
||||
import showConfirm from "../components/func/confirm.js";
|
||||
import showSnackbar from "../components/func/snackbar.js";
|
||||
|
||||
import TGClient from "./TGClient";
|
||||
import { createPost } from "./TGWindow";
|
||||
import TGClient from "./TGClient.js";
|
||||
import { createPost } from "./TGWindow.js";
|
||||
|
||||
/**
|
||||
* @function parsePost
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { os, path } from "@tauri-apps/api";
|
||||
import colorConvert from "color-convert";
|
||||
import type { KEYWORD } from "color-convert/conversions";
|
||||
import type { KEYWORD } from "color-convert/conversions.js";
|
||||
import { v4 } from "uuid";
|
||||
import { score } from "wcag-color";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user