diff --git a/public/config.js b/public/config.js index 76939e6..e2317c5 100644 --- a/public/config.js +++ b/public/config.js @@ -2,6 +2,6 @@ // 部署时可以直接修改这个文件来改变配置,无需重新编译 window.APP_CONFIG = { // 权限验证开关:'1' 开启,'0' 关闭 - AUTH_ACCESS: "1", + AUTH_ACCESS: "0", ICP_NUMBER: "", }; \ No newline at end of file diff --git a/src/components/AuthGuard.jsx b/src/components/AuthGuard.jsx index 144f7b0..ee6b532 100644 --- a/src/components/AuthGuard.jsx +++ b/src/components/AuthGuard.jsx @@ -3,12 +3,9 @@ import { Navigate, useLocation } from 'react-router-dom'; export default function AuthGuard({ children }) { //判断环境变量中的AUTH_ACCESS是否为1开启权限校验 //const authAccess = import.meta.env.AUTH_ACCESS; - let authAccess = window.APP_CONFIG?.AUTH_ACCESS || '0'; - const isCf = import.meta.env.IS_CF || '0'; - console.log(isCf, 'isCf'); - if (isCf === '1') { - authAccess = import.meta.env.AUTH_ACCESS || '0'; - } + const authAccess = window.APP_CONFIG?.AUTH_ACCESS || + import.meta.env.AUTH_ACCESS || + '0'; console.log(authAccess, 'authAccess'); if (authAccess === '1') { const location = useLocation(); diff --git a/wrangler.toml b/wrangler.toml index 9410af3..722ae43 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -7,6 +7,3 @@ preview_id = "cbd11575c3504e6bb043c1c250d2f7ed" # 本地开发环境使用 binding = "bgdb" # available in your Worker on env.DB database_name = "friends" database_id = "f68e9fa5-4aea-45db-9516-2d7052e936fa" - -[vars] -IS_CF = '1' \ No newline at end of file