system-clients 3.2.1-ycapply-1 → 3.2.2-aodeToV4

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 (179) hide show
  1. package/.eslintrc.js +16 -16
  2. package/.gradle/3.5/file-changes/last-build.bin +0 -0
  3. package/.gradle/3.5/taskHistory/taskHistory.lock +0 -0
  4. package/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/.gradle/7.1/executionHistory/executionHistory.bin +0 -0
  6. package/.gradle/7.1/executionHistory/executionHistory.lock +0 -0
  7. package/.gradle/7.1/fileHashes/fileHashes.bin +0 -0
  8. package/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
  9. package/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  10. package/.gradle/buildOutputCleanup/cache.properties +2 -0
  11. package/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  12. package/.gradle/checksums/checksums.lock +0 -0
  13. package/.gradle/vcs-1/gc.properties +0 -0
  14. package/SystemClient.iml +11 -8
  15. package/build/webpack.base.conf.js +78 -85
  16. package/build.gradle +6 -6
  17. package/gradlew.bat +89 -89
  18. package/index.html +21 -21
  19. package/package.json +4 -5
  20. package/src/App.vue +1 -1
  21. package/src/LodopFuncs.js +123 -123
  22. package/src/components/Main.vue +432 -699
  23. package/src/components/Util.js +343 -343
  24. package/src/components/equipment/EquipmentManage.vue +65 -65
  25. package/src/components/equipment/PcAdd.vue +105 -105
  26. package/src/components/equipment/PcList.vue +119 -119
  27. package/src/components/equipment/PcManage.vue +60 -60
  28. package/src/components/equipment/PhoneAdd.vue +94 -107
  29. package/src/components/equipment/PhoneList.vue +102 -112
  30. package/src/components/equipment/PhoneManage.vue +60 -60
  31. package/src/components/equipment/PosAdd.vue +156 -323
  32. package/src/components/equipment/PosList.vue +164 -294
  33. package/src/components/equipment/PosManage.vue +68 -138
  34. package/src/components/materialManage/materialData.vue +44 -44
  35. package/src/components/materialManage/materialList.vue +255 -255
  36. package/src/components/parammanage/ParamManage.vue +42 -42
  37. package/src/components/parammanage/ParamPage.vue +314 -336
  38. package/src/components/parammanage/ParamPages.vue +222 -222
  39. package/src/components/parammanage/SinglePage.vue +235 -235
  40. package/src/components/parammanage/SinglePages.vue +167 -167
  41. package/src/components/server/AddChangeMsg.vue +66 -66
  42. package/src/components/server/ChangeDeclare.vue +45 -45
  43. package/src/components/server/LeftTree.vue +111 -111
  44. package/src/components/server/LoadData.vue +36 -55
  45. package/src/components/server/Login.vue +726 -844
  46. package/src/components/server/Menu.vue +188 -188
  47. package/src/components/server/ModifyPw.vue +112 -111
  48. package/src/components/server/NewResSelectGroup.vue +211 -0
  49. package/src/components/server/ResSelect.vue +153 -155
  50. package/src/components/server/ResSelectGroup.vue +159 -198
  51. package/src/components/server/RightTree.vue +343 -348
  52. package/src/components/server/RoleSelector.vue +90 -89
  53. package/src/components/server/TestResSelect.vue +58 -58
  54. package/src/components/server/TestResSelectGroup.vue +388 -388
  55. package/src/plugins/EncryptUtil.js +53 -53
  56. package/src/plugins/GetLoginInfoService.js +499 -515
  57. package/src/plugins/HeatGetLoginInfoService.js +491 -491
  58. package/src/plugins/validation.js +7 -15
  59. package/src/project/State.js +1 -1
  60. package/src/stores/AppData.js +38 -38
  61. package/src/stores/HeatAppData.js +38 -38
  62. package/src/styles/fonts/glyphicons-halflings-regular.svg +287 -287
  63. package/src/styles/less/.csscomb.json +304 -304
  64. package/src/styles/less/.csslintrc +19 -19
  65. package/src/styles/less/alerts.less +73 -73
  66. package/src/styles/less/aofeng/animate.min.css +10 -10
  67. package/src/styles/less/aofeng/expandcss.less +569 -569
  68. package/src/styles/less/aofeng/standard.less +2121 -2507
  69. package/src/styles/less/aofeng/themeOne/BinaryTemplate.less +686 -686
  70. package/src/styles/less/aofeng/themeOne/loginStyle.less +1586 -1586
  71. package/src/styles/less/aofeng/themeOne/systemStyle.less +2650 -2650
  72. package/src/styles/less/aofeng/themeOne.less +17 -17
  73. package/src/styles/less/aofeng/themeTwo/newStyle1.less +415 -415
  74. package/src/styles/less/aofeng/themeTwo.less +3 -3
  75. package/src/styles/less/badges.less +66 -66
  76. package/src/styles/less/bootstrap.less +66 -66
  77. package/src/styles/less/breadcrumbs.less +26 -26
  78. package/src/styles/less/button-groups.less +247 -247
  79. package/src/styles/less/buttons.less +172 -172
  80. package/src/styles/less/carousel.less +269 -269
  81. package/src/styles/less/close.less +34 -34
  82. package/src/styles/less/code.less +69 -69
  83. package/src/styles/less/component-animations.less +33 -33
  84. package/src/styles/less/dropdowns.less +216 -216
  85. package/src/styles/less/fonts-list.less +25 -25
  86. package/src/styles/less/forms.less +626 -626
  87. package/src/styles/less/glyphicons.less +305 -305
  88. package/src/styles/less/grid.less +84 -84
  89. package/src/styles/less/input-groups.less +167 -167
  90. package/src/styles/less/jumbotron.less +52 -52
  91. package/src/styles/less/labels.less +64 -64
  92. package/src/styles/less/list-group.less +141 -141
  93. package/src/styles/less/manageStyle/manageChile.less +180 -180
  94. package/src/styles/less/manageStyle/manageStyle.less +1102 -1102
  95. package/src/styles/less/manageStyle/safeStyle.less +498 -498
  96. package/src/styles/less/media.less +66 -66
  97. package/src/styles/less/mixins/alerts.less +14 -14
  98. package/src/styles/less/mixins/background-variant.less +9 -9
  99. package/src/styles/less/mixins/border-radius.less +18 -18
  100. package/src/styles/less/mixins/buttons.less +69 -69
  101. package/src/styles/less/mixins/center-block.less +7 -7
  102. package/src/styles/less/mixins/clearfix.less +22 -22
  103. package/src/styles/less/mixins/forms.less +90 -90
  104. package/src/styles/less/mixins/gradients.less +59 -59
  105. package/src/styles/less/mixins/grid-framework.less +92 -92
  106. package/src/styles/less/mixins/grid.less +122 -122
  107. package/src/styles/less/mixins/hide-text.less +21 -21
  108. package/src/styles/less/mixins/image.less +33 -33
  109. package/src/styles/less/mixins/labels.less +12 -12
  110. package/src/styles/less/mixins/list-group.less +30 -30
  111. package/src/styles/less/mixins/nav-divider.less +10 -10
  112. package/src/styles/less/mixins/nav-vertical-align.less +9 -9
  113. package/src/styles/less/mixins/opacity.less +8 -8
  114. package/src/styles/less/mixins/pagination.less +24 -24
  115. package/src/styles/less/mixins/panels.less +24 -24
  116. package/src/styles/less/mixins/progress-bar.less +10 -10
  117. package/src/styles/less/mixins/reset-filter.less +8 -8
  118. package/src/styles/less/mixins/reset-text.less +18 -18
  119. package/src/styles/less/mixins/resize.less +6 -6
  120. package/src/styles/less/mixins/responsive-visibility.less +15 -15
  121. package/src/styles/less/mixins/size.less +10 -10
  122. package/src/styles/less/mixins/tab-focus.less +9 -9
  123. package/src/styles/less/mixins/table-row.less +44 -44
  124. package/src/styles/less/mixins/text-emphasis.less +9 -9
  125. package/src/styles/less/mixins/text-overflow.less +8 -8
  126. package/src/styles/less/mixins/vendor-prefixes.less +227 -227
  127. package/src/styles/less/mixins.less +40 -40
  128. package/src/styles/less/modals.less +151 -151
  129. package/src/styles/less/navbar.less +660 -660
  130. package/src/styles/less/navs.less +285 -285
  131. package/src/styles/less/normalize.less +424 -424
  132. package/src/styles/less/pager.less +76 -76
  133. package/src/styles/less/pagination.less +89 -89
  134. package/src/styles/less/panels.less +275 -275
  135. package/src/styles/less/popovers.less +131 -131
  136. package/src/styles/less/print.less +101 -101
  137. package/src/styles/less/progress-bars.less +87 -87
  138. package/src/styles/less/responsive-embed.less +35 -35
  139. package/src/styles/less/responsive-utilities.less +194 -194
  140. package/src/styles/less/scaffolding.less +161 -161
  141. package/src/styles/less/stand.less +207 -207
  142. package/src/styles/less/tables.less +262 -312
  143. package/src/styles/less/theme.less +291 -291
  144. package/src/styles/less/thumbnails.less +36 -36
  145. package/src/styles/less/tooltip.less +102 -102
  146. package/src/styles/less/type.less +303 -316
  147. package/src/styles/less/utilities.less +55 -55
  148. package/src/styles/less/variables.less +896 -899
  149. package/src/styles/less/wells.less +29 -29
  150. package/src/system.js +85 -109
  151. package/static/aodelogo.png +0 -0
  152. package/static/aodenewlogo.png +0 -0
  153. package/static/ewmlogo.png +0 -0
  154. package/src/components/TabButton.vue +0 -201
  155. package/src/components/Tabs.vue +0 -67
  156. package/src/components/addressManage/AddressCascadingMenu.vue +0 -145
  157. package/src/components/equipment/PosManageBoth.vue +0 -125
  158. package/src/components/equipment/PosParamAdd.vue +0 -236
  159. package/src/components/equipment/PosParamList.vue +0 -121
  160. package/src/components/equipment/PosParamManage.vue +0 -51
  161. package/src/components/server/ImageVieweTest.vue +0 -56
  162. package/src/components/server/ImageViewer.vue +0 -350
  163. package/src/components/server/PcdBuildingSelect.vue +0 -241
  164. package/src/filiale/konggang/Login.vue +0 -840
  165. package/src/filiale/konggang/system.js +0 -7
  166. package/src/filiale/qianneng/ModifyPw.vue +0 -107
  167. package/src/filiale/qianneng/system.js +0 -7
  168. package/src/filiale/rizhao/LeftTree.vue +0 -111
  169. package/src/filiale/rizhao/Login.vue +0 -791
  170. package/src/filiale/rizhao/Main.vue +0 -606
  171. package/src/filiale/rizhao/system.js +0 -14
  172. package/src/styles/less/manageStyle/manageStyle/manageChile.less +0 -180
  173. package/src/styles/less/manageStyle/manageStyle/manageStyle.less +0 -1102
  174. package/src/styles/less/manageStyle/manageStyle/safeStyle.less +0 -498
  175. package/static/images/lefticon//345/220/210/345/220/214/347/256/241/347/220/206.png +0 -0
  176. package/static/logo.png +0 -0
  177. package/static/newStyle/about-us.png +0 -0
  178. package/static/rizhao.png +0 -0
  179. package/yarn-error.log +0 -6896
@@ -1,515 +1,499 @@
1
- import Vue from 'vue'
2
- import {HttpResetClass} from 'vue-client'
3
- import cryptJS from './EncryptUtil'
4
- let loginGen = async function (name, password) {
5
- let data = {name: name, password: password}
6
- data = '$'+cryptJS.RSAEncrypt(JSON.stringify(data))
7
- let getLogin = await Vue.resetpost('/rs/logic/getLogin', data, {resolveMsg: null, rejectMsg: null})
8
- if (getLogin.data.states === '登录成功') {
9
- // 调用远程登录服务,获取所有有权访问的功能
10
- data = {username: name, password: password}
11
- data = cryptJS.RSAEncrypt(JSON.stringify(data))
12
- let resource = await Vue.resetpost(`/rs/user/userLogin/客服系统`, data, {
13
- resolveMsg: null,
14
- rejectMsg: null
15
- })
16
- console.log('登陆获取Util', JSON.stringify(resource.data))
17
- Vue.$login.f = resource.data
18
- //获取jwt
19
- Vue.$login.jwt = getLogin.data.jwt
20
- // 把登录用户添加到cookie里
21
- Vue.cookie.set('loginId', Vue.$login.f.id)
22
-
23
- try {
24
- //获取有权限的功能树
25
- let hasRight = await Vue.resetpost(`/rs/search`, {
26
- source: "tool.getFullTree(this.getRights().where(row.getType() == $function$))",
27
- userid: Vue.$login.f.id
28
- },
29
- {
30
- resolveMsg: null,
31
- rejectMsg: null
32
- })
33
- console.log('有权限功能返回数据', JSON.stringify(hasRight.data))
34
- //准备替换功能树
35
- var fun=[]
36
- hasRight.data[0].children[0].children.forEach((item) => {
37
- if(item.name=='客服系统'){
38
- item.children.forEach((item1) => {
39
- fun.push(item1)
40
- })
41
- }
42
- })
43
- // console.log('替换前', JSON.stringify(Vue.$login.f.functions))
44
- // console.log('替换后', JSON.stringify(fun))
45
- Vue.$login.f.functions=fun
46
- }catch (error) {
47
- }
48
- if (Vue.$login.f.id !== '11') {
49
- try {
50
- let getAllArea = await Vue.resetpost('/rs/search', {
51
- source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
52
- userid: Vue.$login.f.id
53
- }, {resolveMsg: null, rejectMsg: null})
54
-
55
- let areaTemp = []
56
- for (let i = 0; i < getAllArea.data.length; i++) {
57
- areaTemp.push({label: getAllArea.data[i].name, value: getAllArea.data[i]})
58
- }
59
- Vue.$login.f.f_allArea = areaTemp
60
- }catch (error) {
61
- Vue.$login.f.f_allArea =[]
62
- console.log('获取区县',error)
63
- }
64
- // 获取抄表员
65
- try {
66
- let getGasman = await Vue.resetpost('/rs/search', {
67
- source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
68
- userid: Vue.$login.f.id
69
- }, {resolveMsg: null, rejectMsg: null})
70
- let gasman = []
71
- for (let i = 0; i < getGasman.data.length; i++) {
72
- gasman.push(getGasman.data[i])
73
- }
74
- Vue.$login.f.f_gasman = gasman
75
- }catch (error) {
76
- Vue.$login.f.f_gasman = []
77
- console.log('抄表员模块',error)
78
- }
79
- // 获取安装人
80
- try {
81
- let getInstallman = await Vue.resetpost('/rs/search', {
82
- source: 'this.getParentByType($organization$).getChildByName($安装员$).getUsers()',
83
- userid: Vue.$login.f.id
84
- }, {resolveMsg: null, rejectMsg: null})
85
- console.log('获取安装员', getInstallman)
86
- let installman = []
87
- for (let i = 0; i < getInstallman.data.length; i++) {
88
- installman.push(getInstallman.data[i])
89
- }
90
- Vue.$login.f.f_installman = installman
91
- }catch (error) {
92
- Vue.$login.f.f_installman =[]
93
- console.log('安装人模块',error)
94
- }
95
- // 获取换表员
96
- // try {
97
- // let getChangeMeterman = await Vue.resetpost('/rs/search', {
98
- // source: 'this.getParentByType($organization$).getChildByName($换表员$).getUsers()',
99
- // userid: Vue.$login.f.id
100
- // }, {resolveMsg: null, rejectMsg: null})
101
- // let changemeterman = []
102
- // for (let i = 0; i < getChangeMeterman.data.length; i++) {
103
- // changemeterman.push(getChangeMeterman.data[i])
104
- // }
105
- // Vue.$login.f.f_changemeterman = changemeterman
106
- // }catch (error) {
107
- // Vue.$login.f.f_changemeterman = []
108
- // console.log('换表员模块',error)
109
- // }
110
- // 获取资源服务权限
111
- try {
112
- let getLic = await Vue.resetpost('/rs/search', {data: {
113
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
114
- userid: Vue.$login.f.id
115
- }}, {resolveMsg: null, rejectMsg: null})
116
- let arry=[]
117
- getLic.data.forEach((item) => {
118
- arry.push(item.name)
119
- })
120
- Vue.$login.f.lics=arry
121
- }catch (error) {
122
- Vue.$login.f.f_gasman = []
123
- console.log('资源服务权限',error)
124
- }
125
- // // 票据使用人
126
- // try {
127
- // let getPaperUseman = await Vue.resetpost('/rs/search', {
128
- // source: 'this.getParentByType($organization$).getChildByName($票据使用人$).getUsers()',
129
- // userid: Vue.$login.f.id
130
- // }, {resolveMsg: null, rejectMsg: null})
131
- // let perperuseman = []
132
- // for (let i = 0; i < getPaperUseman.data.length; i++) {
133
- // perperuseman.push(getPaperUseman.data[i])
134
- // }
135
- // Vue.$login.f.f_paperUseman = perperuseman
136
- // }catch (error) {
137
- // Vue.$login.f.f_paperUseman = []
138
- // console.log('票据使用人模块',error)
139
- //
140
- // }
141
- // // 票据分配人
142
- // try {
143
- // let getPaperAllotman = await Vue.resetpost('/rs/search', {
144
- // source: 'this.getParentByType($organization$).getChildByName($票据分配人$).getUsers()',
145
- // userid: Vue.$login.f.id
146
- // }, {resolveMsg: null, rejectMsg: null})
147
- // let paperallotman = []
148
- // for (let i = 0; i < getPaperAllotman.data.length; i++) {
149
- // paperallotman.push(getPaperAllotman.data[i])
150
- // }
151
- // Vue.$login.f.f_paperAllotman = paperallotman
152
- // }catch (error) {
153
- // Vue.$login.f.f_paperAllotman = []
154
- // console.log('票据分配人模块',error)
155
- // }
156
- // TODO 处理界面细节
157
- try {
158
- let viewDetails = await Vue.resetpost('rs/search', {
159
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
160
- userid: Vue.$login.f.id
161
- }, {resolveMsg: null, rejectMsg: null})
162
- let r = viewDetails.data
163
- Vue.$login.r = []
164
- r.forEach(x => Vue.$login.r.push(x.name))
165
- }catch (error) {
166
- Vue.$login.r = []
167
- console.log('加载模块失败',error)
168
- }
169
- // 调用登录后处理
170
- for(let proc of Vue.$login.afterLogin) {
171
- await proc(Vue.$login.f)
172
- }
173
- // 定时发送心跳
174
- setInterval(()=> {
175
- let http = new HttpResetClass()
176
- //暂时不出现不出现异地登录校验
177
- http.load('POST', `rs/user/access/${Vue.$login.f.id}`, {}, {resolveMsg: null, rejectMsg: null}).then((req) => {
178
- if(req.data.forcestate && req.data.forcestate == 1){
179
- Vue.showMessage("您被强制下线!", ['confirm']).then((res) => {
180
- location.reload()
181
- })
182
- }else if(req.data.status==710){
183
- Vue.showMessage(req.data.msg+",您将被强制退出系统", ['confirm']).then((res) => {
184
- if (res === 'confirm') {
185
- location.reload()
186
- }
187
- })
188
- }
189
- })
190
- }, 2 * 60 * 1000)
191
- }
192
-
193
- } else {
194
- let error = {status: 401, data: getLogin.data.states}
195
- // 抛出错误
196
- throw error
197
- }
198
- }
199
-
200
- let GetLoginInfoService = {
201
- // 登录后要处理的异步对象
202
- afterLogin: [],
203
- //验证码开关
204
- Verification: true,
205
- //登录信息展示开关
206
- depPrompt: true,
207
- install (Vue, options) {
208
- // 给vue增添对话框显示方法
209
- Vue.$login = Vue.prototype.$login = GetLoginInfoService
210
- },
211
-
212
- f: {
213
-
214
- },
215
-
216
- /**
217
- * 登录
218
- * @param name
219
- * @param password
220
- */
221
- login (name, password) {
222
- return loginGen(name, password)
223
- },
224
-
225
- convertToIn (val) {
226
- let temp = ''
227
- if (val instanceof Array) {
228
- if (val.length >= 1) {
229
- temp = '('
230
- val.forEach((res) => {
231
- temp += `'${res}',`
232
- })
233
- temp = temp.substr(0, temp.length - 1) + ')'
234
- }
235
- }
236
- return temp
237
- },
238
-
239
- toStandardYearMonth () {
240
- let dt = new Date()
241
- let month = dt.getMonth() + 1
242
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month)
243
- },
244
-
245
- toStandardYearMonth1 () {
246
- let dt = new Date()
247
- let month = dt.getMonth() + 1
248
- return dt.getFullYear() + (month < 10 ? '0' + month : month)
249
- },
250
-
251
- toStandardDateString () {
252
- let dt = new Date()
253
- let month = dt.getMonth() + 1
254
- let date = dt.getDate()
255
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
256
- },
257
-
258
- toStartAndEndDateString () {
259
- let dt = new Date()
260
- let month = dt.getMonth() + 1
261
- // let date = dt.getDate()
262
- return [dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-01',
263
- dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (new Date(dt.getFullYear(), month, 0).getDate())]
264
- // return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
265
- },
266
-
267
- toStandardTimeString () {
268
- let dt = new Date()
269
- let month = dt.getMonth() + 1
270
- let date = dt.getDate()
271
- let hour = dt.getHours()
272
- let min = dt.getMinutes()
273
- let sec = dt.getSeconds()
274
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
275
- ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
276
- },
277
-
278
- guid () {
279
- let buf = new Uint16Array(8)
280
- window.crypto.getRandomValues(buf)
281
- let S4 = function (num) {
282
- let ret = num.toString(16)
283
- while (ret.length < 4) {
284
- ret = '0' + ret
285
- }
286
- return ret
287
- }
288
- return (S4(buf[0]) + S4(buf[1]) + S4(buf[2]) + S4(buf[3]) + S4(buf[4]) + S4(buf[5]) + S4(buf[6]) + S4(buf[7]))
289
- },
290
-
291
- choices (role, param, hasBlank = false, blankHint = '请选择') {
292
- if (role == 'view') {
293
- Vue.getParams(param, [null])
294
- } else {
295
- let result = []
296
- if (hasBlank)
297
- result.push({label: blankHint, value: null})
298
- if (!Vue.param || !Vue.param[param])
299
- result.push({label: '请在系统设置里更新参数', value: '请在系统设置里更新参数'})
300
- else {
301
- let p = Vue.param[param]
302
- p.forEach(function (item) {
303
- result.push({label: item.name, value: item.name})
304
- })
305
- }
306
- return result
307
- }
308
- },
309
-
310
- required (param) {
311
- if (typeof param === 'number' && param == 0)
312
- return false
313
- if (!param)
314
- return true
315
- param = param + ''
316
- param = param.trim()
317
- if (!param)
318
- return true
319
- return false
320
- },
321
-
322
- isInt (n) {
323
- return !window.isNaN(n) && n % 1 === 0
324
- },
325
-
326
- isFloat (n) {
327
- return !window.isNaN(n)
328
- },
329
-
330
- // this will convert all true/false to boolean
331
- booleanFilter (paper) {
332
- for (let key in paper) {
333
- if (!paper.hasOwnProperty(key))
334
- continue
335
- if (typeof paper[key] == 'object' && paper[key] != null) {
336
- booleanFilter(paper[key])
337
- } else {
338
- if (paper[key] === 'true' || paper[key] == 'false')
339
- paper[key] = (paper[key] === 'true')
340
- }
341
- }
342
- },
343
- // recursively traverse through each path
344
- ratifyPics (paper) {
345
- for (let key in paper) {
346
- if (key.endsWith('_path')) {
347
- if (!paper[key]) {
348
- paper[key] = 'rs/db/file/nopic.png'
349
- } else {
350
- paper[key] = 'rs/db/file/' + paper[key]
351
- }
352
- } else if (paper[key] !== null && typeof (paper[key]) == 'object') {
353
- ratifyPics(paper[key])
354
- }
355
- }
356
- },
357
-
358
- // load script and other stuff
359
- loadscript (type, fileName) {
360
- return new Promise((resolve, reject) => {
361
- let element
362
- if (type == 'css') {
363
- element = document.createElement('link')
364
- element.setAttribute('rel', 'stylesheet')
365
- element.setAttribute('type', 'text/css')
366
- element.setAttribute('href', fileName)
367
- } else if (type == 'js') {
368
- element = document.createElement('script')
369
- element.setAttribute('type', 'text/javascript')
370
- element.setAttribute('src', fileName)
371
- }
372
- if (element) {
373
- element.setAttribute('async', '')
374
- element.setAttribute('defer', '')
375
- element.addEventListener('load', function () {
376
- resolve(element)
377
- }, false)
378
- element.addEventListener('error', function () {
379
- reject(element)
380
- }, false)
381
- document.body.appendChild(element)
382
- }
383
- })
384
- },
385
- // 不能选择器中截取掉多余的字符
386
- orgName (name) {
387
- return name.substring(10)
388
- },
389
-
390
- getNowDate (name) {
391
- // 求取当前时间的工具
392
- let myweekday = ''
393
- let year = ''
394
- let mydate = new Date()
395
- myweekday = mydate.getDay()
396
- let mymonth = mydate.getMonth() + 1
397
- let myday = mydate.getDate()
398
- let myyear = mydate.getYear()
399
- year = (myyear > 200) ? myyear : 1900 + myyear
400
- let week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期日', '星期六']
401
- // document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
402
- return year + '' + mymonth + '' + myday + '' + week[myweekday]
403
- },
404
-
405
- addDate (date, days) {
406
- // 求取当前时间的工具
407
- let endDate = new Date(date)
408
- endDate = endDate.valueOf()
409
- endDate = endDate + days * 24 * 60 * 60 * 1000
410
- endDate = new Date(endDate)
411
- let month = endDate.getMonth() + 1
412
- let day = endDate.getDate()
413
- let hour = endDate.getHours()
414
- let min = endDate.getMinutes()
415
- let sec = endDate.getSeconds()
416
- return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
417
- ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
418
- // return a
419
- },
420
-
421
- // 通过地址栏的参数获取参数内容
422
- getUrlParames (param) {
423
- var query = window.location.search
424
- var iLen = param.length
425
- var iStart = query.indexOf(param)
426
- if (iStart === -1) {
427
- return ''
428
- }
429
- iStart += iLen + 1
430
- var iEnd = query.indexOf('&', iStart)
431
- if (iEnd === -1) {
432
- return query.substring(iStart)
433
- }
434
- return query.substring(iStart, iEnd)
435
- },
436
-
437
- // 从地址栏获取加密的参数
438
- getUrlCompileParames (param) {
439
- let code = unescape(window.location.search.slice(1, window.location.search.length))
440
- let query = String.fromCharCode(code.charCodeAt(0) - code.length)
441
- for (var i = 1; i < code.length; i++) {
442
- query += String.fromCharCode(code.charCodeAt(i) - query.charCodeAt(i - 1))
443
- }
444
- let iLen = param.length
445
- let iStart = query.indexOf(param)
446
- if (iStart === -1) {
447
- return ''
448
- }
449
- iStart += iLen + 1
450
- let iEnd = query.indexOf('&', iStart)
451
- if (iEnd === -1) {
452
- return query.substring(iStart)
453
- }
454
- return query.substring(iStart, iEnd)
455
- },
456
-
457
- // 对字符串进行加密
458
- compileStr (code) {
459
- let c = String.fromCharCode(code.charCodeAt(0) + code.length)
460
- for (let i = 1; i < code.length; i++) {
461
- c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
462
- }
463
- return escape(c)
464
- },
465
- // 字符串进行解密
466
- uncompileStr (code) {
467
- code = unescape(code)
468
- let c = String.fromCharCode(code.charCodeAt(0) - code.length)
469
- for (var i = 1; i < code.length; i++) {
470
- c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
471
- }
472
- return c
473
- },
474
-
475
- dateDescripte (date) {
476
- let nowTime = new Date().getTime()
477
- let oldTime = new Date(date).getTime()
478
- let timeDiff = nowTime - oldTime
479
- // 规则说明
480
- // 小于等于2分钟为刚刚
481
- // 大于2分钟小于等于1小时为取整的分钟前(例如:35分钟前)
482
- // 大于1小时小于等于24小时为取整的小时前(例如:15小时前)
483
- // 大于24小时小于等于30天为取整的天前(例如:12天前)
484
- // 大于30天小于等于12月为取整的月前,月份统一为30天一月,不做额外处理(例如:3个月前)
485
- // 大于365取整的年前,(例如:2年前)
486
- let minute = 1000 * 60
487
- let hour = minute * 60
488
- let day = hour * 24
489
- let month = day * 30
490
- let year = month * 12
491
- let des = ''
492
- if (timeDiff <= minute * 2) {
493
- des = '刚刚'
494
- } else if (minute * 2 < timeDiff && timeDiff < hour) {
495
- des = `${Math.floor(timeDiff / minute)}分钟前`
496
- } else if (hour < timeDiff && timeDiff <= day) {
497
- des = `${Math.floor(timeDiff / hour)}小时前`
498
- } else if (day < timeDiff && timeDiff <= month) {
499
- des = `${Math.floor(timeDiff / day)}天前`
500
- } else if (month < timeDiff && timeDiff <= year) {
501
- des = `${Math.floor(timeDiff / month)}个月前`
502
- } else if (year < timeDiff) {
503
- des = `${Math.floor(timeDiff / year)}年前`
504
- }
505
- return des
506
- },
507
-
508
- nextMonth20 (date) {
509
- let ds = date.split('-')
510
- let nextMonth = ds[1] - 0 + 1
511
- return ds[0] + '-' + (nextMonth < 10 ? '0' + nextMonth : nextMonth) + '-20 00:00:00'
512
- }
513
- }
514
-
515
- export default GetLoginInfoService
1
+ import Vue from 'vue'
2
+ import {HttpResetClass} from 'vue-client'
3
+
4
+ let loginGen = async function (username, password, cue) {
5
+ let data = {username, password,resourceName:'客服系统'}
6
+ const getLogin = await Vue.resetpost('/api/af-auth/login', data,
7
+ {resolveMsg: null, rejectMsg: null,headerConfig:{'Content-type': "application/json"}
8
+ })
9
+ if (getLogin.data.code === 200) {
10
+ //获取jwt
11
+ if (getLogin.data.resources.data && getLogin.data.resources.data.id){
12
+ Vue.$login.jwt = getLogin.data.resources.data.id
13
+ Vue.$login.f = getLogin.data.resources.data
14
+ }else {
15
+ Vue.$login.jwt = getLogin.data.resources.id
16
+ Vue.$login.f = getLogin.data.resources
17
+ }
18
+ Vue.$login.jwtNew = getLogin.data.access_token
19
+ // 把登录用户添加到cookie里
20
+ Vue.cookie.set('loginId', Vue.$login.f.id)
21
+ try {
22
+ //获取有权限的功能树
23
+ let hasRight = await Vue.resetpost(`/rs/search`, {
24
+ source: "tool.getFullTree(this.getRights().where(row.getType() == $function$))",
25
+ userid: Vue.$login.f.id
26
+ }, { resolveMsg: null, rejectMsg: null })
27
+ //准备替换功能树
28
+ var fun=[]
29
+ hasRight.data[0].children[0].children.forEach((item) => {
30
+ if(item.name=='客服系统'){
31
+ item.children.forEach((item1) => {
32
+ fun.push(item1)
33
+ })
34
+ }
35
+ })
36
+ Vue.$login.f.functions=fun
37
+ }catch (error) {
38
+ }
39
+ if (Vue.$login.f.id !== '11') {
40
+ try {
41
+ let getAllArea = await Vue.resetpost('/rs/search', {
42
+ source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
43
+ userid: Vue.$login.f.id
44
+ }, {resolveMsg: null, rejectMsg: null})
45
+
46
+ let areaTemp = []
47
+ for (let i = 0; i < getAllArea.data.length; i++) {
48
+ areaTemp.push({label: getAllArea.data[i].name, value: getAllArea.data[i]})
49
+ }
50
+ Vue.$login.f.f_allArea = areaTemp
51
+ }catch (error) {
52
+ Vue.$login.f.f_allArea =[]
53
+ console.log('获取区县',error)
54
+ }
55
+ // 获取抄表员
56
+ try {
57
+ let getGasman = await Vue.resetpost('/rs/search', {
58
+ source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
59
+ userid: Vue.$login.f.id
60
+ }, {resolveMsg: null, rejectMsg: null})
61
+ let gasman = []
62
+ for (let i = 0; i < getGasman.data.length; i++) {
63
+ gasman.push(getGasman.data[i])
64
+ }
65
+ Vue.$login.f.f_gasman = gasman
66
+ }catch (error) {
67
+ Vue.$login.f.f_gasman = []
68
+ console.log('抄表员模块',error)
69
+ }
70
+ // // 获取安装人
71
+ // try {
72
+ // let getInstallman = await Vue.resetpost('/rs/search', {
73
+ // source: 'this.getParentByType($organization$).getChildByName($安装员$).getUsers()',
74
+ // userid: Vue.$login.f.id
75
+ // }, {resolveMsg: null, rejectMsg: null})
76
+ // console.log('获取安装员', getInstallman)
77
+ // let installman = []
78
+ // for (let i = 0; i < getInstallman.data.length; i++) {
79
+ // installman.push(getInstallman.data[i])
80
+ // }
81
+ // Vue.$login.f.f_installman = installman
82
+ // }catch (error) {
83
+ // Vue.$login.f.f_installman =[]
84
+ // console.log('安装人模块',error)
85
+ // }
86
+ // 获取换表员
87
+ // try {
88
+ // let getChangeMeterman = await Vue.resetpost('/rs/search', {
89
+ // source: 'this.getParentByType($organization$).getChildByName($换表员$).getUsers()',
90
+ // userid: Vue.$login.f.id
91
+ // }, {resolveMsg: null, rejectMsg: null})
92
+ // let changemeterman = []
93
+ // for (let i = 0; i < getChangeMeterman.data.length; i++) {
94
+ // changemeterman.push(getChangeMeterman.data[i])
95
+ // }
96
+ // Vue.$login.f.f_changemeterman = changemeterman
97
+ // }catch (error) {
98
+ // Vue.$login.f.f_changemeterman = []
99
+ // console.log('换表员模块',error)
100
+ // }
101
+ // 获取资源服务权限
102
+ try {
103
+ let getLic = await Vue.resetpost('/rs/search', {data: {
104
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
105
+ userid: Vue.$login.f.id
106
+ }}, {resolveMsg: null, rejectMsg: null})
107
+ let arry=[]
108
+ getLic.data.forEach((item) => {
109
+ arry.push(item.name)
110
+ })
111
+ Vue.$login.f.lics=arry
112
+ }catch (error) {
113
+ Vue.$login.f.f_gasman = []
114
+ console.log('资源服务权限',error)
115
+ }
116
+ // // 票据使用人
117
+ // try {
118
+ // let getPaperUseman = await Vue.resetpost('/rs/search', {
119
+ // source: 'this.getParentByType($organization$).getChildByName($票据使用人$).getUsers()',
120
+ // userid: Vue.$login.f.id
121
+ // }, {resolveMsg: null, rejectMsg: null})
122
+ // let perperuseman = []
123
+ // for (let i = 0; i < getPaperUseman.data.length; i++) {
124
+ // perperuseman.push(getPaperUseman.data[i])
125
+ // }
126
+ // Vue.$login.f.f_paperUseman = perperuseman
127
+ // }catch (error) {
128
+ // Vue.$login.f.f_paperUseman = []
129
+ // console.log('票据使用人模块',error)
130
+ //
131
+ // }
132
+ // // 票据分配人
133
+ // try {
134
+ // let getPaperAllotman = await Vue.resetpost('/rs/search', {
135
+ // source: 'this.getParentByType($organization$).getChildByName($票据分配人$).getUsers()',
136
+ // userid: Vue.$login.f.id
137
+ // }, {resolveMsg: null, rejectMsg: null})
138
+ // let paperallotman = []
139
+ // for (let i = 0; i < getPaperAllotman.data.length; i++) {
140
+ // paperallotman.push(getPaperAllotman.data[i])
141
+ // }
142
+ // Vue.$login.f.f_paperAllotman = paperallotman
143
+ // }catch (error) {
144
+ // Vue.$login.f.f_paperAllotman = []
145
+ // console.log('票据分配人模块',error)
146
+ // }
147
+ // TODO 处理界面细节
148
+ try {
149
+ let viewDetails = await Vue.resetpost('rs/search', {
150
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
151
+ userid: Vue.$login.f.id
152
+ }, {resolveMsg: null, rejectMsg: null})
153
+ let r = viewDetails.data
154
+ Vue.$login.r = []
155
+ r.forEach(x => Vue.$login.r.push(x.name))
156
+ }catch (error) {
157
+ Vue.$login.r = []
158
+ console.log('加载模块失败',error)
159
+ }
160
+ // 调用登录后处理
161
+ for(let proc of Vue.$login.afterLogin) {
162
+ await proc(Vue.$login.f)
163
+ }
164
+ // 定时发送心跳
165
+ setInterval(()=> {
166
+ let http = new HttpResetClass()
167
+ //暂时不出现不出现异地登录校验
168
+ http.load('POST', `rs/user/access/${Vue.$login.f.id}`, {}, {resolveMsg: null, rejectMsg: null}).then((req) => {
169
+ if(req.data.status==710){
170
+ // Vue.showMessage(req.data.msg+",您将被强制退出系统", ['confirm']).then((res) => {
171
+ // if (res === 'confirm') {
172
+ // location.reload()
173
+ // }
174
+ // })
175
+ }
176
+ })
177
+ }, 2 * 60 * 1000)
178
+ }
179
+
180
+ } else {
181
+ let error = {status: 401, data: getLogin.data.states}
182
+ // 抛出错误
183
+ throw error
184
+ }
185
+ }
186
+
187
+ let GetLoginInfoService = {
188
+ // 登录后要处理的异步对象
189
+ afterLogin: [],
190
+ //验证码开关
191
+ Verification: true,
192
+ install (Vue, options) {
193
+ // 给vue增添对话框显示方法
194
+ Vue.$login = Vue.prototype.$login = GetLoginInfoService
195
+ },
196
+
197
+ f: {
198
+
199
+ },
200
+
201
+ /**
202
+ * 登录
203
+ * @param name
204
+ * @param password
205
+ */
206
+ login (name, password) {
207
+ return loginGen(name, password)
208
+ },
209
+
210
+ convertToIn (val) {
211
+ let temp = ''
212
+ if (val instanceof Array) {
213
+ if (val.length >= 1) {
214
+ temp = '('
215
+ val.forEach((res) => {
216
+ temp += `'${res}',`
217
+ })
218
+ temp = temp.substr(0, temp.length - 1) + ')'
219
+ }
220
+ }
221
+ return temp
222
+ },
223
+
224
+ toStandardYearMonth () {
225
+ let dt = new Date()
226
+ let month = dt.getMonth() + 1
227
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month)
228
+ },
229
+
230
+ toStandardYearMonth1 () {
231
+ let dt = new Date()
232
+ let month = dt.getMonth() + 1
233
+ return dt.getFullYear() + (month < 10 ? '0' + month : month)
234
+ },
235
+
236
+ toStandardDateString () {
237
+ let dt = new Date()
238
+ let month = dt.getMonth() + 1
239
+ let date = dt.getDate()
240
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
241
+ },
242
+
243
+ toStartAndEndDateString () {
244
+ let dt = new Date()
245
+ let month = dt.getMonth() + 1
246
+ // let date = dt.getDate()
247
+ return [dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-01',
248
+ dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (new Date(dt.getFullYear(), month, 0).getDate())]
249
+ // return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
250
+ },
251
+
252
+ toStandardTimeString () {
253
+ let dt = new Date()
254
+ let month = dt.getMonth() + 1
255
+ let date = dt.getDate()
256
+ let hour = dt.getHours()
257
+ let min = dt.getMinutes()
258
+ let sec = dt.getSeconds()
259
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
260
+ ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
261
+ },
262
+
263
+ guid () {
264
+ let buf = new Uint16Array(8)
265
+ window.crypto.getRandomValues(buf)
266
+ let S4 = function (num) {
267
+ let ret = num.toString(16)
268
+ while (ret.length < 4) {
269
+ ret = '0' + ret
270
+ }
271
+ return ret
272
+ }
273
+ return (S4(buf[0]) + S4(buf[1]) + S4(buf[2]) + S4(buf[3]) + S4(buf[4]) + S4(buf[5]) + S4(buf[6]) + S4(buf[7]))
274
+ },
275
+
276
+ choices (role, param, hasBlank = false, blankHint = '请选择') {
277
+ if (role == 'view') {
278
+ Vue.getParams(param, [null])
279
+ } else {
280
+ let result = []
281
+ if (hasBlank)
282
+ result.push({label: blankHint, value: null})
283
+ if (!Vue.param || !Vue.param[param])
284
+ result.push({label: '请在系统设置里更新参数', value: '请在系统设置里更新参数'})
285
+ else {
286
+ let p = Vue.param[param]
287
+ p.forEach(function (item) {
288
+ result.push({label: item.name, value: item.name})
289
+ })
290
+ }
291
+ return result
292
+ }
293
+ },
294
+
295
+ required (param) {
296
+ if (typeof param === 'number' && param == 0)
297
+ return false
298
+ if (!param)
299
+ return true
300
+ param = param + ''
301
+ param = param.trim()
302
+ if (!param)
303
+ return true
304
+ return false
305
+ },
306
+
307
+ isInt (n) {
308
+ return !window.isNaN(n) && n % 1 === 0
309
+ },
310
+
311
+ isFloat (n) {
312
+ return !window.isNaN(n)
313
+ },
314
+
315
+ // this will convert all true/false to boolean
316
+ booleanFilter (paper) {
317
+ for (let key in paper) {
318
+ if (!paper.hasOwnProperty(key))
319
+ continue
320
+ if (typeof paper[key] == 'object' && paper[key] != null) {
321
+ booleanFilter(paper[key])
322
+ } else {
323
+ if (paper[key] === 'true' || paper[key] == 'false')
324
+ paper[key] = (paper[key] === 'true')
325
+ }
326
+ }
327
+ },
328
+ // recursively traverse through each path
329
+ ratifyPics (paper) {
330
+ for (let key in paper) {
331
+ if (key.endsWith('_path')) {
332
+ if (!paper[key]) {
333
+ paper[key] = 'rs/db/file/nopic.png'
334
+ } else {
335
+ paper[key] = 'rs/db/file/' + paper[key]
336
+ }
337
+ } else if (paper[key] !== null && typeof (paper[key]) == 'object') {
338
+ ratifyPics(paper[key])
339
+ }
340
+ }
341
+ },
342
+
343
+ // load script and other stuff
344
+ loadscript (type, fileName) {
345
+ return new Promise((resolve, reject) => {
346
+ let element
347
+ if (type == 'css') {
348
+ element = document.createElement('link')
349
+ element.setAttribute('rel', 'stylesheet')
350
+ element.setAttribute('type', 'text/css')
351
+ element.setAttribute('href', fileName)
352
+ } else if (type == 'js') {
353
+ element = document.createElement('script')
354
+ element.setAttribute('type', 'text/javascript')
355
+ element.setAttribute('src', fileName)
356
+ }
357
+ if (element) {
358
+ element.setAttribute('async', '')
359
+ element.setAttribute('defer', '')
360
+ element.addEventListener('load', function () {
361
+ resolve(element)
362
+ }, false)
363
+ element.addEventListener('error', function () {
364
+ reject(element)
365
+ }, false)
366
+ document.body.appendChild(element)
367
+ }
368
+ })
369
+ },
370
+ // 不能选择器中截取掉多余的字符
371
+ orgName (name) {
372
+ return name.substring(10)
373
+ },
374
+
375
+ getNowDate (name) {
376
+ // 求取当前时间的工具
377
+ let myweekday = ''
378
+ let year = ''
379
+ let mydate = new Date()
380
+ myweekday = mydate.getDay()
381
+ let mymonth = mydate.getMonth() + 1
382
+ let myday = mydate.getDate()
383
+ let myyear = mydate.getYear()
384
+ year = (myyear > 200) ? myyear : 1900 + myyear
385
+ let week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期日', '星期六']
386
+ // document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
387
+ return year + '年' + mymonth + '月' + myday + '日 ' + week[myweekday]
388
+ },
389
+
390
+ addDate (date, days) {
391
+ // 求取当前时间的工具
392
+ let endDate = new Date(date)
393
+ endDate = endDate.valueOf()
394
+ endDate = endDate + days * 24 * 60 * 60 * 1000
395
+ endDate = new Date(endDate)
396
+ let month = endDate.getMonth() + 1
397
+ let day = endDate.getDate()
398
+ let hour = endDate.getHours()
399
+ let min = endDate.getMinutes()
400
+ let sec = endDate.getSeconds()
401
+ return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
402
+ ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
403
+ // return a
404
+ },
405
+
406
+ // 通过地址栏的参数获取参数内容
407
+ getUrlParames (param) {
408
+ var query = window.location.search
409
+ var iLen = param.length
410
+ var iStart = query.indexOf(param)
411
+ if (iStart === -1) {
412
+ return ''
413
+ }
414
+ iStart += iLen + 1
415
+ var iEnd = query.indexOf('&', iStart)
416
+ if (iEnd === -1) {
417
+ return query.substring(iStart)
418
+ }
419
+ return query.substring(iStart, iEnd)
420
+ },
421
+
422
+ // 从地址栏获取加密的参数
423
+ getUrlCompileParames (param) {
424
+ let code = unescape(window.location.search.slice(1, window.location.search.length))
425
+ let query = String.fromCharCode(code.charCodeAt(0) - code.length)
426
+ for (var i = 1; i < code.length; i++) {
427
+ query += String.fromCharCode(code.charCodeAt(i) - query.charCodeAt(i - 1))
428
+ }
429
+ let iLen = param.length
430
+ let iStart = query.indexOf(param)
431
+ if (iStart === -1) {
432
+ return ''
433
+ }
434
+ iStart += iLen + 1
435
+ let iEnd = query.indexOf('&', iStart)
436
+ if (iEnd === -1) {
437
+ return query.substring(iStart)
438
+ }
439
+ return query.substring(iStart, iEnd)
440
+ },
441
+
442
+ // 对字符串进行加密
443
+ compileStr (code) {
444
+ let c = String.fromCharCode(code.charCodeAt(0) + code.length)
445
+ for (let i = 1; i < code.length; i++) {
446
+ c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
447
+ }
448
+ return escape(c)
449
+ },
450
+ // 字符串进行解密
451
+ uncompileStr (code) {
452
+ code = unescape(code)
453
+ let c = String.fromCharCode(code.charCodeAt(0) - code.length)
454
+ for (var i = 1; i < code.length; i++) {
455
+ c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
456
+ }
457
+ return c
458
+ },
459
+
460
+ dateDescripte (date) {
461
+ let nowTime = new Date().getTime()
462
+ let oldTime = new Date(date).getTime()
463
+ let timeDiff = nowTime - oldTime
464
+ // 规则说明
465
+ // 小于等于2分钟为刚刚
466
+ // 大于2分钟小于等于1小时为取整的分钟前(例如:35分钟前)
467
+ // 大于1小时小于等于24小时为取整的小时前(例如:15小时前)
468
+ // 大于24小时小于等于30天为取整的天前(例如:12天前)
469
+ // 大于30天小于等于12月为取整的月前,月份统一为30天一月,不做额外处理(例如:3个月前)
470
+ // 大于365取整的年前,(例如:2年前)
471
+ let minute = 1000 * 60
472
+ let hour = minute * 60
473
+ let day = hour * 24
474
+ let month = day * 30
475
+ let year = month * 12
476
+ let des = ''
477
+ if (timeDiff <= minute * 2) {
478
+ des = '刚刚'
479
+ } else if (minute * 2 < timeDiff && timeDiff < hour) {
480
+ des = `${Math.floor(timeDiff / minute)}分钟前`
481
+ } else if (hour < timeDiff && timeDiff <= day) {
482
+ des = `${Math.floor(timeDiff / hour)}小时前`
483
+ } else if (day < timeDiff && timeDiff <= month) {
484
+ des = `${Math.floor(timeDiff / day)}天前`
485
+ } else if (month < timeDiff && timeDiff <= year) {
486
+ des = `${Math.floor(timeDiff / month)}个月前`
487
+ } else if (year < timeDiff) {
488
+ des = `${Math.floor(timeDiff / year)}年前`
489
+ }
490
+ return des
491
+ },
492
+
493
+ nextMonth20 (date) {
494
+ let ds = date.split('-')
495
+ let nextMonth = ds[1] - 0 + 1
496
+ return ds[0] + '-' + (nextMonth < 10 ? '0' + nextMonth : nextMonth) + '-20 00:00:00'
497
+ }
498
+ }
499
+ export default GetLoginInfoService