diff --git a/web/src/pages/app/functions/mods/DebugPannel/index.tsx b/web/src/pages/app/functions/mods/DebugPannel/index.tsx index c3ee3d0d29..0cad89195c 100644 --- a/web/src/pages/app/functions/mods/DebugPannel/index.tsx +++ b/web/src/pages/app/functions/mods/DebugPannel/index.tsx @@ -76,7 +76,7 @@ export default function DebugPanel() { param: JSON.parse(params), }, headers: { - Authorization: `Bearer ${globalStore.currentApp?.function_debug_token}`, + "x-laf-debug-token": `${globalStore.currentApp?.function_debug_token}`, }, }); setRunningResData(res.data); diff --git a/web/src/pages/app/functions/mods/FunctionPanel/CreateModal/defaultFunctionString.ts b/web/src/pages/app/functions/mods/FunctionPanel/CreateModal/defaultFunctionString.ts index b33a2fa777..ab6984e451 100644 --- a/web/src/pages/app/functions/mods/FunctionPanel/CreateModal/defaultFunctionString.ts +++ b/web/src/pages/app/functions/mods/FunctionPanel/CreateModal/defaultFunctionString.ts @@ -1,10 +1,11 @@ -const defaultString = `import cloud from '@/cloud-sdk' +const defaultString = ` +import cloud from '@lafjs/cloud' exports.main = async function (ctx: FunctionContext) { - const { auth, body, query } = ctx + console.log('Hello World') - return { hello: 'LaF'} + return { data: 'hi, laf'} } `; diff --git a/web/src/pages/app/functions/store.ts b/web/src/pages/app/functions/store.ts index d112c82a25..3a9611d8b1 100644 --- a/web/src/pages/app/functions/store.ts +++ b/web/src/pages/app/functions/store.ts @@ -40,7 +40,7 @@ const useFunctionStore = create()( const currentFunction = get().currentFunction; return currentFunction?.name - ? `http://${currentApp?.gateway.status.appRoute.domain}/debug/${currentFunction?.name}` + ? `http://${currentApp?.gateway.status.appRoute.domain}/${currentFunction?.name}` : ""; }, diff --git a/web/src/pages/app/logs/index.tsx b/web/src/pages/app/logs/index.tsx index 6a924a62c7..3a38c36652 100644 --- a/web/src/pages/app/logs/index.tsx +++ b/web/src/pages/app/logs/index.tsx @@ -121,10 +121,10 @@ export default function LogsPage() { 时间 - Request ID + Request ID 函数名 - 执行用时 - 操作 + Content + 操作 @@ -133,9 +133,9 @@ export default function LogsPage() { return ( - {formatDate(item.created_at)} + {formatDate(item.created_at, "YYYY-MM-DD HH:mm:ss")} - + {item.request_id} @@ -145,8 +145,8 @@ export default function LogsPage() { {item.func} - - {item.time_usage} ms + + {item.data}