mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-22 16:25:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,27 +1,30 @@
|
||||
import { Hono } from "hono";
|
||||
import { storeBindSession } from "../../store";
|
||||
import { resolveExistingWebSessionId, toWebSessionId } from "../../services/session";
|
||||
import { Hono } from 'hono'
|
||||
import { storeBindSession } from '../../store'
|
||||
import {
|
||||
resolveExistingWebSessionId,
|
||||
toWebSessionId,
|
||||
} from '../../services/session'
|
||||
|
||||
const app = new Hono();
|
||||
const app = new Hono()
|
||||
|
||||
/** POST /web/bind — Bind a session to a UUID (no-login auth) */
|
||||
app.post("/bind", async (c) => {
|
||||
const body = await c.req.json();
|
||||
const sessionId = body.sessionId;
|
||||
app.post('/bind', async c => {
|
||||
const body = await c.req.json()
|
||||
const sessionId = body.sessionId
|
||||
// UUID can come from query param (api.js sends it in URL) or body
|
||||
const uuid = c.req.query("uuid") || body.uuid;
|
||||
const uuid = c.req.query('uuid') || body.uuid
|
||||
|
||||
if (!sessionId || !uuid) {
|
||||
return c.json({ error: "sessionId and uuid are required" }, 400);
|
||||
return c.json({ error: 'sessionId and uuid are required' }, 400)
|
||||
}
|
||||
|
||||
const resolvedSessionId = resolveExistingWebSessionId(sessionId);
|
||||
const resolvedSessionId = resolveExistingWebSessionId(sessionId)
|
||||
if (!resolvedSessionId) {
|
||||
return c.json({ error: "Session not found" }, 404);
|
||||
return c.json({ error: 'Session not found' }, 404)
|
||||
}
|
||||
|
||||
storeBindSession(resolvedSessionId, uuid);
|
||||
return c.json({ ok: true, sessionId: toWebSessionId(resolvedSessionId) });
|
||||
});
|
||||
storeBindSession(resolvedSessionId, uuid)
|
||||
return c.json({ ok: true, sessionId: toWebSessionId(resolvedSessionId) })
|
||||
})
|
||||
|
||||
export default app;
|
||||
export default app
|
||||
|
||||
Reference in New Issue
Block a user