Refactor frontend workspaces and centralize API contracts
Organize domain APIs and types under common/apis, shared components under named folders, and private workspace logic alongside each page. Use Bearer sessions, explicit response envelopes, session-aware routing and streams, and configurable login captcha presentation for the deployed backend contract. Preserve news, economic calendar, crawler, market, chat, Skills, settings, and demo trading workflows with responsive layouts and explicit configuration saves. Validate with frontend lint, type checking, 22 test groups, production builds, and deployed desktop/mobile page checks.
This commit is contained in:
1 parent
77b33e5e77
commit
bc480fb806
102 files changed
+4716
-1707
No files matched your search
@@ -0,0 +1,46 @@
|
||||
import type * as Auth from "./type"
|
||||
import { request } from "@/http/axios"
|
||||
|
||||
/** 获取当前身份 */
|
||||
export function getIdentityApi() {
|
||||
return request<Auth.GetIdentityResponseData>({
|
||||
url: "/auth/me",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
/** 撤销当前会话 */
|
||||
export function revokeSessionApi() {
|
||||
return request<Auth.RevokeSessionResponseData>({
|
||||
url: "/auth/logout",
|
||||
method: "post"
|
||||
})
|
||||
}
|
||||
|
||||
/** 获取登录验证码模式及挑战 */
|
||||
export function getCaptchaApi() {
|
||||
return request<Auth.GetCaptchaResponseData>({
|
||||
url: "/auth/captcha",
|
||||
method: "get",
|
||||
anonymous: true,
|
||||
notify: false
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交登录凭据 */
|
||||
export function loginApi(body: Auth.LoginForm) {
|
||||
return request<Auth.LoginResponseData>({
|
||||
url: "/auth/login",
|
||||
method: "post",
|
||||
data: body,
|
||||
anonymous: true
|
||||
})
|
||||
}
|
||||
|
||||
/** 一次性短票据,只用于行情 WebSocket 握手。 */
|
||||
export function createWebSocketTicketApi() {
|
||||
return request<Auth.WebSocketTicket>({
|
||||
url: "/auth/ws-ticket",
|
||||
method: "post"
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user