Commit abbe5683 authored by 邓晓峰's avatar 邓晓峰

fix: 修复https安全降级

parent b1524af6
Pipeline #39203 passed with stages
in 13 minutes 56 seconds
/* eslint-disable */ /* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin; // const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const proxyURL = 'https://work.panda-water.cn'; const proxyURL = 'http://192.168.10.150:8014';
module.exports = { module.exports = {
assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './', assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './',
dev: { dev: {
......
...@@ -22,6 +22,8 @@ const defaultSetting = config.layout; ...@@ -22,6 +22,8 @@ const defaultSetting = config.layout;
function App(props) { function App(props) {
//
const metaSecurity = /https/.test(window.location.protocol) ? <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"></meta>: null;
return ( return (
<> <>
<Helmet <Helmet
...@@ -35,6 +37,9 @@ function App(props) { ...@@ -35,6 +37,9 @@ function App(props) {
href={`https://panda-water.cn/web4/${props.global && href={`https://panda-water.cn/web4/${props.global &&
props.global.shortcutIcon}`} props.global.shortcutIcon}`}
/> />
{
metaSecurity
}
<meta <meta
name="description" name="description"
content={`${props.global && props.global.title}`} content={`${props.global && props.global.title}`}
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> <!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
<!-- The first thing in any HTML file should be the charset --> <!-- The first thing in any HTML file should be the charset -->
<meta charset="utf-8" /> <meta charset="utf-8" />
<!-- Make the page mobile compatible --> <!-- Make the page mobile compatible -->
......
...@@ -186,7 +186,8 @@ export const defaultApp = () => { ...@@ -186,7 +186,8 @@ export const defaultApp = () => {
if(config && config.home) { if(config && config.home) {
setDefaultMountApp(`/civbase/${config.home.path.replace(/^\//, '')}`); setDefaultMountApp(`/civbase/${config.home.path.replace(/^\//, '')}`);
} else { } else {
const homepage = _.isNull(config.homepage) ? '': '/' + config.homepage; debugger
const homepage = _.isNull(config.homepage) ? '/index': '/' + config.homepage;
setDefaultMountApp(`/${pkg.name.toLocaleLowerCase()}/${basePath}${homepage}`); setDefaultMountApp(`/${pkg.name.toLocaleLowerCase()}/${basePath}${homepage}`);
createStoreage.set('init_web4', true) createStoreage.set('init_web4', true)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment