fix: 修复 lint 校验失败 (#1867)
This commit is contained in:
1 parent
a716a1a185
commit
0af6445d5a
5 files changed
+16
-15
No files matched your search
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
import { execSync } from 'node:child_process';
|
import { execSync } from 'node:child_process';
|
||||||
import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync } from 'node:fs';
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync } from 'node:fs';
|
||||||
import { join, basename, resolve } from 'node:path';
|
import { join, resolve } from 'node:path';
|
||||||
import { GitHubAPI, getEnv, setOutput } from './lib/github.ts';
|
import { GitHubAPI, getEnv, setOutput } from './lib/github.ts';
|
||||||
import { toProxyUrl } from './lib/comment.ts';
|
import { toProxyUrl } from './lib/comment.ts';
|
||||||
|
|
||||||
|
|||||||
@@ -138,14 +138,14 @@ export class FFmpegExecAdapter implements IFFmpegAdapter {
|
|||||||
/**
|
/**
|
||||||
* 获取时长
|
* 获取时长
|
||||||
*/
|
*/
|
||||||
async getDuration(filePath: string): Promise<number> {
|
async getDuration (filePath: string): Promise<number> {
|
||||||
const { stdout } = await execFileAsync(this.ffprobePath, [
|
const { stdout } = await execFileAsync(this.ffprobePath, [
|
||||||
"-v",
|
'-v',
|
||||||
"error",
|
'error',
|
||||||
"-show_entries",
|
'-show_entries',
|
||||||
"format=duration",
|
'format=duration',
|
||||||
"-of",
|
'-of',
|
||||||
"default=noprint_wrappers=1:nokey=1",
|
'default=noprint_wrappers=1:nokey=1',
|
||||||
filePath,
|
filePath,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export abstract class BaseGroupTodoAction extends GetPacketStatusDepends<GroupTo
|
|||||||
override returnSchema = Type.Null();
|
override returnSchema = Type.Null();
|
||||||
override actionTags = ['核心接口'];
|
override actionTags = ['核心接口'];
|
||||||
|
|
||||||
protected abstract handleGroupTodo(groupId: number, msgSeq: string): Promise<void>;
|
protected abstract handleGroupTodo (groupId: number, msgSeq: string): Promise<void>;
|
||||||
|
|
||||||
async _handle (payload: GroupTodoPayload) {
|
async _handle (payload: GroupTodoPayload) {
|
||||||
const groupId = +payload.group_id;
|
const groupId = +payload.group_id;
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ import { describe, expect, test, vi } from 'vitest';
|
|||||||
import { NapProtoMsg } from 'napcat-protobuf';
|
import { NapProtoMsg } from 'napcat-protobuf';
|
||||||
import { OidbSvcTrpcTcpBase } from '@/napcat-core/packet/transformer/proto/oidb/OidbBase';
|
import { OidbSvcTrpcTcpBase } from '@/napcat-core/packet/transformer/proto/oidb/OidbBase';
|
||||||
import { OidbSvcTrpcTcp0XF90 } from '@/napcat-core/packet/transformer/proto/oidb/Oidb.0xf90';
|
import { OidbSvcTrpcTcp0XF90 } from '@/napcat-core/packet/transformer/proto/oidb/Oidb.0xf90';
|
||||||
|
import SetGroupTodo from '@/napcat-core/packet/transformer/action/SetGroupTodo';
|
||||||
|
import CompleteGroupTodo from '@/napcat-core/packet/transformer/action/CompleteGroupTodo';
|
||||||
|
import CancelGroupTodo from '@/napcat-core/packet/transformer/action/CancelGroupTodo';
|
||||||
|
|
||||||
vi.mock('@/napcat-core/packet/transformer/base', () => ({
|
vi.mock('@/napcat-core/packet/transformer/base', () => ({
|
||||||
PacketTransformer: class PacketTransformer {
|
PacketTransformer: class PacketTransformer {
|
||||||
@@ -14,10 +17,6 @@ vi.mock('@/napcat-core/packet/transformer/base', () => ({
|
|||||||
PacketBufBuilder: (str: Uint8Array) => Buffer.from(str),
|
PacketBufBuilder: (str: Uint8Array) => Buffer.from(str),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
import SetGroupTodo from '@/napcat-core/packet/transformer/action/SetGroupTodo';
|
|
||||||
import CompleteGroupTodo from '@/napcat-core/packet/transformer/action/CompleteGroupTodo';
|
|
||||||
import CancelGroupTodo from '@/napcat-core/packet/transformer/action/CancelGroupTodo';
|
|
||||||
|
|
||||||
const decodePacket = (data: Buffer) => {
|
const decodePacket = (data: Buffer) => {
|
||||||
const base = new NapProtoMsg(OidbSvcTrpcTcpBase).decode(data);
|
const base = new NapProtoMsg(OidbSvcTrpcTcpBase).decode(data);
|
||||||
const body = new NapProtoMsg(OidbSvcTrpcTcp0XF90).decode(base.body);
|
const body = new NapProtoMsg(OidbSvcTrpcTcp0XF90).decode(base.body);
|
||||||
|
|||||||
@@ -121,12 +121,14 @@ const WebUIConfigCard = () => {
|
|||||||
<div className='flex flex-col gap-2'>
|
<div className='flex flex-col gap-2'>
|
||||||
<div className='flex-shrink-0 w-full font-bold text-default-600 dark:text-default-400 px-1'>Passkey认证</div>
|
<div className='flex-shrink-0 w-full font-bold text-default-600 dark:text-default-400 px-1'>Passkey认证</div>
|
||||||
|
|
||||||
{!window.isSecureContext ? (
|
{!window.isSecureContext
|
||||||
|
? (
|
||||||
<div className='text-sm text-warning-500 bg-warning-50 p-2 rounded-md border border-warning-200'>
|
<div className='text-sm text-warning-500 bg-warning-50 p-2 rounded-md border border-warning-200'>
|
||||||
⚠️ 当前处于非安全环境(即既非 HTTPS 也非 localhost),浏览器已禁用 WebAuthn 功能。<br />
|
⚠️ 当前处于非安全环境(即既非 HTTPS 也非 localhost),浏览器已禁用 WebAuthn 功能。<br />
|
||||||
如果您是通过局域网 IP 访问 WebUI,将无法注册和使用 Passkey。
|
如果您是通过局域网 IP 访问 WebUI,将无法注册和使用 Passkey。
|
||||||
</div>
|
</div>
|
||||||
) : (
|
)
|
||||||
|
: (
|
||||||
<>
|
<>
|
||||||
<div className='text-sm text-default-400 mb-2'>
|
<div className='text-sm text-default-400 mb-2'>
|
||||||
注册Passkey后,您可以更便捷地登录WebUI,无需每次输入token
|
注册Passkey后,您可以更便捷地登录WebUI,无需每次输入token
|
||||||
|
|||||||
Reference in new issue
Block a user