c78c3b0e by renchao@pashanhoo.com

style:cas配置修改

1 parent 0630b8f7
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-05-30 15:08:51
* @LastEditTime: 2023-06-02 09:47:57
-->
<!DOCTYPE html>
<html>
......@@ -14,17 +14,28 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
<title>
<%= webpackConfig.name %>
</title>
</head>
<script>
window.baseUrl = location.origin || location.protocol + '//' + location.host
const authorization = "bearer ATT-7-TiYJVcoDnfhNGs160E6MbQ-QA9Ot3Tby"
window._config = {
// 是否微服务模式,业务系统根据需要读取,此demo未使用
cloudEnable: false,
baseUrl: location.origin || location.protocol + '//' + location.host,
// 是否启用单点登录
casEnable: true,
// cas 基地址
casBaseURL: 'http://192.168.2.38/cas',
services: {
// 配置到 contextPath 前一级
management: 'http://192.168.2.38',
business: 'http://localhost:7001'
}
}
fetch('<%= BASE_URL %>config.json')
.then(response => response.json())
.then(config => {
window.config = config
});
})
</script>
<body>
......
......@@ -41,7 +41,7 @@
computed: {
...mapGetters(['sidebar', 'avatar', 'name']),
baseUrl () {
return window.baseUrl;
return window._config.baseUrl;
},
},
data () {
......
......@@ -13,7 +13,7 @@ const service = axios.create({
baseURL:
process.env.NODE_ENV == "development"
? process.env.VUE_APP_BASE_API
: window.baseUrl + "/",
: window._config.baseUrl + "/",
withCredentials: true, //是否允许跨域
headers: {
'Content-Type': 'application/json; charset=utf-8'
......
'use strict'
const path = require('path')
const defaultSettings = require('./src/settings.js')
function resolve (dir) {
return path.join(__dirname, dir)
}
......