doway-coms 1.5.7 → 1.5.9

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.
Files changed (74) hide show
  1. package/.browserslistrc +2 -2
  2. package/README.md +28 -28
  3. package/dist/css/chunk-vendors.7f83d8f9.css +8 -0
  4. package/dist/css/index.7946d50b.css +1 -0
  5. package/dist/favicon.ico +0 -0
  6. package/dist/js/chunk-vendors.28fda91d.js +340 -0
  7. package/dist/js/index.49bc6add.js +2 -0
  8. package/lib/doway-coms.common.js +120397 -0
  9. package/lib/doway-coms.css +1 -0
  10. package/lib/doway-coms.umd.js +120407 -0
  11. package/lib/doway-coms.umd.min.js +328 -0
  12. package/package.json +52 -52
  13. package/packages/BaseButton/index.js +7 -7
  14. package/packages/BaseButton/src/index.vue +241 -241
  15. package/packages/BaseCheckbox/index.js +7 -7
  16. package/packages/BaseCheckbox/src/index.vue +134 -134
  17. package/packages/BaseDate/index.js +7 -7
  18. package/packages/BaseDate/src/index.vue +197 -197
  19. package/packages/BaseDateWeek/index.js +7 -7
  20. package/packages/BaseDateWeek/src/index.vue +163 -163
  21. package/packages/BaseDatetime/index.js +7 -7
  22. package/packages/BaseDatetime/src/index.vue +196 -196
  23. package/packages/BaseForm/index.js +7 -7
  24. package/packages/BaseForm/src/index.vue +664 -664
  25. package/packages/BaseGantt/index.js +9 -9
  26. package/packages/BaseGantt/src/index.vue +604 -604
  27. package/packages/BaseGrid/index.js +9 -9
  28. package/packages/BaseGrid/src/index.vue +2700 -2690
  29. package/packages/BaseGridAdjust/index.js +9 -9
  30. package/packages/BaseGridAdjust/src/index.vue +455 -455
  31. package/packages/BaseInput/index.js +7 -7
  32. package/packages/BaseInput/src/index.vue +164 -164
  33. package/packages/BaseIntervalInput/index.js +7 -7
  34. package/packages/BaseIntervalInput/src/index.vue +310 -310
  35. package/packages/BaseKanbanEmpty/index.js +7 -7
  36. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  37. package/packages/BaseNumberInput/index.js +7 -7
  38. package/packages/BaseNumberInput/src/index.vue +229 -229
  39. package/packages/BasePagination/index.js +7 -7
  40. package/packages/BasePagination/src/index.vue +91 -91
  41. package/packages/BasePictureCard/index.js +7 -7
  42. package/packages/BasePictureCard/src/index.vue +561 -561
  43. package/packages/BasePrintPreview/index.js +7 -7
  44. package/packages/BasePrintPreview/src/index.vue +117 -117
  45. package/packages/BasePulldown/index.js +7 -7
  46. package/packages/BasePulldown/src/index.vue +867 -867
  47. package/packages/BaseSearch/index.js +7 -7
  48. package/packages/BaseSearch/src/index.vue +935 -935
  49. package/packages/BaseSelect/index.js +7 -7
  50. package/packages/BaseSelect/src/index.vue +153 -153
  51. package/packages/BaseSelectMulti/index.js +7 -7
  52. package/packages/BaseSelectMulti/src/index.vue +148 -148
  53. package/packages/BaseTextArea/index.js +7 -7
  54. package/packages/BaseTextArea/src/index.vue +178 -178
  55. package/packages/BaseTime/index.js +7 -7
  56. package/packages/BaseTime/src/index.vue +166 -166
  57. package/packages/BaseTool/index.js +7 -7
  58. package/packages/BaseTool/src/index.vue +349 -349
  59. package/packages/BaseToolStatus/index.js +7 -7
  60. package/packages/BaseToolStatus/src/index.vue +383 -383
  61. package/packages/index.js +165 -165
  62. package/packages/styles/default.less +80 -80
  63. package/packages/utils/api.js +45 -45
  64. package/packages/utils/auth.js +38 -38
  65. package/packages/utils/common.js +583 -583
  66. package/packages/utils/dom.js +181 -181
  67. package/packages/utils/enum.js +83 -83
  68. package/packages/utils/filters.js +458 -458
  69. package/packages/utils/gridFormat.js +52 -52
  70. package/packages/utils/msg.js +16 -16
  71. package/packages/utils/patchFiles.js +44 -44
  72. package/packages/utils/request.js +169 -169
  73. package/packages/utils/store.js +254 -257
  74. package/vue.config.js +59 -59
package/packages/index.js CHANGED
@@ -1,166 +1,166 @@
1
- import Vue from 'vue'
2
- // 导入组件
3
- import BaseInput from './BaseInput/index';
4
- import BaseCheckbox from './BaseCheckbox/index';
5
- import BaseDate from './BaseDate/index';
6
- import BaseDatetime from './BaseDatetime/index';
7
- import BaseDateWeek from './BaseDateWeek/index';
8
- import BaseTextArea from './BaseTextArea/index';
9
- import BaseSelect from './BaseSelect/index';
10
- import BaseSelectMulti from './BaseSelectMulti/index';
11
- import BaseTime from './BaseTime/index';
12
- import BasePagination from './BasePagination/index';
13
- import BaseNumberInput from './BaseNumberInput/index';
14
- import BaseTool from './BaseTool/index';
15
- import BaseToolStatus from './BaseToolStatus/index';
16
- import BasePulldown from './BasePulldown/index';
17
- import BaseIntervalInput from './BaseIntervalInput/index';
18
- import BaseForm from './BaseForm/index';
19
- import BasePictureCard from './BasePictureCard/index';
20
- import BasePrintPreview from './BasePrintPreview/index';
21
- import BaseGantt from "./BaseGantt/index";
22
- import BaseKanbanEmpty from "./BaseKanbanEmpty/index";
23
- import BaseSearch from "./BaseSearch/index";
24
- import BaseButton from "./BaseButton/index";
25
-
26
- import store from './utils/store'
27
- import request from './utils/request'
28
- import BaseGrid from './BaseGrid/index';
29
-
30
- // 存储组件列表
31
- const components = [
32
- BaseInput, BaseCheckbox, BaseDate, BaseDatetime, BaseDateWeek,
33
- BaseTextArea, BaseSelect, BaseSelectMulti, BaseTime, BasePagination,
34
- BaseNumberInput, BaseTool, BaseToolStatus, BasePulldown, BaseIntervalInput,
35
- BaseForm, BasePictureCard, BaseGrid, BasePrintPreview, BaseGantt,
36
- BaseKanbanEmpty, BaseSearch, BaseButton
37
- ];
38
- // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
39
-
40
- import 'vxe-table/lib/style.css'
41
- import VXETable from 'vxe-table'
42
-
43
-
44
- const popupInterceptor = (params) => {
45
- // 比如点击了某个组件的弹出层面板之后,此时被激活单元格不应该被自动关闭,通过返回 false 可以阻止默认的行为。
46
- let parentElement = (params.$event.target.shadowRoot && params.$event.composed) ?
47
- (params.$event.composedPath()[0] || params.$event.target) : params.$event.target
48
- while (true) {
49
- // console.debug(parentElement)
50
- if (
51
- parentElement &&
52
- (parentElement.className.indexOf('vxe-modal--wrapper') > -1 ||
53
- parentElement.className.indexOf('ant-calendar') > -1 ||
54
- parentElement.className.indexOf('ant-select-dropdown-menu-item') > -1 ||
55
- parentElement.className.indexOf('interceptor-class') > -1 ||
56
- parentElement.className.indexOf('ant-time-picker-panel') > -1)
57
- ) {
58
- //定义网格弹出框不能对焦问题
59
- return false
60
- }
61
- if (parentElement.parentElement) {
62
- parentElement = parentElement.parentElement
63
- } else {
64
- break
65
- }
66
- }
67
-
68
- }
69
- //网格弹出点击拦截器
70
- VXETable.interceptor.add('event.clearActived', (params) => {
71
- return popupInterceptor(params)
72
- })
73
- //网格筛选点击拦截器
74
- VXETable.interceptor.add('event.clearFilter', (params) => {
75
- return popupInterceptor(params)
76
- })
77
-
78
- //表格自定义格式化
79
- import './utils/gridFormat'
80
- // 右键菜单插件
81
- import Contextmenu from "vue-contextmenujs"
82
-
83
- Vue.use(Contextmenu);
84
-
85
- const install = function (Vue) {
86
- //注册grid组件
87
- Vue.use(VXETable)
88
- // 遍历注册全局组件
89
- components.forEach((component) => {
90
- Vue.component(component.name, component);
91
- });
92
- };
93
-
94
- // 环境监测
95
- // 判断是否是直接引入文件
96
- if (typeof window !== 'undefined' && window.Vue) {
97
- install(window.Vue);
98
- }
99
-
100
- import XEUtils from 'xe-utils'
101
- //表单输入框验证
102
- import {
103
- extend,
104
- localize
105
- } from 'vee-validate'
106
- //引入校验规则 安装所有规则
107
- import * as rules from 'vee-validate/dist/rules'
108
- Object.keys(rules).forEach(rule => {
109
- extend(rule, rules[rule])
110
- })
111
-
112
- extend('gt', (value, min) => {
113
- if (XEUtils.toNumber(value) > min) {
114
- return true
115
- }
116
- return `必须大于${min}`
117
- })
118
-
119
- localize({
120
- en: {
121
- messages: {
122
- required: '必填',
123
- min: '不能小于 {length} 个字符',
124
- max: (_, { length }) => `不能大于 ${length} 个字符`,
125
- email: '邮箱输入不符合规则'
126
- }
127
- }
128
- })
129
-
130
- export default {
131
- // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
132
- install
133
- // 以下是具体的组件列表
134
- };
135
- export * from './utils/enum'
136
- export * from './utils/common'
137
- export * from './utils/filters'
138
- export * from './utils/msg'
139
-
140
- export {
141
- BaseInput,
142
- BaseCheckbox,
143
- BaseDate,
144
- BaseDatetime,
145
- BaseDateWeek,
146
- BaseTextArea,
147
- BaseSelect,
148
- BaseSelectMulti,
149
- BaseTime,
150
- BasePagination,
151
- BaseNumberInput,
152
- BaseTool,
153
- BaseToolStatus,
154
- BasePulldown,
155
- BaseIntervalInput,
156
- BaseForm,
157
- BaseGrid,
158
- BasePictureCard,
159
- BasePrintPreview,
160
- BaseGantt,
161
- BaseKanbanEmpty,
162
- BaseSearch,
163
- BaseButton,
164
- store,
165
- request,
1
+ import Vue from 'vue'
2
+ // 导入组件
3
+ import BaseInput from './BaseInput/index';
4
+ import BaseCheckbox from './BaseCheckbox/index';
5
+ import BaseDate from './BaseDate/index';
6
+ import BaseDatetime from './BaseDatetime/index';
7
+ import BaseDateWeek from './BaseDateWeek/index';
8
+ import BaseTextArea from './BaseTextArea/index';
9
+ import BaseSelect from './BaseSelect/index';
10
+ import BaseSelectMulti from './BaseSelectMulti/index';
11
+ import BaseTime from './BaseTime/index';
12
+ import BasePagination from './BasePagination/index';
13
+ import BaseNumberInput from './BaseNumberInput/index';
14
+ import BaseTool from './BaseTool/index';
15
+ import BaseToolStatus from './BaseToolStatus/index';
16
+ import BasePulldown from './BasePulldown/index';
17
+ import BaseIntervalInput from './BaseIntervalInput/index';
18
+ import BaseForm from './BaseForm/index';
19
+ import BasePictureCard from './BasePictureCard/index';
20
+ import BasePrintPreview from './BasePrintPreview/index';
21
+ import BaseGantt from "./BaseGantt/index";
22
+ import BaseKanbanEmpty from "./BaseKanbanEmpty/index";
23
+ import BaseSearch from "./BaseSearch/index";
24
+ import BaseButton from "./BaseButton/index";
25
+
26
+ import store from './utils/store'
27
+ import request from './utils/request'
28
+ import BaseGrid from './BaseGrid/index';
29
+
30
+ // 存储组件列表
31
+ const components = [
32
+ BaseInput, BaseCheckbox, BaseDate, BaseDatetime, BaseDateWeek,
33
+ BaseTextArea, BaseSelect, BaseSelectMulti, BaseTime, BasePagination,
34
+ BaseNumberInput, BaseTool, BaseToolStatus, BasePulldown, BaseIntervalInput,
35
+ BaseForm, BasePictureCard, BaseGrid, BasePrintPreview, BaseGantt,
36
+ BaseKanbanEmpty, BaseSearch, BaseButton
37
+ ];
38
+ // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
39
+
40
+ import 'vxe-table/lib/style.css'
41
+ import VXETable from 'vxe-table'
42
+
43
+
44
+ const popupInterceptor = (params) => {
45
+ // 比如点击了某个组件的弹出层面板之后,此时被激活单元格不应该被自动关闭,通过返回 false 可以阻止默认的行为。
46
+ let parentElement = (params.$event.target.shadowRoot && params.$event.composed) ?
47
+ (params.$event.composedPath()[0] || params.$event.target) : params.$event.target
48
+ while (true) {
49
+ // console.debug(parentElement)
50
+ if (
51
+ parentElement &&
52
+ (parentElement.className.indexOf('vxe-modal--wrapper') > -1 ||
53
+ parentElement.className.indexOf('ant-calendar') > -1 ||
54
+ parentElement.className.indexOf('ant-select-dropdown-menu-item') > -1 ||
55
+ parentElement.className.indexOf('interceptor-class') > -1 ||
56
+ parentElement.className.indexOf('ant-time-picker-panel') > -1)
57
+ ) {
58
+ //定义网格弹出框不能对焦问题
59
+ return false
60
+ }
61
+ if (parentElement.parentElement) {
62
+ parentElement = parentElement.parentElement
63
+ } else {
64
+ break
65
+ }
66
+ }
67
+
68
+ }
69
+ //网格弹出点击拦截器
70
+ VXETable.interceptor.add('event.clearActived', (params) => {
71
+ return popupInterceptor(params)
72
+ })
73
+ //网格筛选点击拦截器
74
+ VXETable.interceptor.add('event.clearFilter', (params) => {
75
+ return popupInterceptor(params)
76
+ })
77
+
78
+ //表格自定义格式化
79
+ import './utils/gridFormat'
80
+ // 右键菜单插件
81
+ import Contextmenu from "vue-contextmenujs"
82
+
83
+ Vue.use(Contextmenu);
84
+
85
+ const install = function (Vue) {
86
+ //注册grid组件
87
+ Vue.use(VXETable)
88
+ // 遍历注册全局组件
89
+ components.forEach((component) => {
90
+ Vue.component(component.name, component);
91
+ });
92
+ };
93
+
94
+ // 环境监测
95
+ // 判断是否是直接引入文件
96
+ if (typeof window !== 'undefined' && window.Vue) {
97
+ install(window.Vue);
98
+ }
99
+
100
+ import XEUtils from 'xe-utils'
101
+ //表单输入框验证
102
+ import {
103
+ extend,
104
+ localize
105
+ } from 'vee-validate'
106
+ //引入校验规则 安装所有规则
107
+ import * as rules from 'vee-validate/dist/rules'
108
+ Object.keys(rules).forEach(rule => {
109
+ extend(rule, rules[rule])
110
+ })
111
+
112
+ extend('gt', (value, min) => {
113
+ if (XEUtils.toNumber(value) > min) {
114
+ return true
115
+ }
116
+ return `必须大于${min}`
117
+ })
118
+
119
+ localize({
120
+ en: {
121
+ messages: {
122
+ required: '必填',
123
+ min: '不能小于 {length} 个字符',
124
+ max: (_, { length }) => `不能大于 ${length} 个字符`,
125
+ email: '邮箱输入不符合规则'
126
+ }
127
+ }
128
+ })
129
+
130
+ export default {
131
+ // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
132
+ install
133
+ // 以下是具体的组件列表
134
+ };
135
+ export * from './utils/enum'
136
+ export * from './utils/common'
137
+ export * from './utils/filters'
138
+ export * from './utils/msg'
139
+
140
+ export {
141
+ BaseInput,
142
+ BaseCheckbox,
143
+ BaseDate,
144
+ BaseDatetime,
145
+ BaseDateWeek,
146
+ BaseTextArea,
147
+ BaseSelect,
148
+ BaseSelectMulti,
149
+ BaseTime,
150
+ BasePagination,
151
+ BaseNumberInput,
152
+ BaseTool,
153
+ BaseToolStatus,
154
+ BasePulldown,
155
+ BaseIntervalInput,
156
+ BaseForm,
157
+ BaseGrid,
158
+ BasePictureCard,
159
+ BasePrintPreview,
160
+ BaseGantt,
161
+ BaseKanbanEmpty,
162
+ BaseSearch,
163
+ BaseButton,
164
+ store,
165
+ request,
166
166
  }
@@ -1,80 +1,80 @@
1
- .d-control-container {
2
- display: flex;
3
- }
4
- .d-control-label {
5
- font-size:12px;
6
- font-weight: bold;
7
- // width:100px;
8
- flex: 0 0 100px;
9
- }
10
- .d-control {
11
- flex:1;
12
- width: 100%;
13
- height: 30px;
14
- overflow: hidden;
15
- white-space: nowrap;
16
- text-overflow: ellipsis;
17
- }
18
- .d-control-label-required{
19
- color:red;
20
- }
21
- .d-error-input{
22
- border-color: #f22435 !important;
23
- input{
24
- border-color: #f22435 !important;
25
- }
26
- input:hover{
27
- border-color: #f22435!important;
28
- }
29
- div{
30
- border-color: #f22435!important;
31
- }
32
- }
33
- .d-error-msg{
34
- color:#f22435;
35
- font-size: 0.75em;
36
- position: fixed;
37
- }
38
-
39
- .d-form-items {
40
- // margin-top: 100px;
41
- // margin-left: 100px;
42
- // margin-right: 100px;
43
- display: flex;
44
- flex-flow: row wrap;
45
- justify-content: flex-start;
46
- padding: 8px 8px 8px 8px;
47
- overflow-y: auto;
48
- .d-form-item-ghost {
49
- visibility: hidden;
50
- height: 0;
51
- min-height: 0px !important;
52
- flex-grow: 1;
53
- flex-shrink: 1;
54
- flex-basis: auto;
55
- border: 1px solid #9ad4dc;
56
- min-width: 150px;
57
- width: 280px;
58
- margin-right: 8px;
59
- margin-left: 8px;
60
- border-radius: 6px;
61
- }
62
- .d-form-item {
63
- width: 280px;
64
- flex-grow: 1;
65
- flex-shrink: 1;
66
- flex-basis: auto;
67
- margin-top: 0px;
68
- margin-right: 8px;
69
- margin-bottom: 0px;
70
- margin-left: 8px;
71
- padding: 6px 8px 6px 8px;
72
- min-width: 150px;
73
- border-radius: 6px;
74
- .search-view-icon {
75
- float: left;
76
- width: 64px;
77
- height: 64px;
78
- }
79
- }
80
- }
1
+ .d-control-container {
2
+ display: flex;
3
+ }
4
+ .d-control-label {
5
+ font-size:12px;
6
+ font-weight: bold;
7
+ // width:100px;
8
+ flex: 0 0 100px;
9
+ }
10
+ .d-control {
11
+ flex:1;
12
+ width: 100%;
13
+ height: 30px;
14
+ overflow: hidden;
15
+ white-space: nowrap;
16
+ text-overflow: ellipsis;
17
+ }
18
+ .d-control-label-required{
19
+ color:red;
20
+ }
21
+ .d-error-input{
22
+ border-color: #f22435 !important;
23
+ input{
24
+ border-color: #f22435 !important;
25
+ }
26
+ input:hover{
27
+ border-color: #f22435!important;
28
+ }
29
+ div{
30
+ border-color: #f22435!important;
31
+ }
32
+ }
33
+ .d-error-msg{
34
+ color:#f22435;
35
+ font-size: 0.75em;
36
+ position: fixed;
37
+ }
38
+
39
+ .d-form-items {
40
+ // margin-top: 100px;
41
+ // margin-left: 100px;
42
+ // margin-right: 100px;
43
+ display: flex;
44
+ flex-flow: row wrap;
45
+ justify-content: flex-start;
46
+ padding: 8px 8px 8px 8px;
47
+ overflow-y: auto;
48
+ .d-form-item-ghost {
49
+ visibility: hidden;
50
+ height: 0;
51
+ min-height: 0px !important;
52
+ flex-grow: 1;
53
+ flex-shrink: 1;
54
+ flex-basis: auto;
55
+ border: 1px solid #9ad4dc;
56
+ min-width: 150px;
57
+ width: 280px;
58
+ margin-right: 8px;
59
+ margin-left: 8px;
60
+ border-radius: 6px;
61
+ }
62
+ .d-form-item {
63
+ width: 280px;
64
+ flex-grow: 1;
65
+ flex-shrink: 1;
66
+ flex-basis: auto;
67
+ margin-top: 0px;
68
+ margin-right: 8px;
69
+ margin-bottom: 0px;
70
+ margin-left: 8px;
71
+ padding: 6px 8px 6px 8px;
72
+ min-width: 150px;
73
+ border-radius: 6px;
74
+ .search-view-icon {
75
+ float: left;
76
+ width: 64px;
77
+ height: 64px;
78
+ }
79
+ }
80
+ }
@@ -1,46 +1,46 @@
1
- import request from './request'
2
- import store from './store'
3
- export function loadViewInfo(moduleCode) {
4
- return request({
5
- url: store.getters.umsUrl + '/v1/module/loadViewInfo',
6
- method: 'get',
7
- params: {
8
- moduleCode: moduleCode
9
- }
10
- })
11
- }
12
-
13
- export function saveUserModuleDataFieldApi(data) {
14
- return request({
15
- url: store.getters.umsUrl + '/v1/user/saveUserModuleDataField',
16
- method: 'post',
17
- data: data
18
- })
19
- }
20
-
21
- export function attachGetAttachUrlApi() {
22
- return store.getters.msgUrl + '/v1/Attach'
23
- }
24
-
25
- /**
26
- * 获取cust信息列表
27
- * @param postData 提交的数据,分页信息
28
- */
29
- export function attachSearchApi(postData) {
30
- return request({
31
- url: store.getters.msgUrl + '/v1/Attach/Search',
32
- method: 'post',
33
- data: postData
34
- })
35
- }
36
-
37
- /**
38
- * 验证
39
- */
40
- export function licenseAuthorizeApi(data) {
41
- return request({
42
- url: store.getters.identityUrl + '/oauth/licenseAuthorize',
43
- method: 'post',
44
- data: data
45
- })
1
+ import request from './request'
2
+ import store from './store'
3
+ export function loadViewInfo(moduleCode) {
4
+ return request({
5
+ url: store.getters.umsUrl + '/v1/module/loadViewInfo',
6
+ method: 'get',
7
+ params: {
8
+ moduleCode: moduleCode
9
+ }
10
+ })
11
+ }
12
+
13
+ export function saveUserModuleDataFieldApi(data) {
14
+ return request({
15
+ url: store.getters.umsUrl + '/v1/user/saveUserModuleDataField',
16
+ method: 'post',
17
+ data: data
18
+ })
19
+ }
20
+
21
+ export function attachGetAttachUrlApi() {
22
+ return store.getters.msgUrl + '/v1/Attach'
23
+ }
24
+
25
+ /**
26
+ * 获取cust信息列表
27
+ * @param postData 提交的数据,分页信息
28
+ */
29
+ export function attachSearchApi(postData) {
30
+ return request({
31
+ url: store.getters.msgUrl + '/v1/Attach/Search',
32
+ method: 'post',
33
+ data: postData
34
+ })
35
+ }
36
+
37
+ /**
38
+ * 验证
39
+ */
40
+ export function licenseAuthorizeApi(data) {
41
+ return request({
42
+ url: store.getters.identityUrl + '/oauth/licenseAuthorize',
43
+ method: 'post',
44
+ data: data
45
+ })
46
46
  }
@@ -1,38 +1,38 @@
1
- import Cookies from 'js-cookie'
2
-
3
- const TokenKey = 'token'
4
- const RefreshTokenKey = 'refreshToken'
5
- const ExpireAt = 'token_expire_at'
6
-
7
- export function getToken() {
8
- return Cookies.get(TokenKey)
9
- }
10
-
11
- export function setToken(token) {
12
- return Cookies.set(TokenKey, token)
13
- }
14
-
15
- export function removeCookie(cookieKey) {
16
- return Cookies.remove(cookieKey)
17
- }
18
-
19
- export function removeToken() {
20
- return Cookies.remove(TokenKey)
21
- }
22
- export function getRefreshToken() {
23
- return Cookies.get(RefreshTokenKey)
24
- }
25
-
26
- export function setRefreshToken(token) {
27
- return Cookies.set(RefreshTokenKey, token)
28
- }
29
- export function setTokenExpireTime(expireTime) {
30
- return Cookies.set(ExpireAt, expireTime)
31
- }
32
- export function getTokenExpireTime() {
33
- return Cookies.get(ExpireAt)
34
- }
35
-
36
- export function removeRefreshToken() {
37
- return Cookies.remove(RefreshTokenKey)
38
- }
1
+ import Cookies from 'js-cookie'
2
+
3
+ const TokenKey = 'token'
4
+ const RefreshTokenKey = 'refreshToken'
5
+ const ExpireAt = 'token_expire_at'
6
+
7
+ export function getToken() {
8
+ return Cookies.get(TokenKey)
9
+ }
10
+
11
+ export function setToken(token) {
12
+ return Cookies.set(TokenKey, token)
13
+ }
14
+
15
+ export function removeCookie(cookieKey) {
16
+ return Cookies.remove(cookieKey)
17
+ }
18
+
19
+ export function removeToken() {
20
+ return Cookies.remove(TokenKey)
21
+ }
22
+ export function getRefreshToken() {
23
+ return Cookies.get(RefreshTokenKey)
24
+ }
25
+
26
+ export function setRefreshToken(token) {
27
+ return Cookies.set(RefreshTokenKey, token)
28
+ }
29
+ export function setTokenExpireTime(expireTime) {
30
+ return Cookies.set(ExpireAt, expireTime)
31
+ }
32
+ export function getTokenExpireTime() {
33
+ return Cookies.get(ExpireAt)
34
+ }
35
+
36
+ export function removeRefreshToken() {
37
+ return Cookies.remove(RefreshTokenKey)
38
+ }