Update project documentation and improve frontend functionality
- Updated the backend documentation in CONTRIBUTING.md and README.md to reflect changes in application structure and API endpoints. - Enhanced the frontend components in MapView.vue for better handling of context menu actions. - Added new types and interfaces in TypeScript for improved type safety in the frontend. - Introduced new utility classes for managing characters and markers in the map. - Updated .gitignore to include .vscode directory for better development environment management.
This commit is contained in:
@@ -1,22 +1,6 @@
|
||||
export interface MeResponse {
|
||||
username: string
|
||||
auths: string[]
|
||||
tokens?: string[]
|
||||
prefix?: string
|
||||
}
|
||||
import type { ConfigResponse, MapInfo, MapInfoAdmin, MeResponse, SettingsResponse } from '~/types/api'
|
||||
|
||||
export interface MapInfoAdmin {
|
||||
ID: number
|
||||
Name: string
|
||||
Hidden: boolean
|
||||
Priority: boolean
|
||||
}
|
||||
|
||||
export interface SettingsResponse {
|
||||
prefix: string
|
||||
defaultHide: boolean
|
||||
title: string
|
||||
}
|
||||
export type { ConfigResponse, MapInfo, MapInfoAdmin, MeResponse, SettingsResponse }
|
||||
|
||||
// Singleton: shared by all useMapApi() callers so 401 triggers one global handler (e.g. app.vue)
|
||||
const onApiErrorCallbacks: (() => void)[] = []
|
||||
@@ -46,7 +30,7 @@ export function useMapApi() {
|
||||
}
|
||||
|
||||
async function getConfig() {
|
||||
return request<{ title?: string; auths?: string[] }>('config')
|
||||
return request<ConfigResponse>('config')
|
||||
}
|
||||
|
||||
async function getCharacters() {
|
||||
@@ -58,7 +42,7 @@ export function useMapApi() {
|
||||
}
|
||||
|
||||
async function getMaps() {
|
||||
return request<Record<string, { ID: number; Name: string; size?: number }>>('maps')
|
||||
return request<Record<string, MapInfo>>('maps')
|
||||
}
|
||||
|
||||
// Auth
|
||||
|
||||
Reference in New Issue
Block a user