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