Commit f3d9b7dd authored by vicotor's avatar vicotor

update function

parent f5c52da4
...@@ -83,6 +83,7 @@ Deno.serve(async (req) => { ...@@ -83,6 +83,7 @@ Deno.serve(async (req) => {
console.error('get sign config error:', configError) console.error('get sign config error:', configError)
return new Response(JSON.stringify({ return new Response(JSON.stringify({
success: false, success: false,
is_signed: false,
message: 'not found config' message: 'not found config'
}), { }), {
status: 500, status: 500,
...@@ -102,11 +103,13 @@ Deno.serve(async (req) => { ...@@ -102,11 +103,13 @@ Deno.serve(async (req) => {
console.error('Get user info error:', getError) console.error('Get user info error:', getError)
return new Response(JSON.stringify({ return new Response(JSON.stringify({
success: false, success: false,
is_signed: false,
message: 'User info fetch failed' message: 'User info fetch failed'
}), { }), {
headers: { ...corsHeaders, 'Content-Type': 'application/json' } headers: { ...corsHeaders, 'Content-Type': 'application/json' }
}) })
} }
const is_signed = userInfo.is_signed
if (!userInfo.in_white_list) { if (!userInfo.in_white_list) {
// 验证时间范围 // 验证时间范围
...@@ -120,6 +123,7 @@ Deno.serve(async (req) => { ...@@ -120,6 +123,7 @@ Deno.serve(async (req) => {
console.error('Not in sign time range') console.error('Not in sign time range')
return new Response(JSON.stringify({ return new Response(JSON.stringify({
success: false, success: false,
is_signed: is_signed,
message: 'not in sign time range' message: 'not in sign time range'
}), { }), {
status: 400, status: 400,
...@@ -132,6 +136,7 @@ Deno.serve(async (req) => { ...@@ -132,6 +136,7 @@ Deno.serve(async (req) => {
return new Response(JSON.stringify({ return new Response(JSON.stringify({
success: true, success: true,
is_signed: is_signed,
message: 'success' message: 'success'
}), { }), {
headers: { ...corsHeaders, 'Content-Type': 'application/json' } headers: { ...corsHeaders, 'Content-Type': 'application/json' }
...@@ -141,6 +146,7 @@ Deno.serve(async (req) => { ...@@ -141,6 +146,7 @@ Deno.serve(async (req) => {
console.error('Function error:', error) console.error('Function error:', error)
return new Response(JSON.stringify({ return new Response(JSON.stringify({
success: false, success: false,
is_signed: false,
message: 'Internal error' message: 'Internal error'
}), { }), {
status: 500, 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