xs-common-plugins 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +298 -298
- package/common.js +110 -110
- package/index.js +1 -1
- package/package.json +16 -16
- package/src/common/common.js +548 -548
- package/src/components/CheckBox_Cmp/index.vue +62 -62
- package/src/components/FormItem/index.vue +92 -92
- package/src/components/ReportCmp/index.vue +76 -76
- package/src/components/Search/index.scss +219 -219
- package/src/components/Search/index.vue +410 -410
- package/src/components/Search/product_option/index.scss +1 -1
- package/src/components/Search_filter/index.scss +104 -104
- package/src/components/TableItem/TableItem.vue +55 -55
- package/src/components/TextOVer/index.vue +55 -55
- package/src/components/UploadImg/index.vue +177 -177
- package/src/components/im/index.vue +155 -155
- package/src/components/im/pages/chatList/index.vue +45 -45
- package/src/components/im/pages/chatRoom/index.vue +159 -159
- package/src/components/xsSelect/index.vue +125 -125
- package/src/mixin/keepAlive.js +52 -0
- package/src/plugins/im/components/chat/index.scss +163 -163
- package/src/plugins/im/components/chat/index.vue +144 -144
- package/src/plugins/im/components/chat/methods.js +149 -149
- package/src/plugins/im/components/msg-image/index.vue +40 -40
- package/src/plugins/im/components/send-msg/index.scss +164 -164
- package/src/plugins/im/components/send-msg/index.vue +107 -107
- package/src/plugins/im/components/send-msg/methods.js +125 -125
- package/src/plugins/im/components/template-message/index.vue +76 -76
- package/src/plugins/im/components/without.vue +19 -19
- package/src/plugins/im/index.js +31 -31
- package/src/plugins/im/utils/services.js +625 -625
- package/src/plugins/index.js +60 -60
- package/src/plugins/row-col-cmp/index.js +20 -20
- package/src/router/permission.js +126 -126
- package/src/store/modules/dic.js +74 -74
- package/src/store/modules/oss.js +40 -40
- package/src/styles/index.scss +91 -91
- package/src/styles/table.scss +90 -90
- package/src/utils/api.js +54 -54
- package/src/utils/auth.js +38 -38
- package/src/utils/concat_batch_btns.js +88 -88
- package/src/utils/enum.js +150 -150
- package/src/utils/filter.js +5 -5
- package/src/utils/filterRules.js +55 -55
- package/src/utils/getMenu.js +82 -82
- package/src/utils/global_directive.js +10 -0
- package/src/utils/ossService.js +55 -55
- package/src/utils/prototype.js +46 -46
- package/src/utils/search.js +33 -33
- package/src/utils/signalR.js +24 -24
- package/src/views/callback/index.vue +35 -35
- package/src/views/home/index.vue +25 -25
- package/src/views/layout/components/AppMain.vue +21 -5
- package/src/views/layout/components/Navbar.vue +20 -13
- package/src/views/layout/components/TagsView/index.vue +130 -91
- package/src/views/slienceAuth/index.vue +42 -42
package/src/styles/index.scss
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
@import './variables.scss';
|
|
2
|
-
@import './mixin.scss';
|
|
3
|
-
@import './transition.scss';
|
|
4
|
-
@import './element-ui.scss';
|
|
5
|
-
@import './sidebar.scss';
|
|
6
|
-
@import '../../static/icon/iconfont.css';
|
|
7
|
-
|
|
8
|
-
body {
|
|
9
|
-
height: 100%;
|
|
10
|
-
-moz-osx-font-smoothing: grayscale;
|
|
11
|
-
-webkit-font-smoothing: antialiased;
|
|
12
|
-
text-rendering: optimizeLegibility;
|
|
13
|
-
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// label {
|
|
17
|
-
// font-weight: 700;
|
|
18
|
-
// }
|
|
19
|
-
|
|
20
|
-
html {
|
|
21
|
-
height: 100%;
|
|
22
|
-
box-sizing: border-box;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
#app {
|
|
26
|
-
height: 100%;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
*,
|
|
30
|
-
*:before,
|
|
31
|
-
*:after {
|
|
32
|
-
box-sizing: inherit;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
a:focus,
|
|
36
|
-
a:active {
|
|
37
|
-
outline: none;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
a,
|
|
41
|
-
a:focus,
|
|
42
|
-
a:hover {
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
color: inherit;
|
|
45
|
-
text-decoration: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
div:focus {
|
|
49
|
-
outline: none;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.clearfix {
|
|
53
|
-
&:after {
|
|
54
|
-
visibility: hidden;
|
|
55
|
-
display: block;
|
|
56
|
-
font-size: 0;
|
|
57
|
-
content: " ";
|
|
58
|
-
clear: both;
|
|
59
|
-
height: 0;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// main-container global css
|
|
64
|
-
.app-container {
|
|
65
|
-
padding: 20px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
ul,
|
|
69
|
-
li {
|
|
70
|
-
list-style: none;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.el-dialog__header {
|
|
74
|
-
padding: 10px 20px;
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.el-dialog__body {
|
|
79
|
-
padding: 10px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.el-select {
|
|
83
|
-
width: 100%;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.dlg-wrapper {
|
|
88
|
-
.el-date-editor.el-input,
|
|
89
|
-
.el-date-editor.el-input__inner {
|
|
90
|
-
width: 100%;
|
|
91
|
-
}
|
|
1
|
+
@import './variables.scss';
|
|
2
|
+
@import './mixin.scss';
|
|
3
|
+
@import './transition.scss';
|
|
4
|
+
@import './element-ui.scss';
|
|
5
|
+
@import './sidebar.scss';
|
|
6
|
+
@import '../../static/icon/iconfont.css';
|
|
7
|
+
|
|
8
|
+
body {
|
|
9
|
+
height: 100%;
|
|
10
|
+
-moz-osx-font-smoothing: grayscale;
|
|
11
|
+
-webkit-font-smoothing: antialiased;
|
|
12
|
+
text-rendering: optimizeLegibility;
|
|
13
|
+
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// label {
|
|
17
|
+
// font-weight: 700;
|
|
18
|
+
// }
|
|
19
|
+
|
|
20
|
+
html {
|
|
21
|
+
height: 100%;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#app {
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
*,
|
|
30
|
+
*:before,
|
|
31
|
+
*:after {
|
|
32
|
+
box-sizing: inherit;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
a:focus,
|
|
36
|
+
a:active {
|
|
37
|
+
outline: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
a,
|
|
41
|
+
a:focus,
|
|
42
|
+
a:hover {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
color: inherit;
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
div:focus {
|
|
49
|
+
outline: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.clearfix {
|
|
53
|
+
&:after {
|
|
54
|
+
visibility: hidden;
|
|
55
|
+
display: block;
|
|
56
|
+
font-size: 0;
|
|
57
|
+
content: " ";
|
|
58
|
+
clear: both;
|
|
59
|
+
height: 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// main-container global css
|
|
64
|
+
.app-container {
|
|
65
|
+
padding: 20px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
ul,
|
|
69
|
+
li {
|
|
70
|
+
list-style: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.el-dialog__header {
|
|
74
|
+
padding: 10px 20px;
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.el-dialog__body {
|
|
79
|
+
padding: 10px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.el-select {
|
|
83
|
+
width: 100%;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
.dlg-wrapper {
|
|
88
|
+
.el-date-editor.el-input,
|
|
89
|
+
.el-date-editor.el-input__inner {
|
|
90
|
+
width: 100%;
|
|
91
|
+
}
|
|
92
92
|
}
|
package/src/styles/table.scss
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
.table-container {
|
|
2
|
-
position: relative;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
width: 100%;
|
|
7
|
-
padding: 10px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.table-box {
|
|
11
|
-
height: 100%;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.el-image-viewer__close {
|
|
15
|
-
color: #fff;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.el-image-viewer__next,
|
|
19
|
-
.el-image-viewer__prev {
|
|
20
|
-
background-color: #606266;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.formClass tbody td .cell img {
|
|
24
|
-
width: 100px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
tbody td .cell img {
|
|
28
|
-
width: 100px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.el-table .table-row-bg-green {
|
|
32
|
-
background: rgb(161, 240, 161);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.el-table .table-row-bg-red {
|
|
36
|
-
background: rgb(240, 176, 176);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.el-table .table-row-bg-grey {
|
|
40
|
-
background: rgb(231, 226, 226);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.el-table .table-row-bg-yellow {
|
|
44
|
-
background: rgb(236, 236, 146);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.el-table tbody td .cell {
|
|
48
|
-
line-height: 18px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.el-table .table-row-warning {
|
|
52
|
-
// background-color: #fdf6ec;
|
|
53
|
-
color: #e6a23c;
|
|
54
|
-
a{color: #e6a23c;
|
|
55
|
-
text-decoration: underline;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.el-table .table-row-info {
|
|
61
|
-
// background-color: #f4f4f5;
|
|
62
|
-
color: #909399;
|
|
63
|
-
a{color: #909399;
|
|
64
|
-
text-decoration: underline;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.el-table .table-row-error {
|
|
69
|
-
// background-color: #fef0f0;
|
|
70
|
-
color: #f56c6c;
|
|
71
|
-
a{color: #f56c6c;
|
|
72
|
-
text-decoration: underline;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.el-table .table-row-success {
|
|
77
|
-
// background-color: #f0f9eb;
|
|
78
|
-
color: #67c23a;
|
|
79
|
-
a{color: #67c23a;
|
|
80
|
-
text-decoration: underline;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
//影响全局的样式, 单项目里自行调整
|
|
85
|
-
// .el-radio-group {
|
|
86
|
-
// margin-top: 13px;
|
|
87
|
-
// >div {
|
|
88
|
-
// margin-right: 30px;
|
|
89
|
-
// }
|
|
90
|
-
// }
|
|
1
|
+
.table-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
width: 100%;
|
|
7
|
+
padding: 10px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.table-box {
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.el-image-viewer__close {
|
|
15
|
+
color: #fff;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.el-image-viewer__next,
|
|
19
|
+
.el-image-viewer__prev {
|
|
20
|
+
background-color: #606266;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.formClass tbody td .cell img {
|
|
24
|
+
width: 100px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
tbody td .cell img {
|
|
28
|
+
width: 100px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.el-table .table-row-bg-green {
|
|
32
|
+
background: rgb(161, 240, 161);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.el-table .table-row-bg-red {
|
|
36
|
+
background: rgb(240, 176, 176);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.el-table .table-row-bg-grey {
|
|
40
|
+
background: rgb(231, 226, 226);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.el-table .table-row-bg-yellow {
|
|
44
|
+
background: rgb(236, 236, 146);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.el-table tbody td .cell {
|
|
48
|
+
line-height: 18px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.el-table .table-row-warning {
|
|
52
|
+
// background-color: #fdf6ec;
|
|
53
|
+
color: #e6a23c;
|
|
54
|
+
a{color: #e6a23c;
|
|
55
|
+
text-decoration: underline;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
.el-table .table-row-info {
|
|
61
|
+
// background-color: #f4f4f5;
|
|
62
|
+
color: #909399;
|
|
63
|
+
a{color: #909399;
|
|
64
|
+
text-decoration: underline;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.el-table .table-row-error {
|
|
69
|
+
// background-color: #fef0f0;
|
|
70
|
+
color: #f56c6c;
|
|
71
|
+
a{color: #f56c6c;
|
|
72
|
+
text-decoration: underline;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.el-table .table-row-success {
|
|
77
|
+
// background-color: #f0f9eb;
|
|
78
|
+
color: #67c23a;
|
|
79
|
+
a{color: #67c23a;
|
|
80
|
+
text-decoration: underline;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//影响全局的样式, 单项目里自行调整
|
|
85
|
+
// .el-radio-group {
|
|
86
|
+
// margin-top: 13px;
|
|
87
|
+
// >div {
|
|
88
|
+
// margin-right: 30px;
|
|
89
|
+
// }
|
|
90
|
+
// }
|
package/src/utils/api.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
// import globalCfg from '@global'
|
|
2
|
-
|
|
3
|
-
const globalCfg = require('@/modules/module.config')
|
|
4
|
-
const modulesContext = require.context('../modules/', true, /..\.js$/)
|
|
5
|
-
|
|
6
|
-
let API = {
|
|
7
|
-
'api.OldLogin': 'webApi/sysuser/Login',
|
|
8
|
-
'api.GetValidateCode': 'webApi/sysuser/GetValidateCode', // 验证码获取
|
|
9
|
-
'api.GetConfig': '@ucuser/api/sys/ScanConfig/GetConfig', //获取微信二维码参数
|
|
10
|
-
'api.Id4Login': 'Account/Login', //认证服务登陆
|
|
11
|
-
'api.ScanAuth': '@ucuser/api/sys/ScanCallBack/AuthCallBack',//扫码登陆回调地址
|
|
12
|
-
'api.GetProject': '@ucuser/api/sys/Client/GeProject', //获取客户端名称
|
|
13
|
-
'api.smsValidate': '/AccountBO/GetValidate',
|
|
14
|
-
|
|
15
|
-
'api.bannerreport.query': '@commng/api/report/BannerReport/Query',//测试报表
|
|
16
|
-
'api.report.GetById': '@commng/api/report/ReportCfg/Reports/{id}',
|
|
17
|
-
|
|
18
|
-
'api.GetMenuTree': '@ucmng/api/sysmng/MenuOper',
|
|
19
|
-
'api.SyncMenu': `@ucmng/api/sysmng/MenuOper/BuildMenu`,
|
|
20
|
-
'api.GetMenuTreeByUser': `@ucuser/api/sys/CurUser/Menu`,
|
|
21
|
-
'api.UpdatePwd': `@ucuser/api/sys/CurUser/ChangePwd`, //修改密码 PUT
|
|
22
|
-
'api.Login': `@ucuser/api/sys/CurUser/Login`, //用户登录 POST
|
|
23
|
-
'api.getUserInfo': `@ucuser/api/sys/CurUser/Menu`,
|
|
24
|
-
'api.GetBySelf':'@ucuser/api/sys/CurUser', //获取当前用户信息
|
|
25
|
-
|
|
26
|
-
'api.ChangePwd': 'webApi/sysuser/ChangePwd',
|
|
27
|
-
'api.UserQuery': '@ucuser/api/User/Query', //查询用户数据 POST
|
|
28
|
-
'api.GetUserById': '@ucuser/api/User/GetById/{id}', //获取单个用户数据 GET
|
|
29
|
-
'api.UserBindRole': '@ucuser/api/User/BindRole', //用户绑定角色 PUT
|
|
30
|
-
'api.UserEdit': '@ucuser/apu/User/Edit', //修改用户数据 Put
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// 遍历所有 映射 api
|
|
34
|
-
const chunks = modulesContext.keys().reduce((modules, key) => {
|
|
35
|
-
// 获取环境依赖模块名称,只整合依赖的模块映射的 api
|
|
36
|
-
globalCfg.IMPORT_MODULES.forEach(moduleName => {
|
|
37
|
-
// 正则判断整合的映射api 是不是依赖模块下的
|
|
38
|
-
var reg = new RegExp(`${moduleName}/\api\/[A-Za-z_-]*.js$`)
|
|
39
|
-
const res = reg.test(key)
|
|
40
|
-
if (res) {
|
|
41
|
-
// 跟踪整合的映射文件
|
|
42
|
-
API = {
|
|
43
|
-
...API,
|
|
44
|
-
...modulesContext(key).default
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return API
|
|
48
|
-
})
|
|
49
|
-
return API
|
|
50
|
-
}, {})
|
|
51
|
-
|
|
52
|
-
export default {
|
|
53
|
-
...chunks
|
|
54
|
-
}
|
|
1
|
+
// import globalCfg from '@global'
|
|
2
|
+
|
|
3
|
+
const globalCfg = require('@/modules/module.config')
|
|
4
|
+
const modulesContext = require.context('../modules/', true, /..\.js$/)
|
|
5
|
+
|
|
6
|
+
let API = {
|
|
7
|
+
'api.OldLogin': 'webApi/sysuser/Login',
|
|
8
|
+
'api.GetValidateCode': 'webApi/sysuser/GetValidateCode', // 验证码获取
|
|
9
|
+
'api.GetConfig': '@ucuser/api/sys/ScanConfig/GetConfig', //获取微信二维码参数
|
|
10
|
+
'api.Id4Login': 'Account/Login', //认证服务登陆
|
|
11
|
+
'api.ScanAuth': '@ucuser/api/sys/ScanCallBack/AuthCallBack',//扫码登陆回调地址
|
|
12
|
+
'api.GetProject': '@ucuser/api/sys/Client/GeProject', //获取客户端名称
|
|
13
|
+
'api.smsValidate': '/AccountBO/GetValidate',
|
|
14
|
+
|
|
15
|
+
'api.bannerreport.query': '@commng/api/report/BannerReport/Query',//测试报表
|
|
16
|
+
'api.report.GetById': '@commng/api/report/ReportCfg/Reports/{id}',
|
|
17
|
+
|
|
18
|
+
'api.GetMenuTree': '@ucmng/api/sysmng/MenuOper',
|
|
19
|
+
'api.SyncMenu': `@ucmng/api/sysmng/MenuOper/BuildMenu`,
|
|
20
|
+
'api.GetMenuTreeByUser': `@ucuser/api/sys/CurUser/Menu`,
|
|
21
|
+
'api.UpdatePwd': `@ucuser/api/sys/CurUser/ChangePwd`, //修改密码 PUT
|
|
22
|
+
'api.Login': `@ucuser/api/sys/CurUser/Login`, //用户登录 POST
|
|
23
|
+
'api.getUserInfo': `@ucuser/api/sys/CurUser/Menu`,
|
|
24
|
+
'api.GetBySelf':'@ucuser/api/sys/CurUser', //获取当前用户信息
|
|
25
|
+
|
|
26
|
+
'api.ChangePwd': 'webApi/sysuser/ChangePwd',
|
|
27
|
+
'api.UserQuery': '@ucuser/api/User/Query', //查询用户数据 POST
|
|
28
|
+
'api.GetUserById': '@ucuser/api/User/GetById/{id}', //获取单个用户数据 GET
|
|
29
|
+
'api.UserBindRole': '@ucuser/api/User/BindRole', //用户绑定角色 PUT
|
|
30
|
+
'api.UserEdit': '@ucuser/apu/User/Edit', //修改用户数据 Put
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 遍历所有 映射 api
|
|
34
|
+
const chunks = modulesContext.keys().reduce((modules, key) => {
|
|
35
|
+
// 获取环境依赖模块名称,只整合依赖的模块映射的 api
|
|
36
|
+
globalCfg.IMPORT_MODULES.forEach(moduleName => {
|
|
37
|
+
// 正则判断整合的映射api 是不是依赖模块下的
|
|
38
|
+
var reg = new RegExp(`${moduleName}/\api\/[A-Za-z_-]*.js$`)
|
|
39
|
+
const res = reg.test(key)
|
|
40
|
+
if (res) {
|
|
41
|
+
// 跟踪整合的映射文件
|
|
42
|
+
API = {
|
|
43
|
+
...API,
|
|
44
|
+
...modulesContext(key).default
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return API
|
|
48
|
+
})
|
|
49
|
+
return API
|
|
50
|
+
}, {})
|
|
51
|
+
|
|
52
|
+
export default {
|
|
53
|
+
...chunks
|
|
54
|
+
}
|
package/src/utils/auth.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { getConfig } from '@/utils/global-config';
|
|
2
|
-
import Cookies from 'js-cookie';
|
|
3
|
-
|
|
4
|
-
const TokenKey = `${getConfig('CLIENT_ID')}_token`
|
|
5
|
-
let domain = 'localhost';
|
|
6
|
-
if (document.domain !== 'localhost') {
|
|
7
|
-
domain = `.${document.domain.split('.').slice(-2).join('.')}`
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function getToken(tokenKey) {
|
|
11
|
-
if (window.parent !== window.self) { // 作为第三方系统被嵌套在iframe中使用
|
|
12
|
-
return sessionStorage.getItem('token')
|
|
13
|
-
}
|
|
14
|
-
if (tokenKey) return Cookies.get(tokenKey)
|
|
15
|
-
return Cookies.get(TokenKey)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function setToken(tokenKey, value) {
|
|
19
|
-
|
|
20
|
-
if (arguments.length == 2) {
|
|
21
|
-
return Cookies.set(tokenKey, value, { domain: domain, path: '/' })
|
|
22
|
-
}
|
|
23
|
-
return Cookies.set(TokenKey, tokenKey, { domain: domain, path: '/' })
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function removeToken(tokenKey) {
|
|
27
|
-
if (tokenKey) return Cookies.remove(tokenKey, { domain: domain })
|
|
28
|
-
return Cookies.remove(TokenKey, { domain: domain })
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export function setLocalToken(tokenKey, value) {
|
|
33
|
-
return Cookies.set(tokenKey, value, { domain: 'localhost', path: '/' });
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function removeLocalToken(tokenKey) {
|
|
37
|
-
return Cookies.remove(tokenKey, { domain: 'localhost' });
|
|
38
|
-
}
|
|
1
|
+
import { getConfig } from '@/utils/global-config';
|
|
2
|
+
import Cookies from 'js-cookie';
|
|
3
|
+
|
|
4
|
+
const TokenKey = `${getConfig('CLIENT_ID')}_token`
|
|
5
|
+
let domain = 'localhost';
|
|
6
|
+
if (document.domain !== 'localhost') {
|
|
7
|
+
domain = `.${document.domain.split('.').slice(-2).join('.')}`
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function getToken(tokenKey) {
|
|
11
|
+
if (window.parent !== window.self) { // 作为第三方系统被嵌套在iframe中使用
|
|
12
|
+
return sessionStorage.getItem('token')
|
|
13
|
+
}
|
|
14
|
+
if (tokenKey) return Cookies.get(tokenKey)
|
|
15
|
+
return Cookies.get(TokenKey)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function setToken(tokenKey, value) {
|
|
19
|
+
|
|
20
|
+
if (arguments.length == 2) {
|
|
21
|
+
return Cookies.set(tokenKey, value, { domain: domain, path: '/' })
|
|
22
|
+
}
|
|
23
|
+
return Cookies.set(TokenKey, tokenKey, { domain: domain, path: '/' })
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function removeToken(tokenKey) {
|
|
27
|
+
if (tokenKey) return Cookies.remove(tokenKey, { domain: domain })
|
|
28
|
+
return Cookies.remove(TokenKey, { domain: domain })
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export function setLocalToken(tokenKey, value) {
|
|
33
|
+
return Cookies.set(tokenKey, value, { domain: 'localhost', path: '/' });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function removeLocalToken(tokenKey) {
|
|
37
|
+
return Cookies.remove(tokenKey, { domain: 'localhost' });
|
|
38
|
+
}
|