Commit f3d9b7dd authored by vicotor's avatar vicotor

update function

parent f5c52da4
......@@ -83,6 +83,7 @@ Deno.serve(async (req) => {
console.error('get sign config error:', configError)
return new Response(JSON.stringify({
success: false,
is_signed: false,
message: 'not found config'
}), {
status: 500,
......@@ -102,11 +103,13 @@ Deno.serve(async (req) => {
console.error('Get user info error:', getError)
return new Response(JSON.stringify({
success: false,
is_signed: false,
message: 'User info fetch failed'
}), {
headers: { ...corsHeaders, 'Content-Type': 'application/json' }
})
}
const is_signed = userInfo.is_signed
if (!userInfo.in_white_list) {
// 验证时间范围
......@@ -120,6 +123,7 @@ Deno.serve(async (req) => {
console.error('Not in sign time range')
return new Response(JSON.stringify({
success: false,
is_signed: is_signed,
message: 'not in sign time range'
}), {
status: 400,
......@@ -132,6 +136,7 @@ Deno.serve(async (req) => {
return new Response(JSON.stringify({
success: true,
is_signed: is_signed,
message: 'success'
}), {
headers: { ...corsHeaders, 'Content-Type': 'application/json' }
......@@ -141,6 +146,7 @@ Deno.serve(async (req) => {
console.error('Function error:', error)
return new Response(JSON.stringify({
success: false,
is_signed: false,
message: 'Internal error'
}), {
status: 500,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment