mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
Refactor version API to GetNapCatVersion endpoint
Replaces the PackageInfo API and related frontend usage with a dedicated GetNapCatVersion endpoint that returns only the NapCat version string. Updates backend handler, helper, types, router, and frontend components to use the new API for improved clarity and separation of concerns.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { LoginRuntimeType } from '../types/data';
|
||||
import packageJson from '../../../../package.json';
|
||||
import store from 'napcat-common/src/store';
|
||||
import { napCatVersion } from 'napcat-common/src/version';
|
||||
|
||||
@@ -31,12 +30,11 @@ const LoginRuntime: LoginRuntimeType = {
|
||||
QQLoginList: [],
|
||||
NewQQLoginList: [],
|
||||
},
|
||||
packageJson,
|
||||
NapCatVersion: napCatVersion,
|
||||
WebUiConfigQuickFunction: async () => {
|
||||
|
||||
},
|
||||
};
|
||||
packageJson.version = napCatVersion;
|
||||
export const WebUiDataRuntime = {
|
||||
setWebUiTokenChangeCallback (func: (token: string) => Promise<void>): void {
|
||||
LoginRuntime.onWebUiTokenChange = func;
|
||||
@@ -131,8 +129,8 @@ export const WebUiDataRuntime = {
|
||||
return LoginRuntime.NapCatHelper.onOB11ConfigChanged(ob11);
|
||||
} as LoginRuntimeType['NapCatHelper']['onOB11ConfigChanged'],
|
||||
|
||||
getPackageJson () {
|
||||
return LoginRuntime.packageJson;
|
||||
GetNapCatVersion () {
|
||||
return LoginRuntime.NapCatVersion;
|
||||
},
|
||||
|
||||
setQQVersion (version: string) {
|
||||
|
||||
Reference in New Issue
Block a user