style:cas配置修改
Showing
4 changed files
with
19 additions
and
10 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Description: | 2 | * @Description: |
| 3 | * @Autor: renchao | 3 | * @Autor: renchao |
| 4 | * @LastEditTime: 2023-05-30 15:08:51 | 4 | * @LastEditTime: 2023-06-02 09:47:57 |
| 5 | --> | 5 | --> |
| 6 | <!DOCTYPE html> | 6 | <!DOCTYPE html> |
| 7 | <html> | 7 | <html> |
| ... | @@ -14,21 +14,32 @@ | ... | @@ -14,21 +14,32 @@ |
| 14 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | 14 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
| 15 | <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" /> | 15 | <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" /> |
| 16 | <title> | 16 | <title> |
| 17 | <%= webpackConfig.name %> | ||
| 18 | </title> | 17 | </title> |
| 19 | </head> | 18 | </head> |
| 20 | <script> | 19 | <script> |
| 21 | window.baseUrl = location.origin || location.protocol + '//' + location.host | 20 | window._config = { |
| 22 | const authorization = "bearer ATT-7-TiYJVcoDnfhNGs160E6MbQ-QA9Ot3Tby" | 21 | // 是否微服务模式,业务系统根据需要读取,此demo未使用 |
| 22 | cloudEnable: false, | ||
| 23 | baseUrl: location.origin || location.protocol + '//' + location.host, | ||
| 24 | // 是否启用单点登录 | ||
| 25 | casEnable: true, | ||
| 26 | // cas 基地址 | ||
| 27 | casBaseURL: 'http://192.168.2.38/cas', | ||
| 28 | services: { | ||
| 29 | // 配置到 contextPath 前一级 | ||
| 30 | management: 'http://192.168.2.38', | ||
| 31 | business: 'http://localhost:7001' | ||
| 32 | } | ||
| 33 | } | ||
| 23 | fetch('<%= BASE_URL %>config.json') | 34 | fetch('<%= BASE_URL %>config.json') |
| 24 | .then(response => response.json()) | 35 | .then(response => response.json()) |
| 25 | .then(config => { | 36 | .then(config => { |
| 26 | window.config = config | 37 | window.config = config |
| 27 | }); | 38 | }) |
| 28 | </script> | 39 | </script> |
| 29 | 40 | ||
| 30 | <body> | 41 | <body> |
| 31 | <div id="app"></div> | 42 | <div id="app"></div> |
| 32 | </body> | 43 | </body> |
| 33 | 44 | ||
| 34 | </html> | 45 | </html> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -41,7 +41,7 @@ | ... | @@ -41,7 +41,7 @@ |
| 41 | computed: { | 41 | computed: { |
| 42 | ...mapGetters(['sidebar', 'avatar', 'name']), | 42 | ...mapGetters(['sidebar', 'avatar', 'name']), |
| 43 | baseUrl () { | 43 | baseUrl () { |
| 44 | return window.baseUrl; | 44 | return window._config.baseUrl; |
| 45 | }, | 45 | }, |
| 46 | }, | 46 | }, |
| 47 | data () { | 47 | data () { | ... | ... |
| ... | @@ -13,7 +13,7 @@ const service = axios.create({ | ... | @@ -13,7 +13,7 @@ const service = axios.create({ |
| 13 | baseURL: | 13 | baseURL: |
| 14 | process.env.NODE_ENV == "development" | 14 | process.env.NODE_ENV == "development" |
| 15 | ? process.env.VUE_APP_BASE_API | 15 | ? process.env.VUE_APP_BASE_API |
| 16 | : window.baseUrl + "/", | 16 | : window._config.baseUrl + "/", |
| 17 | withCredentials: true, //是否允许跨域 | 17 | withCredentials: true, //是否允许跨域 |
| 18 | headers: { | 18 | headers: { |
| 19 | 'Content-Type': 'application/json; charset=utf-8' | 19 | 'Content-Type': 'application/json; charset=utf-8' | ... | ... |
-
Please register or sign in to post a comment