exclude confing.js fix
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"build": "vite build && rm -f dist/config.js",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -3,9 +3,12 @@ import { Navigate, useLocation } from 'react-router-dom';
|
||||
export default function AuthGuard({ children }) {
|
||||
//判断环境变量中的AUTH_ACCESS是否为1开启权限校验
|
||||
//const authAccess = import.meta.env.AUTH_ACCESS;
|
||||
const authAccess = window.APP_CONFIG?.AUTH_ACCESS ||
|
||||
import.meta.env.AUTH_ACCESS ||
|
||||
'0';
|
||||
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';
|
||||
}
|
||||
console.log(authAccess, 'authAccess');
|
||||
if (authAccess === '1') {
|
||||
const location = useLocation();
|
||||
|
||||
@@ -8,6 +8,5 @@ binding = "bgdb" # available in your Worker on env.DB
|
||||
database_name = "friends"
|
||||
database_id = "f68e9fa5-4aea-45db-9516-2d7052e936fa"
|
||||
|
||||
[site]
|
||||
bucket = "./dist"
|
||||
exclude = ["config.js"]
|
||||
[vars]
|
||||
IS_CF = '1'
|
||||
Reference in New Issue
Block a user