mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-19 21:20:07 +08:00
fix: Reset pagination when navigating between directories in file manager
Fix: Reset pagination when navigating between directories in file manager
This commit is contained in:
commit
d472eee777
@ -82,6 +82,7 @@ export default function FileTable({
|
|||||||
setPreviewImages([])
|
setPreviewImages([])
|
||||||
setPreviewIndex(0)
|
setPreviewIndex(0)
|
||||||
setShowImage(false)
|
setShowImage(false)
|
||||||
|
setPage(1)
|
||||||
}, [currentPath])
|
}, [currentPath])
|
||||||
|
|
||||||
const onPreviewImage = (name: string, images: PreviewImage[]) => {
|
const onPreviewImage = (name: string, images: PreviewImage[]) => {
|
||||||
|
|||||||
@ -171,7 +171,8 @@ const GenericForm = <T extends keyof NetworkConfigType>({
|
|||||||
|
|
||||||
export default GenericForm
|
export default GenericForm
|
||||||
export function random_token(length: number) {
|
export function random_token(length: number) {
|
||||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%^&*()-_=+[]{}|;:,.<>?'
|
const chars =
|
||||||
|
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%^&*()-_=+[]{}|;:,.<>?'
|
||||||
let result = ''
|
let result = ''
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
result += chars.charAt(Math.floor(Math.random() * chars.length))
|
result += chars.charAt(Math.floor(Math.random() * chars.length))
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
|
import CryptoJS from 'crypto-js'
|
||||||
import { EventSourcePolyfill } from 'event-source-polyfill'
|
import { EventSourcePolyfill } from 'event-source-polyfill'
|
||||||
|
|
||||||
import { LogLevel } from '@/const/enum'
|
import { LogLevel } from '@/const/enum'
|
||||||
|
|
||||||
import { serverRequest } from '@/utils/request'
|
import { serverRequest } from '@/utils/request'
|
||||||
import CryptoJS from "crypto-js";
|
|
||||||
export interface Log {
|
export interface Log {
|
||||||
level: LogLevel
|
level: LogLevel
|
||||||
message: string
|
message: string
|
||||||
@ -17,7 +18,7 @@ export default class WebUIManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static async loginWithToken(token: string) {
|
public static async loginWithToken(token: string) {
|
||||||
const sha256 = CryptoJS.SHA256(token + '.napcat').toString();
|
const sha256 = CryptoJS.SHA256(token + '.napcat').toString()
|
||||||
const { data } = await serverRequest.post<ServerResponse<AuthResponse>>(
|
const { data } = await serverRequest.post<ServerResponse<AuthResponse>>(
|
||||||
'/auth/login',
|
'/auth/login',
|
||||||
{ hash: sha256 }
|
{ hash: sha256 }
|
||||||
|
|||||||
@ -182,4 +182,4 @@ const ServerConfigCard = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ServerConfigCard
|
export default ServerConfigCard
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user