mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: country code judgement problem
This commit is contained in:
parent
c1ca4f2f9b
commit
cc1f5611a7
3 changed files with 5 additions and 5 deletions
|
|
@ -364,9 +364,7 @@ export async function isCN () {
|
|||
let response = await fetch('https://ipinfo.io/country')
|
||||
let countryCode = (await response.text()).trim()
|
||||
await redis.set('CHATGPT:COUNTRY_CODE', countryCode, { EX: 3600 })
|
||||
if (countryCode !== 'CN') {
|
||||
return false
|
||||
}
|
||||
return countryCode === 'CN'
|
||||
} catch (err) {
|
||||
console.warn(err)
|
||||
// 没拿到归属地默认CN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue