config.js
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { getToken } from '@/utils/auth'
window.CONFIG = {
/**
* 是否系统布局配置
*/
showSettings: false,
/**
* 是否显示 tagsView
*/
tagsView: true,
/**
* 是否固定头部
*/
fixedHeader: false,
/**
* 是否显示logo
*/
sidebarLogo: true,
/**
* @type {string | array} 'production' | ['production', 'development']
* @description Need show err logs component.
* The default is only used in the production env
* If you want to also use it in dev, you can pass ['production', 'development']
*/
errorLog: 'production',
services: {
wecom: '/wecom',
common: '/common',
},
/**
* 前端生成群活码跳转的H5链接
* 由于群活码是由前端生成,需要配置一下群活码跳转的链接
* 例如: http://xxx.xxx.xx/h5/groupCode
*/
groupCodeH5Link: 'http://linkwechat.cn/mobile/#/groupCode',
get headers() {
return { Authorization: 'Bearer ' + getToken() }
},
}
// 统一为img的src不是绝对地址的拼接接口地址
document.addEventListener(
'error',
function(e) {
let target = e.target
let src = target.attributes.getNamedItem('src').value
if (
target.tagName.toUpperCase() === 'IMG' &&
src &&
!src.includes('http')
) {
target.src = process.env.VUE_APP_BASE_API + src
}
},
true
)
export default window.CONFIG