vue2-client 1.6.49 → 1.7.0
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/.env +15 -15
- package/CHANGELOG.md +628 -625
- package/index.js +30 -30
- package/package.json +81 -81
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
- package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +667 -667
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +733 -733
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +468 -462
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +146 -140
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
- package/src/base-client/components/common/Upload/Upload.vue +168 -168
- package/src/base-client/components/common/XAddForm/XAddForm.vue +325 -325
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +279 -279
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XForm/XForm.vue +180 -180
- package/src/base-client/components/common/XForm/XFormItem.vue +513 -513
- package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
- package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
- package/src/base-client/components/common/XFormTable/XFormTable.vue +344 -336
- package/src/base-client/components/common/XFormTable/index.md +97 -97
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
- package/src/base-client/components/common/XTable/XTable.vue +506 -506
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
- package/src/base-client/plugins/AppData.js +76 -76
- package/src/base-client/plugins/GetLoginInfoService.js +179 -179
- package/src/base-client/plugins/PagedList.js +177 -177
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/base-client/plugins/i18n-extend.js +32 -32
- package/src/components/Ellipsis/Ellipsis.vue +65 -65
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/STable/index.js +318 -318
- package/src/components/Trend/index.md +45 -45
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/form/FormRow.vue +52 -52
- package/src/components/index.js +36 -36
- package/src/components/menu/SideMenu.vue +62 -62
- package/src/components/menu/menu.js +273 -273
- package/src/components/page/header/index.less +40 -40
- package/src/components/setting/Setting.vue +235 -235
- package/src/components/table/StandardTable.vue +141 -141
- package/src/components/table/advance/ActionColumns.vue +158 -158
- package/src/components/table/advance/SearchArea.vue +355 -355
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/components/tool/AvatarList.vue +68 -68
- package/src/components/tool/Drawer.vue +142 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/config/CreateQueryConfig.js +307 -307
- package/src/config/default/admin.config.js +18 -18
- package/src/config/replacer/resolve.config.js +67 -67
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +116 -116
- package/src/layouts/footer/PageFooter.vue +49 -49
- package/src/layouts/header/AdminHeader.vue +134 -134
- package/src/layouts/header/HeaderAvatar.vue +64 -64
- package/src/layouts/header/HeaderNotice.vue +176 -176
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/header/index.less +92 -92
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +379 -379
- package/src/mock/goods/index.js +108 -108
- package/src/pages/CreateQueryPage.vue +84 -84
- package/src/pages/login/Login.vue +369 -369
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/dictionary/index.vue +43 -43
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/monitor/loginInfor/index.vue +36 -36
- package/src/pages/system/monitor/operLog/index.vue +36 -36
- package/src/pages/system/settings/index.vue +126 -126
- package/src/pages/system/settings/modifyPassword.vue +109 -109
- package/src/router/async/config.async.js +28 -28
- package/src/router/async/router.map.js +66 -68
- package/src/router/index.js +27 -27
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +34 -34
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +137 -132
- package/src/services/api/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/logininfor/index.js +6 -6
- package/src/services/api/manage.js +8 -8
- package/src/services/apiService.js +14 -14
- package/src/services/user.js +67 -67
- package/src/store/modules/index.js +4 -4
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +58 -58
- package/src/utils/EncryptUtil.js +53 -53
- package/src/utils/colors.js +107 -107
- package/src/utils/excel/Blob.js +180 -180
- package/src/utils/excel/Export2Excel.js +141 -141
- package/src/utils/formatter.js +68 -68
- package/src/utils/i18n.js +80 -80
- package/src/utils/map-utils.js +37 -37
- package/src/utils/theme-color-replacer-extend.js +91 -91
- package/src/utils/themeUtil.js +100 -100
- package/src/utils/util.js +230 -230
- package/vue.config.js +106 -106
- package/src/pages/system/queryParams/index.vue +0 -43
|
@@ -1,68 +1,66 @@
|
|
|
1
|
-
const { homePage } = require('../../config')
|
|
2
|
-
// 视图组件
|
|
3
|
-
const view = {
|
|
4
|
-
tabs: () => import('@vue2-client/layouts/tabs'),
|
|
5
|
-
blank: () => import('@vue2-client/layouts/BlankView'),
|
|
6
|
-
page: () => import('@vue2-client/layouts/PageView')
|
|
7
|
-
}
|
|
8
|
-
// 动态路由对象定义
|
|
9
|
-
const routerResource = {}
|
|
10
|
-
// --------------------------------------基本视图组件--------------------------------------
|
|
11
|
-
// 空白视图
|
|
12
|
-
routerResource.blank = view.blank
|
|
13
|
-
// 单页面视图
|
|
14
|
-
routerResource.singlePage = view.blank
|
|
15
|
-
|
|
16
|
-
// --------------------------------------仪表盘--------------------------------------
|
|
17
|
-
routerResource.dashboard = view.blank
|
|
18
|
-
// 工作台
|
|
19
|
-
routerResource.workplace = () => import('@vue2-client/pages/dashboard/workplace')
|
|
20
|
-
// --------------------------------------系统配置--------------------------------------
|
|
21
|
-
routerResource.system = view.blank
|
|
22
|
-
// 字典管理
|
|
23
|
-
routerResource.dictionaryManage = () => import('@vue2-client/pages/system/dictionary')
|
|
24
|
-
//
|
|
25
|
-
routerResource.
|
|
26
|
-
//
|
|
27
|
-
routerResource.
|
|
28
|
-
//
|
|
29
|
-
routerResource.
|
|
30
|
-
//
|
|
31
|
-
routerResource.
|
|
32
|
-
//
|
|
33
|
-
routerResource.
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
Object.assign(routerMap, routerResource)
|
|
68
|
-
export default routerMap
|
|
1
|
+
const { homePage } = require('../../config')
|
|
2
|
+
// 视图组件
|
|
3
|
+
const view = {
|
|
4
|
+
tabs: () => import('@vue2-client/layouts/tabs'),
|
|
5
|
+
blank: () => import('@vue2-client/layouts/BlankView'),
|
|
6
|
+
page: () => import('@vue2-client/layouts/PageView')
|
|
7
|
+
}
|
|
8
|
+
// 动态路由对象定义
|
|
9
|
+
const routerResource = {}
|
|
10
|
+
// --------------------------------------基本视图组件--------------------------------------
|
|
11
|
+
// 空白视图
|
|
12
|
+
routerResource.blank = view.blank
|
|
13
|
+
// 单页面视图
|
|
14
|
+
routerResource.singlePage = view.blank
|
|
15
|
+
|
|
16
|
+
// --------------------------------------仪表盘--------------------------------------
|
|
17
|
+
routerResource.dashboard = view.blank
|
|
18
|
+
// 工作台
|
|
19
|
+
routerResource.workplace = () => import('@vue2-client/pages/dashboard/workplace')
|
|
20
|
+
// --------------------------------------系统配置--------------------------------------
|
|
21
|
+
routerResource.system = view.blank
|
|
22
|
+
// 字典管理
|
|
23
|
+
routerResource.dictionaryManage = () => import('@vue2-client/pages/system/dictionary')
|
|
24
|
+
// 文件管理
|
|
25
|
+
routerResource.fileManager = () => import('@vue2-client/pages/system/file')
|
|
26
|
+
// 登录日志
|
|
27
|
+
routerResource.loginInfor = () => import('@vue2-client/pages/system/monitor/loginInfor')
|
|
28
|
+
// 操作日志
|
|
29
|
+
routerResource.operLog = () => import('@vue2-client/pages/system/monitor/operLog')
|
|
30
|
+
// 系统问题反馈工单
|
|
31
|
+
routerResource.submitTicket = () => import('@vue2-client/pages/system/ticket')
|
|
32
|
+
// 系统设置
|
|
33
|
+
routerResource.settings = () => import('@vue2-client/pages/system/settings')
|
|
34
|
+
|
|
35
|
+
// 基础路由组件注册
|
|
36
|
+
const routerMap = {
|
|
37
|
+
login: {
|
|
38
|
+
authority: '*',
|
|
39
|
+
path: '/login',
|
|
40
|
+
component: () => import('@vue2-client/pages/login')
|
|
41
|
+
},
|
|
42
|
+
root: {
|
|
43
|
+
path: '/',
|
|
44
|
+
name: '首页',
|
|
45
|
+
redirect: homePage,
|
|
46
|
+
component: view.tabs
|
|
47
|
+
},
|
|
48
|
+
exp403: {
|
|
49
|
+
authority: '*',
|
|
50
|
+
name: 'exp403',
|
|
51
|
+
path: '403',
|
|
52
|
+
component: () => import('@vue2-client/pages/exception/403')
|
|
53
|
+
},
|
|
54
|
+
exp404: {
|
|
55
|
+
name: 'exp404',
|
|
56
|
+
path: '404',
|
|
57
|
+
component: () => import('@vue2-client/pages/exception/404')
|
|
58
|
+
},
|
|
59
|
+
exp500: {
|
|
60
|
+
name: 'exp500',
|
|
61
|
+
path: '500',
|
|
62
|
+
component: () => import('@vue2-client/pages/exception/500')
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
Object.assign(routerMap, routerResource)
|
|
66
|
+
export default routerMap
|
package/src/router/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { formatRoutes } from '@vue2-client/utils/routerUtil'
|
|
2
|
-
|
|
3
|
-
// 不需要登录拦截的路由配置
|
|
4
|
-
const loginIgnore = {
|
|
5
|
-
names: ['404', '403'], // 根据路由名称匹配
|
|
6
|
-
paths: ['/login', '/submitTicket'], // 根据路由fullPath匹配
|
|
7
|
-
/**
|
|
8
|
-
* 判断路由是否包含在该配置中
|
|
9
|
-
* @param route vue-router 的 route 对象
|
|
10
|
-
* @returns {boolean}
|
|
11
|
-
*/
|
|
12
|
-
includes (route) {
|
|
13
|
-
return this.names.includes(route.name) || this.paths.includes(route.path)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 初始化路由实例
|
|
19
|
-
* @param isAsync 是否异步路由模式
|
|
20
|
-
* @returns {RouterOptions}
|
|
21
|
-
*/
|
|
22
|
-
function initRouter (isAsync) {
|
|
23
|
-
const options = require('./async/config.async').default
|
|
24
|
-
formatRoutes(options.routes)
|
|
25
|
-
return options
|
|
26
|
-
}
|
|
27
|
-
export { loginIgnore, initRouter }
|
|
1
|
+
import { formatRoutes } from '@vue2-client/utils/routerUtil'
|
|
2
|
+
|
|
3
|
+
// 不需要登录拦截的路由配置
|
|
4
|
+
const loginIgnore = {
|
|
5
|
+
names: ['404', '403'], // 根据路由名称匹配
|
|
6
|
+
paths: ['/login', '/submitTicket'], // 根据路由fullPath匹配
|
|
7
|
+
/**
|
|
8
|
+
* 判断路由是否包含在该配置中
|
|
9
|
+
* @param route vue-router 的 route 对象
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/
|
|
12
|
+
includes (route) {
|
|
13
|
+
return this.names.includes(route.name) || this.paths.includes(route.path)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 初始化路由实例
|
|
19
|
+
* @param isAsync 是否异步路由模式
|
|
20
|
+
* @returns {RouterOptions}
|
|
21
|
+
*/
|
|
22
|
+
function initRouter (isAsync) {
|
|
23
|
+
const options = require('./async/config.async').default
|
|
24
|
+
formatRoutes(options.routes)
|
|
25
|
+
return options
|
|
26
|
+
}
|
|
27
|
+
export { loginIgnore, initRouter }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const DictionaryDetailsViewApi = {
|
|
2
|
-
// 查询:获取字典详情
|
|
3
|
-
getDictionaryDetails: '/api/
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export { DictionaryDetailsViewApi }
|
|
1
|
+
const DictionaryDetailsViewApi = {
|
|
2
|
+
// 查询:获取字典详情
|
|
3
|
+
getDictionaryDetails: '/api/system/logic/getDictionaryDetails'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export { DictionaryDetailsViewApi }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const LogDetailsViewApi = {
|
|
2
|
-
// 查询:获取日志详情
|
|
3
|
-
getLogDetails: '/api/
|
|
4
|
-
// 查询:获取日志维护记录
|
|
5
|
-
getLogRecordList: '/api/
|
|
6
|
-
// 操作:更新日志状态
|
|
7
|
-
updateLogStatusData: '/api/
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { LogDetailsViewApi }
|
|
1
|
+
const LogDetailsViewApi = {
|
|
2
|
+
// 查询:获取日志详情
|
|
3
|
+
getLogDetails: '/api/system/logic/foreignaidGetLogDetails',
|
|
4
|
+
// 查询:获取日志维护记录
|
|
5
|
+
getLogRecordList: '/api/system/logic/foreignaidGetRecordList',
|
|
6
|
+
// 操作:更新日志状态
|
|
7
|
+
updateLogStatusData: '/api/system/logic/foreignaidUpdateLogStatus'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { LogDetailsViewApi }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const QueryParamsDetailsViewApi = {
|
|
2
|
-
// 查询:获取查询配置详情
|
|
3
|
-
getQueryParamsDetails: '/api/
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export { QueryParamsDetailsViewApi }
|
|
1
|
+
const QueryParamsDetailsViewApi = {
|
|
2
|
+
// 查询:获取查询配置详情
|
|
3
|
+
getQueryParamsDetails: '/api/system/logic/getQueryParamsDetails'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export { QueryParamsDetailsViewApi }
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
const TicketDetailsViewApi = {
|
|
2
|
-
// 查询:获取工单流转详情
|
|
3
|
-
getTicketWorkFlowDetails: '/api/
|
|
4
|
-
// 查询:获取工单详情
|
|
5
|
-
getTicketDetails: '/api/
|
|
6
|
-
// 手动关闭工单
|
|
7
|
-
manualCloseTicket: '/api/
|
|
8
|
-
// 转交工单给其他人
|
|
9
|
-
transferTicketToOthers: '/api/
|
|
10
|
-
// 确认工单,开始处理
|
|
11
|
-
confirmTicket: '/api/
|
|
12
|
-
// 查询:获取订单详情用于订单追踪
|
|
13
|
-
getTicketDetailsForUploader: '/api/
|
|
14
|
-
// 更新:将工单优先级增加
|
|
15
|
-
rushTicket: '/api/
|
|
16
|
-
// 客户手动关闭工单
|
|
17
|
-
manualCloseTicketByCustomer: '/api/
|
|
18
|
-
// 在工单提交页面删除照片
|
|
19
|
-
revocationImage: '/api/
|
|
20
|
-
// 在工单提交页面删除照片
|
|
21
|
-
getTicketImages: '/api/
|
|
22
|
-
// 用户填写附加信息时取消了操作,将已上传的照片清空
|
|
23
|
-
removeAllImages: '/api/
|
|
24
|
-
// 提交用户填写附加信息
|
|
25
|
-
AddonDescriptionToTicket: '/api/
|
|
26
|
-
// 获取用户填写附加信息
|
|
27
|
-
getAddonDescription: '/api/
|
|
28
|
-
// 发起售后工单流程
|
|
29
|
-
createTicket: '/api/
|
|
30
|
-
// 查询:获取所有员工名,供前端展示备选项
|
|
31
|
-
getAllEmployeeName: '/api/
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { TicketDetailsViewApi }
|
|
1
|
+
const TicketDetailsViewApi = {
|
|
2
|
+
// 查询:获取工单流转详情
|
|
3
|
+
getTicketWorkFlowDetails: '/api/system/logic/getTicketWorkFlowDetails',
|
|
4
|
+
// 查询:获取工单详情
|
|
5
|
+
getTicketDetails: '/api/system/logic/getTicketDetails',
|
|
6
|
+
// 手动关闭工单
|
|
7
|
+
manualCloseTicket: '/api/system/logic/manualCloseTicket',
|
|
8
|
+
// 转交工单给其他人
|
|
9
|
+
transferTicketToOthers: '/api/system/logic/transferTicketToOthers',
|
|
10
|
+
// 确认工单,开始处理
|
|
11
|
+
confirmTicket: '/api/system/logic/confirmTicket',
|
|
12
|
+
// 查询:获取订单详情用于订单追踪
|
|
13
|
+
getTicketDetailsForUploader: '/api/system/logic/getTicketDetailsForUploader',
|
|
14
|
+
// 更新:将工单优先级增加
|
|
15
|
+
rushTicket: '/api/system/logic/rushTicket',
|
|
16
|
+
// 客户手动关闭工单
|
|
17
|
+
manualCloseTicketByCustomer: '/api/system/logic/manualCloseTicketByCustomer',
|
|
18
|
+
// 在工单提交页面删除照片
|
|
19
|
+
revocationImage: '/api/system/logic/revocationImage',
|
|
20
|
+
// 在工单提交页面删除照片
|
|
21
|
+
getTicketImages: '/api/system/logic/getTicketImages',
|
|
22
|
+
// 用户填写附加信息时取消了操作,将已上传的照片清空
|
|
23
|
+
removeAllImages: '/api/system/logic/removeAllImages',
|
|
24
|
+
// 提交用户填写附加信息
|
|
25
|
+
AddonDescriptionToTicket: '/api/system/logic/AddonDescriptionToTicket',
|
|
26
|
+
// 获取用户填写附加信息
|
|
27
|
+
getAddonDescription: '/api/system/logic/getAddonDescription',
|
|
28
|
+
// 发起售后工单流程
|
|
29
|
+
createTicket: '/api/system/logic/createTicket',
|
|
30
|
+
// 查询:获取所有员工名,供前端展示备选项
|
|
31
|
+
getAllEmployeeName: '/api/system/logic/getAllEmployeeName'
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { TicketDetailsViewApi }
|
package/src/services/api/cas.js
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { post } from '@vue2-client/services/api/restTools'
|
|
2
|
-
import notification from 'ant-design-vue/lib/notification'
|
|
3
|
-
import { logout } from '@vue2-client/services/user'
|
|
4
|
-
import Cookie from 'js-cookie'
|
|
5
|
-
|
|
6
|
-
const casApi = {
|
|
7
|
-
// 根据用户信息校验服务访问权限并生成ST
|
|
8
|
-
createSTByUserInfo: '/api/af-sso/logic/createSTByUserInfo',
|
|
9
|
-
// 根据TGC生成ST
|
|
10
|
-
createSTByTGC: '/api/af-sso/logic/createSTByTGC',
|
|
11
|
-
// 验证ST
|
|
12
|
-
serviceValidate: '/api/af-sso/logic/serviceValidate',
|
|
13
|
-
// 其他验证
|
|
14
|
-
otherValidate: '/api/af-sso/logic'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function setTGTCookie (cookie) {
|
|
18
|
-
return Cookie.set('TGT-Cookie', cookie)
|
|
19
|
-
}
|
|
20
|
-
function removeTGTCookie () {
|
|
21
|
-
return Cookie.remove('TGT-Cookie')
|
|
22
|
-
}
|
|
23
|
-
export function getTGTCookie () {
|
|
24
|
-
return Cookie.get('TGT-Cookie')
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function CASLoginByAuth (serviceKey) {
|
|
28
|
-
return new Promise((resolve, reject) => {
|
|
29
|
-
post(casApi.createSTByUserInfo, {
|
|
30
|
-
serviceKey: serviceKey
|
|
31
|
-
}).then(res => {
|
|
32
|
-
setTGTCookie(res.tgc)
|
|
33
|
-
resolve(res)
|
|
34
|
-
}).catch(msg => {
|
|
35
|
-
reject(msg)
|
|
36
|
-
})
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function CASLogin (serviceKey, inner) {
|
|
41
|
-
// 从第三方跳转登录
|
|
42
|
-
const tgc = getTGTCookie()
|
|
43
|
-
if (tgc && !inner) {
|
|
44
|
-
return new Promise((resolve, reject) => {
|
|
45
|
-
post(casApi.createSTByTGC, {
|
|
46
|
-
serviceKey: serviceKey,
|
|
47
|
-
tgc: tgc
|
|
48
|
-
}).then(res => {
|
|
49
|
-
resolve(res)
|
|
50
|
-
}).catch(msg => {
|
|
51
|
-
if (msg === '当前操作没有权限') {
|
|
52
|
-
removeTGTCookie()
|
|
53
|
-
notification.error({
|
|
54
|
-
message: '授权已过期,请重新登录',
|
|
55
|
-
description: '2秒后自动跳转回登陆页面'
|
|
56
|
-
})
|
|
57
|
-
logout().then(() => {
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
window.location.href = '/login?serviceKey=' + serviceKey
|
|
60
|
-
}, 1500)
|
|
61
|
-
})
|
|
62
|
-
} else {
|
|
63
|
-
reject(msg)
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
} else {
|
|
68
|
-
return CASLoginByAuth(serviceKey)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function doOtherValidate (logicName, st, serviceKey) {
|
|
73
|
-
return post(casApi.otherValidate + '/' + logicName, {
|
|
74
|
-
st: st,
|
|
75
|
-
serviceKey: serviceKey
|
|
76
|
-
}, null)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export default casApi
|
|
1
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
2
|
+
import notification from 'ant-design-vue/lib/notification'
|
|
3
|
+
import { logout } from '@vue2-client/services/user'
|
|
4
|
+
import Cookie from 'js-cookie'
|
|
5
|
+
|
|
6
|
+
const casApi = {
|
|
7
|
+
// 根据用户信息校验服务访问权限并生成ST
|
|
8
|
+
createSTByUserInfo: '/api/af-sso/logic/createSTByUserInfo',
|
|
9
|
+
// 根据TGC生成ST
|
|
10
|
+
createSTByTGC: '/api/af-sso/logic/createSTByTGC',
|
|
11
|
+
// 验证ST
|
|
12
|
+
serviceValidate: '/api/af-sso/logic/serviceValidate',
|
|
13
|
+
// 其他验证
|
|
14
|
+
otherValidate: '/api/af-sso/logic'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function setTGTCookie (cookie) {
|
|
18
|
+
return Cookie.set('TGT-Cookie', cookie)
|
|
19
|
+
}
|
|
20
|
+
function removeTGTCookie () {
|
|
21
|
+
return Cookie.remove('TGT-Cookie')
|
|
22
|
+
}
|
|
23
|
+
export function getTGTCookie () {
|
|
24
|
+
return Cookie.get('TGT-Cookie')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function CASLoginByAuth (serviceKey) {
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
post(casApi.createSTByUserInfo, {
|
|
30
|
+
serviceKey: serviceKey
|
|
31
|
+
}).then(res => {
|
|
32
|
+
setTGTCookie(res.tgc)
|
|
33
|
+
resolve(res)
|
|
34
|
+
}).catch(msg => {
|
|
35
|
+
reject(msg)
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function CASLogin (serviceKey, inner) {
|
|
41
|
+
// 从第三方跳转登录
|
|
42
|
+
const tgc = getTGTCookie()
|
|
43
|
+
if (tgc && !inner) {
|
|
44
|
+
return new Promise((resolve, reject) => {
|
|
45
|
+
post(casApi.createSTByTGC, {
|
|
46
|
+
serviceKey: serviceKey,
|
|
47
|
+
tgc: tgc
|
|
48
|
+
}).then(res => {
|
|
49
|
+
resolve(res)
|
|
50
|
+
}).catch(msg => {
|
|
51
|
+
if (msg === '当前操作没有权限') {
|
|
52
|
+
removeTGTCookie()
|
|
53
|
+
notification.error({
|
|
54
|
+
message: '授权已过期,请重新登录',
|
|
55
|
+
description: '2秒后自动跳转回登陆页面'
|
|
56
|
+
})
|
|
57
|
+
logout().then(() => {
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
window.location.href = '/login?serviceKey=' + serviceKey
|
|
60
|
+
}, 1500)
|
|
61
|
+
})
|
|
62
|
+
} else {
|
|
63
|
+
reject(msg)
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
} else {
|
|
68
|
+
return CASLoginByAuth(serviceKey)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function doOtherValidate (logicName, st, serviceKey) {
|
|
73
|
+
return post(casApi.otherValidate + '/' + logicName, {
|
|
74
|
+
st: st,
|
|
75
|
+
serviceKey: serviceKey
|
|
76
|
+
}, null)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default casApi
|