style:titile和登录
Showing
7 changed files
with
13 additions
and
9 deletions
| 1 | { | 1 | { |
| 2 | "TITLE": "汉中市数据上报系统", | 2 | "TITLE": "汉中市数据上报系统", |
| 3 | "THEME": "sb", | 3 | "THEME": "jg", |
| 4 | "LOGIN": "sb", | 4 | "LOGIN": "jg", |
| 5 | "CODE": "BDCSBPT", | 5 | "CODE": "BDCJGPT", |
| 6 | "AREARMAP": "610702", | 6 | "AREARMAP": "610702", |
| 7 | "SERVERAPI": "/bdcsjsb", | 7 | "SERVERAPI": "/bdcsjsb", |
| 8 | "calcHeight": 160, | 8 | "calcHeight": 160, | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Description: 引入配置文件 | 2 | * @Description: 引入配置文件 |
| 3 | * @Autor: renchao | 3 | * @Autor: renchao |
| 4 | * @LastEditTime: 2023-03-15 17:16:18 | 4 | * @LastEditTime: 2023-04-06 14:06:07 |
| 5 | --> | 5 | --> |
| 6 | <!DOCTYPE html> | 6 | <!DOCTYPE html> |
| 7 | <html> | 7 | <html> |
| ... | @@ -25,6 +25,7 @@ | ... | @@ -25,6 +25,7 @@ |
| 25 | </html> | 25 | </html> |
| 26 | 26 | ||
| 27 | <script> | 27 | <script> |
| 28 | console.log(webpackConfig.name, 'webpackConfig.name'); | ||
| 28 | window.baseUrl = location.origin || location.protocol + '//' + location.host | 29 | window.baseUrl = location.origin || location.protocol + '//' + location.host |
| 29 | window.timeout = 5000 | 30 | window.timeout = 5000 |
| 30 | window.authorization = "bearer AT-4-MxSrO29Coe7VTazx8uuixtqqgO-hvCB6" | 31 | window.authorization = "bearer AT-4-MxSrO29Coe7VTazx8uuixtqqgO-hvCB6" | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | * @Author: yangwei | 2 | * @Author: yangwei |
| 3 | * @Date: 2023-01-16 09:10:12 | 3 | * @Date: 2023-01-16 09:10:12 |
| 4 | * @LastEditors: Please set LastEditors | 4 | * @LastEditors: Please set LastEditors |
| 5 | * @LastEditTime: 2023-03-27 16:54:34 | 5 | * @LastEditTime: 2023-04-06 14:12:53 |
| 6 | * @FilePath: \bdcjg-web\src\main.js | 6 | * @FilePath: \bdcjg-web\src\main.js |
| 7 | * @Description: | 7 | * @Description: |
| 8 | * | 8 | * |
| ... | @@ -60,6 +60,7 @@ axios.get("./config.json") | ... | @@ -60,6 +60,7 @@ axios.get("./config.json") |
| 60 | .then((res) => { | 60 | .then((res) => { |
| 61 | Vue.prototype.BASE_API = res.data | 61 | Vue.prototype.BASE_API = res.data |
| 62 | localStorage.setItem('ApiUrl', JSON.stringify(res.data)); | 62 | localStorage.setItem('ApiUrl', JSON.stringify(res.data)); |
| 63 | window.TITLE = res.data.TITLE | ||
| 63 | require('./permission') | 64 | require('./permission') |
| 64 | new Vue({ | 65 | new Vue({ |
| 65 | el: '#app', | 66 | el: '#app', | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Description: | 2 | * @Description: |
| 3 | * @Autor: renchao | 3 | * @Autor: renchao |
| 4 | * @LastEditTime: 2023-03-15 11:08:56 | 4 | * @LastEditTime: 2023-04-06 11:26:31 |
| 5 | */ | 5 | */ |
| 6 | module.exports = { | 6 | module.exports = { |
| 7 | title: '数据上报系统', | ||
| 8 | /** | 7 | /** |
| 9 | * @type {boolean} true | false | 8 | * @type {boolean} true | false |
| 10 | * @description Whether show the settings right-panel | 9 | * @description Whether show the settings right-panel | ... | ... |
| ... | @@ -63,6 +63,8 @@ export default { | ... | @@ -63,6 +63,8 @@ export default { |
| 63 | localStorage.setItem("token", `Bearer ${res.content}`); | 63 | localStorage.setItem("token", `Bearer ${res.content}`); |
| 64 | //登录成功后需判断有无重定向,没有重定向则跳转首页 | 64 | //登录成功后需判断有无重定向,没有重定向则跳转首页 |
| 65 | this.$router.replace(this.$route.query.redirect || "/home"); | 65 | this.$router.replace(this.$route.query.redirect || "/home"); |
| 66 | } else { | ||
| 67 | this.$message.error(res.message); | ||
| 66 | } | 68 | } |
| 67 | } | 69 | } |
| 68 | }) | 70 | }) | ... | ... |
| ... | @@ -122,6 +122,8 @@ export default { | ... | @@ -122,6 +122,8 @@ export default { |
| 122 | { path: "*", redirect: "/404", hidden: true }, | 122 | { path: "*", redirect: "/404", hidden: true }, |
| 123 | ]); | 123 | ]); |
| 124 | this.$router.replace(this.$route.query.redirect || path1); | 124 | this.$router.replace(this.$route.query.redirect || path1); |
| 125 | } else { | ||
| 126 | this.$message.error(res.message); | ||
| 125 | } | 127 | } |
| 126 | } | 128 | } |
| 127 | }) | 129 | }) | ... | ... |
| 1 | 'use strict' | 1 | 'use strict' |
| 2 | const path = require('path') | 2 | const path = require('path') |
| 3 | const defaultSettings = require('./src/settings.js') | ||
| 4 | function resolve (dir) { | 3 | function resolve (dir) { |
| 5 | return path.join(__dirname, dir) | 4 | return path.join(__dirname, dir) |
| 6 | } | 5 | } |
| 7 | const name = defaultSettings.title | 6 | const name = process.env.TITLE |
| 8 | const port = process.env.port || process.env.npm_config_port || 8888 // dev port | 7 | const port = process.env.port || process.env.npm_config_port || 8888 // dev port |
| 9 | // All configuration item explanations can be find in https://cli.vuejs.org/config/ | 8 | // All configuration item explanations can be find in https://cli.vuejs.org/config/ |
| 10 | module.exports = { | 9 | module.exports = { | ... | ... |
-
Please register or sign in to post a comment