Spaces:
Running
Running
github-actions[bot]
commited on
Commit
·
2d206c5
1
Parent(s):
fe5c268
Update from GitHub Actions
Browse files- src/index.ts +4 -2
src/index.ts
CHANGED
@@ -188,6 +188,8 @@ app.get('/genspark', async (c) => {
|
|
188 |
}).filter(cookie => cookie.name && cookie.value);
|
189 |
|
190 |
gensparkContext = await initGensparkContext()
|
|
|
|
|
191 |
if (cookies && cookies.length > 0) {
|
192 |
await gensparkContext.clearCookies()
|
193 |
await gensparkContext.addCookies(cookies);
|
@@ -223,7 +225,7 @@ app.get('/genspark', async (c) => {
|
|
223 |
}).catch(error => {
|
224 |
return c.json({ code: 500, message: '获取令牌失败' })
|
225 |
});
|
226 |
-
|
227 |
return c.json({ code: 200, message: '获取令牌成功', token: token })
|
228 |
}
|
229 |
catch (error) {
|
@@ -236,7 +238,7 @@ app.get('/genspark', async (c) => {
|
|
236 |
finally {
|
237 |
await gensparkPage.close().catch(() => { });
|
238 |
}
|
239 |
-
|
240 |
return c.json({ code: 500, message: '获取令牌失败' })
|
241 |
})
|
242 |
|
|
|
188 |
}).filter(cookie => cookie.name && cookie.value);
|
189 |
|
190 |
gensparkContext = await initGensparkContext()
|
191 |
+
|
192 |
+
console.log('Cookies:', cookies)
|
193 |
if (cookies && cookies.length > 0) {
|
194 |
await gensparkContext.clearCookies()
|
195 |
await gensparkContext.addCookies(cookies);
|
|
|
225 |
}).catch(error => {
|
226 |
return c.json({ code: 500, message: '获取令牌失败' })
|
227 |
});
|
228 |
+
console.log('token:', token)
|
229 |
return c.json({ code: 200, message: '获取令牌成功', token: token })
|
230 |
}
|
231 |
catch (error) {
|
|
|
238 |
finally {
|
239 |
await gensparkPage.close().catch(() => { });
|
240 |
}
|
241 |
+
console.log('token:', "获取令牌失败")
|
242 |
return c.json({ code: 500, message: '获取令牌失败' })
|
243 |
})
|
244 |
|