Skip to content

Commit 2a4d3f8

Browse files
committed
fix
1 parent 0c32020 commit 2a4d3f8

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

public/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
// 部署时可以直接修改这个文件来改变配置,无需重新编译
33
window.APP_CONFIG = {
44
// 权限验证开关:'1' 开启,'0' 关闭
5-
AUTH_ACCESS: "1",
5+
AUTH_ACCESS: "0",
66
ICP_NUMBER: "",
77
};

src/components/AuthGuard.jsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ import { Navigate, useLocation } from 'react-router-dom';
33
export default function AuthGuard({ children }) {
44
//判断环境变量中的AUTH_ACCESS是否为1开启权限校验
55
//const authAccess = import.meta.env.AUTH_ACCESS;
6-
let authAccess = window.APP_CONFIG?.AUTH_ACCESS || '0';
7-
const isCf = import.meta.env.IS_CF || '0';
8-
console.log(isCf, 'isCf');
9-
if (isCf === '1') {
10-
authAccess = import.meta.env.AUTH_ACCESS || '0';
11-
}
6+
const authAccess = window.APP_CONFIG?.AUTH_ACCESS ||
7+
import.meta.env.AUTH_ACCESS ||
8+
'0';
129
console.log(authAccess, 'authAccess');
1310
if (authAccess === '1') {
1411
const location = useLocation();

wrangler.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,3 @@ preview_id = "cbd11575c3504e6bb043c1c250d2f7ed" # 本地开发环境使用
77
binding = "bgdb" # available in your Worker on env.DB
88
database_name = "friends"
99
database_id = "f68e9fa5-4aea-45db-9516-2d7052e936fa"
10-
11-
[vars]
12-
IS_CF = '1'

0 commit comments

Comments
 (0)