system-clients 3.2.1 → 3.2.4-rongcheng

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 (113) hide show
  1. package/.gradle/4.4/fileChanges/last-build.bin +0 -0
  2. package/.gradle/4.4/fileHashes/fileHashes.bin +0 -0
  3. package/.gradle/4.4/fileHashes/fileHashes.lock +0 -0
  4. package/package.json +1 -1
  5. package/src/components/Main.vue +3 -3
  6. package/src/components/equipment/PhoneList.vue +1 -1
  7. package/src/components/equipment/PosList.vue +1 -1
  8. package/src/components/server/Login.vue +1 -0
  9. package/src/components/server/ResSelectGroup.vue +1 -1
  10. package/src/components/server/RightTree.vue +1 -1
  11. package/src/plugins/GetLoginInfoService.js +515 -515
  12. package/.gradle/5.2.1/gc.properties +0 -0
  13. package/.gradle/vcs-1/gc.properties +0 -0
  14. package/src/styles/fonts/PINGFANG LIGHT.TTF +0 -0
  15. package/src/styles/fonts/PingFangSC-Regular.ttf +0 -0
  16. package/src/styles/fonts/glyphicons-halflings-regular.eot +0 -0
  17. package/src/styles/fonts/glyphicons-halflings-regular.svg +0 -288
  18. package/src/styles/fonts/glyphicons-halflings-regular.ttf +0 -0
  19. package/src/styles/fonts/glyphicons-halflings-regular.woff +0 -0
  20. package/src/styles/fonts/glyphicons-halflings-regular.woff2 +0 -0
  21. package/src/styles/fonts/pingfang-bold.ttf +0 -0
  22. package/src/styles/fonts/pingfang-medium.ttf +0 -0
  23. package/src/styles/fonts/pingfang-regular.ttf +0 -0
  24. package/src/styles/fonts/trendstrends.ttf +0 -0
  25. package/src/styles/fonts//346/261/211/344/273/252/350/217/261/345/277/203/344/275/223/347/256/200.ttf +0 -0
  26. package/src/styles/less/.csscomb.json +0 -304
  27. package/src/styles/less/.csslintrc +0 -19
  28. package/src/styles/less/alerts.less +0 -73
  29. package/src/styles/less/aofeng/animate.min.css +0 -11
  30. package/src/styles/less/aofeng/expandcss.less +0 -569
  31. package/src/styles/less/aofeng/standard.less +0 -2121
  32. package/src/styles/less/aofeng/themeOne/BinaryTemplate.less +0 -686
  33. package/src/styles/less/aofeng/themeOne/loginStyle.less +0 -1586
  34. package/src/styles/less/aofeng/themeOne/systemStyle.less +0 -2650
  35. package/src/styles/less/aofeng/themeOne.less +0 -14
  36. package/src/styles/less/aofeng/themeTwo/newStyle1.less +0 -415
  37. package/src/styles/less/aofeng/themeTwo.less +0 -3
  38. package/src/styles/less/badges.less +0 -66
  39. package/src/styles/less/bootstrap.less +0 -66
  40. package/src/styles/less/breadcrumbs.less +0 -26
  41. package/src/styles/less/button-groups.less +0 -247
  42. package/src/styles/less/buttons.less +0 -172
  43. package/src/styles/less/carousel.less +0 -269
  44. package/src/styles/less/close.less +0 -34
  45. package/src/styles/less/code.less +0 -69
  46. package/src/styles/less/component-animations.less +0 -33
  47. package/src/styles/less/dropdowns.less +0 -216
  48. package/src/styles/less/fonts-list.less +0 -25
  49. package/src/styles/less/forms.less +0 -626
  50. package/src/styles/less/glyphicons.less +0 -305
  51. package/src/styles/less/grid.less +0 -84
  52. package/src/styles/less/input-groups.less +0 -167
  53. package/src/styles/less/jumbotron.less +0 -52
  54. package/src/styles/less/labels.less +0 -64
  55. package/src/styles/less/list-group.less +0 -141
  56. package/src/styles/less/manageStyle/manageChile.less +0 -180
  57. package/src/styles/less/manageStyle/manageStyle.less +0 -1102
  58. package/src/styles/less/manageStyle/safeStyle.less +0 -498
  59. package/src/styles/less/media.less +0 -66
  60. package/src/styles/less/mixins/alerts.less +0 -14
  61. package/src/styles/less/mixins/background-variant.less +0 -9
  62. package/src/styles/less/mixins/border-radius.less +0 -18
  63. package/src/styles/less/mixins/buttons.less +0 -69
  64. package/src/styles/less/mixins/center-block.less +0 -7
  65. package/src/styles/less/mixins/clearfix.less +0 -22
  66. package/src/styles/less/mixins/forms.less +0 -90
  67. package/src/styles/less/mixins/gradients.less +0 -59
  68. package/src/styles/less/mixins/grid-framework.less +0 -92
  69. package/src/styles/less/mixins/grid.less +0 -122
  70. package/src/styles/less/mixins/hide-text.less +0 -21
  71. package/src/styles/less/mixins/image.less +0 -33
  72. package/src/styles/less/mixins/labels.less +0 -12
  73. package/src/styles/less/mixins/list-group.less +0 -30
  74. package/src/styles/less/mixins/nav-divider.less +0 -10
  75. package/src/styles/less/mixins/nav-vertical-align.less +0 -9
  76. package/src/styles/less/mixins/opacity.less +0 -8
  77. package/src/styles/less/mixins/pagination.less +0 -24
  78. package/src/styles/less/mixins/panels.less +0 -24
  79. package/src/styles/less/mixins/progress-bar.less +0 -10
  80. package/src/styles/less/mixins/reset-filter.less +0 -8
  81. package/src/styles/less/mixins/reset-text.less +0 -18
  82. package/src/styles/less/mixins/resize.less +0 -6
  83. package/src/styles/less/mixins/responsive-visibility.less +0 -15
  84. package/src/styles/less/mixins/size.less +0 -10
  85. package/src/styles/less/mixins/tab-focus.less +0 -9
  86. package/src/styles/less/mixins/table-row.less +0 -44
  87. package/src/styles/less/mixins/text-emphasis.less +0 -9
  88. package/src/styles/less/mixins/text-overflow.less +0 -8
  89. package/src/styles/less/mixins/vendor-prefixes.less +0 -227
  90. package/src/styles/less/mixins.less +0 -40
  91. package/src/styles/less/modals.less +0 -151
  92. package/src/styles/less/navbar.less +0 -660
  93. package/src/styles/less/navs.less +0 -285
  94. package/src/styles/less/normalize.less +0 -424
  95. package/src/styles/less/pager.less +0 -76
  96. package/src/styles/less/pagination.less +0 -89
  97. package/src/styles/less/panels.less +0 -275
  98. package/src/styles/less/popovers.less +0 -131
  99. package/src/styles/less/print.less +0 -101
  100. package/src/styles/less/progress-bars.less +0 -87
  101. package/src/styles/less/responsive-embed.less +0 -35
  102. package/src/styles/less/responsive-utilities.less +0 -194
  103. package/src/styles/less/scaffolding.less +0 -161
  104. package/src/styles/less/stand.less +0 -207
  105. package/src/styles/less/tables.less +0 -262
  106. package/src/styles/less/theme.less +0 -291
  107. package/src/styles/less/thumbnails.less +0 -36
  108. package/src/styles/less/tooltip.less +0 -102
  109. package/src/styles/less/type.less +0 -303
  110. package/src/styles/less/utilities.less +0 -55
  111. package/src/styles/less/variables.less +0 -896
  112. package/src/styles/less/wells.less +0 -29
  113. package/static/logo.png +0 -0
@@ -1,515 +1,515 @@
1
- import Vue from 'vue'
2
- import JSEncrypt from 'jsencrypt'
3
- import {HttpResetClass} from 'vue-client'
4
-
5
- let loginGen = async function (name, password) {
6
- let data = {name: name, password: password}
7
- // rsa加密
8
- let encrypt = new JSEncrypt();
9
- encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB');
10
- console.log(data)
11
-
12
- let getLogin = await Vue.resetpost('/rs/logic/getLogin', data, {resolveMsg: null, rejectMsg: null}, 'RSA')
13
- if (getLogin.data.states === '登录成功') {
14
- // 调用远程登录服务,获取所有有权访问的功能
15
- data = {username: name, password: password}
16
- data = encrypt.encrypt(JSON.stringify(data))
17
- let resource = await Vue.resetpost(`/rs/user/userLogin/客服系统`, data, {
18
- resolveMsg: null,
19
- rejectMsg: null
20
- })
21
- console.log('登陆获取Util', JSON.stringify(resource.data))
22
- Vue.$login.f = resource.data
23
- //获取jwt
24
- Vue.$login.jwt = getLogin.data.jwt
25
- // 把登录用户添加到cookie里
26
- Vue.cookie.set('loginId', Vue.$login.f.id)
27
-
28
- try {
29
- //获取有权限的功能树
30
- let hasRight = await Vue.resetpost(`/rs/search`, {
31
- source: "tool.getFullTree(this.getRights().where(row.getType() == $function$))",
32
- userid: Vue.$login.f.id
33
- },
34
- {
35
- resolveMsg: null,
36
- rejectMsg: null
37
- })
38
- console.log('有权限功能返回数据', JSON.stringify(hasRight.data))
39
- //准备替换功能树
40
- var fun=[]
41
- hasRight.data[0].children[0].children.forEach((item) => {
42
- if(item.name=='客服系统'){
43
- item.children.forEach((item1) => {
44
- fun.push(item1)
45
- })
46
- }
47
- })
48
- // console.log('替换前', JSON.stringify(Vue.$login.f.functions))
49
- // console.log('替换后', JSON.stringify(fun))
50
- Vue.$login.f.functions=fun
51
- }catch (error) {
52
- }
53
- if (Vue.$login.f.id !== '11') {
54
- try {
55
- let getAllArea = await Vue.resetpost('/rs/search', {
56
- source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
57
- userid: Vue.$login.f.id
58
- }, {resolveMsg: null, rejectMsg: null})
59
-
60
- let areaTemp = []
61
- for (let i = 0; i < getAllArea.data.length; i++) {
62
- areaTemp.push({label: getAllArea.data[i].name, value: getAllArea.data[i]})
63
- }
64
- Vue.$login.f.f_allArea = areaTemp
65
- }catch (error) {
66
- Vue.$login.f.f_allArea =[]
67
- console.log('获取区县',error)
68
- }
69
- // 获取抄表员
70
- try {
71
- let getGasman = await Vue.resetpost('/rs/search', {
72
- source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
73
- userid: Vue.$login.f.id
74
- }, {resolveMsg: null, rejectMsg: null})
75
- let gasman = []
76
- for (let i = 0; i < getGasman.data.length; i++) {
77
- gasman.push(getGasman.data[i])
78
- }
79
- Vue.$login.f.f_gasman = gasman
80
- }catch (error) {
81
- Vue.$login.f.f_gasman = []
82
- console.log('抄表员模块',error)
83
- }
84
- // 获取安装人
85
- try {
86
- let getInstallman = await Vue.resetpost('/rs/search', {
87
- source: 'this.getParentByType($organization$).getChildByName($安装员$).getUsers()',
88
- userid: Vue.$login.f.id
89
- }, {resolveMsg: null, rejectMsg: null})
90
- console.log('获取安装员', getInstallman)
91
- let installman = []
92
- for (let i = 0; i < getInstallman.data.length; i++) {
93
- installman.push(getInstallman.data[i])
94
- }
95
- Vue.$login.f.f_installman = installman
96
- }catch (error) {
97
- Vue.$login.f.f_installman =[]
98
- console.log('安装人模块',error)
99
- }
100
- // 获取换表员
101
- try {
102
- let getChangeMeterman = await Vue.resetpost('/rs/search', {
103
- source: 'this.getParentByType($organization$).getChildByName($换表员$).getUsers()',
104
- userid: Vue.$login.f.id
105
- }, {resolveMsg: null, rejectMsg: null})
106
- let changemeterman = []
107
- for (let i = 0; i < getChangeMeterman.data.length; i++) {
108
- changemeterman.push(getChangeMeterman.data[i])
109
- }
110
- Vue.$login.f.f_changemeterman = changemeterman
111
- }catch (error) {
112
- Vue.$login.f.f_changemeterman = []
113
- console.log('换表员模块',error)
114
- }
115
- // 获取资源服务权限
116
- try {
117
- let getLic = await Vue.resetpost('/rs/search', {data: {
118
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
119
- userid: Vue.$login.f.id
120
- }}, {resolveMsg: null, rejectMsg: null})
121
- let arry=[]
122
- getLic.data.forEach((item) => {
123
- arry.push(item.name)
124
- })
125
- Vue.$login.f.lics=arry
126
- }catch (error) {
127
- Vue.$login.f.f_gasman = []
128
- console.log('资源服务权限',error)
129
- }
130
- // 票据使用人
131
- try {
132
- let getPaperUseman = await Vue.resetpost('/rs/search', {
133
- source: 'this.getParentByType($organization$).getChildByName($票据使用人$).getUsers()',
134
- userid: Vue.$login.f.id
135
- }, {resolveMsg: null, rejectMsg: null})
136
- let perperuseman = []
137
- for (let i = 0; i < getPaperUseman.data.length; i++) {
138
- perperuseman.push(getPaperUseman.data[i])
139
- }
140
- Vue.$login.f.f_paperUseman = perperuseman
141
- }catch (error) {
142
- Vue.$login.f.f_paperUseman = []
143
- console.log('票据使用人模块',error)
144
-
145
- }
146
- // 票据分配人
147
- try {
148
- let getPaperAllotman = await Vue.resetpost('/rs/search', {
149
- source: 'this.getParentByType($organization$).getChildByName($票据分配人$).getUsers()',
150
- userid: Vue.$login.f.id
151
- }, {resolveMsg: null, rejectMsg: null})
152
- let paperallotman = []
153
- for (let i = 0; i < getPaperAllotman.data.length; i++) {
154
- paperallotman.push(getPaperAllotman.data[i])
155
- }
156
- Vue.$login.f.f_paperAllotman = paperallotman
157
- }catch (error) {
158
- Vue.$login.f.f_paperAllotman = []
159
- console.log('票据分配人模块',error)
160
- }
161
- // TODO 处理界面细节
162
- try {
163
- let viewDetails = await Vue.resetpost('rs/search', {
164
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
165
- userid: Vue.$login.f.id
166
- }, {resolveMsg: null, rejectMsg: null})
167
- let r = viewDetails.data
168
- Vue.$login.r = []
169
- r.forEach(x => Vue.$login.r.push(x.name))
170
- }catch (error) {
171
- Vue.$login.r = []
172
- console.log('加载模块失败',error)
173
- }
174
- // 调用登录后处理
175
- for(let proc of Vue.$login.afterLogin) {
176
- await proc(Vue.$login.f)
177
- }
178
- // 定时发送心跳
179
- setInterval(()=> {
180
- let http = new HttpResetClass()
181
- http.load('POST', `rs/user/access/${Vue.$login.f.id}`, {}, {resolveMsg: null, rejectMsg: null}).then((req) => {
182
- if(req.data.status==710){
183
- Vue.prototype.$connectNumber = 0 //重连剩余次数
184
- Vue.prototype.$socket.close() // 关闭websocket连接
185
- Vue.showMessage(req.data.msg+",您将被强制退出系统", ['confirm']).then((res) => {
186
- if (res === 'confirm') {
187
- location.reload()
188
- }
189
- })
190
- }
191
- })
192
- }, 2 * 60 * 1000)
193
- }
194
-
195
- } else {
196
- let error = {status: 401, data: getLogin.data.states}
197
- // 抛出错误
198
- throw error
199
- }
200
- }
201
-
202
- let GetLoginInfoService = {
203
- // 登录后要处理的异步对象
204
- afterLogin: [],
205
- //验证码开关
206
- Verification: 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 JSEncrypt from 'jsencrypt'
3
+ import {HttpResetClass} from 'vue-client'
4
+
5
+ let loginGen = async function (name, password) {
6
+ let data = {name: name, password: password}
7
+ // rsa加密
8
+ let encrypt = new JSEncrypt();
9
+ encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB');
10
+ console.log(data)
11
+
12
+ let getLogin = await Vue.resetpost('/rs/logic/getLogin', data, {resolveMsg: null, rejectMsg: null}, 'RSA')
13
+ if (getLogin.data.states === '登录成功') {
14
+ // 调用远程登录服务,获取所有有权访问的功能
15
+ data = {username: name, password: password}
16
+ data = encrypt.encrypt(JSON.stringify(data))
17
+ let resource = await Vue.resetpost(`/rs/user/userLogin/客服系统`, data, {
18
+ resolveMsg: null,
19
+ rejectMsg: null
20
+ })
21
+ console.log('登陆获取Util', JSON.stringify(resource.data))
22
+ Vue.$login.f = resource.data
23
+ //获取jwt
24
+ Vue.$login.jwt = getLogin.data.jwt
25
+ // 把登录用户添加到cookie里
26
+ Vue.cookie.set('loginId', Vue.$login.f.id)
27
+
28
+ try {
29
+ //获取有权限的功能树
30
+ let hasRight = await Vue.resetpost(`/rs/search`, {
31
+ source: "tool.getFullTree(this.getRights().where(row.getType() == $function$))",
32
+ userid: Vue.$login.f.id
33
+ },
34
+ {
35
+ resolveMsg: null,
36
+ rejectMsg: null
37
+ })
38
+ console.log('有权限功能返回数据', JSON.stringify(hasRight.data))
39
+ //准备替换功能树
40
+ var fun=[]
41
+ hasRight.data[0].children[0].children.forEach((item) => {
42
+ if(item.name=='客服系统'){
43
+ item.children.forEach((item1) => {
44
+ fun.push(item1)
45
+ })
46
+ }
47
+ })
48
+ // console.log('替换前', JSON.stringify(Vue.$login.f.functions))
49
+ // console.log('替换后', JSON.stringify(fun))
50
+ Vue.$login.f.functions=fun
51
+ }catch (error) {
52
+ }
53
+ if (Vue.$login.f.id !== '11') {
54
+ try {
55
+ let getAllArea = await Vue.resetpost('/rs/search', {
56
+ source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
57
+ userid: Vue.$login.f.id
58
+ }, {resolveMsg: null, rejectMsg: null})
59
+
60
+ let areaTemp = []
61
+ for (let i = 0; i < getAllArea.data.length; i++) {
62
+ areaTemp.push({label: getAllArea.data[i].name, value: getAllArea.data[i]})
63
+ }
64
+ Vue.$login.f.f_allArea = areaTemp
65
+ }catch (error) {
66
+ Vue.$login.f.f_allArea =[]
67
+ console.log('获取区县',error)
68
+ }
69
+ // 获取抄表员
70
+ try {
71
+ let getGasman = await Vue.resetpost('/rs/search', {
72
+ source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
73
+ userid: Vue.$login.f.id
74
+ }, {resolveMsg: null, rejectMsg: null})
75
+ let gasman = []
76
+ for (let i = 0; i < getGasman.data.length; i++) {
77
+ gasman.push(getGasman.data[i])
78
+ }
79
+ Vue.$login.f.f_gasman = gasman
80
+ }catch (error) {
81
+ Vue.$login.f.f_gasman = []
82
+ console.log('抄表员模块',error)
83
+ }
84
+ // 获取安装人
85
+ try {
86
+ let getInstallman = await Vue.resetpost('/rs/search', {
87
+ source: 'this.getParentByType($organization$).getChildByName($安装员$).getUsers()',
88
+ userid: Vue.$login.f.id
89
+ }, {resolveMsg: null, rejectMsg: null})
90
+ console.log('获取安装员', getInstallman)
91
+ let installman = []
92
+ for (let i = 0; i < getInstallman.data.length; i++) {
93
+ installman.push(getInstallman.data[i])
94
+ }
95
+ Vue.$login.f.f_installman = installman
96
+ }catch (error) {
97
+ Vue.$login.f.f_installman =[]
98
+ console.log('安装人模块',error)
99
+ }
100
+ // 获取换表员
101
+ try {
102
+ let getChangeMeterman = await Vue.resetpost('/rs/search', {
103
+ source: 'this.getParentByType($organization$).getChildByName($换表员$).getUsers()',
104
+ userid: Vue.$login.f.id
105
+ }, {resolveMsg: null, rejectMsg: null})
106
+ let changemeterman = []
107
+ for (let i = 0; i < getChangeMeterman.data.length; i++) {
108
+ changemeterman.push(getChangeMeterman.data[i])
109
+ }
110
+ Vue.$login.f.f_changemeterman = changemeterman
111
+ }catch (error) {
112
+ Vue.$login.f.f_changemeterman = []
113
+ console.log('换表员模块',error)
114
+ }
115
+ // 获取资源服务权限
116
+ try {
117
+ let getLic = await Vue.resetpost('/rs/search', {data: {
118
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
119
+ userid: Vue.$login.f.id
120
+ }}, {resolveMsg: null, rejectMsg: null})
121
+ let arry=[]
122
+ getLic.data.forEach((item) => {
123
+ arry.push(item.name)
124
+ })
125
+ Vue.$login.f.lics=arry
126
+ }catch (error) {
127
+ Vue.$login.f.f_gasman = []
128
+ console.log('资源服务权限',error)
129
+ }
130
+ // 票据使用人
131
+ try {
132
+ let getPaperUseman = await Vue.resetpost('/rs/search', {
133
+ source: 'this.getParentByType($organization$).getChildByName($票据使用人$).getUsers()',
134
+ userid: Vue.$login.f.id
135
+ }, {resolveMsg: null, rejectMsg: null})
136
+ let perperuseman = []
137
+ for (let i = 0; i < getPaperUseman.data.length; i++) {
138
+ perperuseman.push(getPaperUseman.data[i])
139
+ }
140
+ Vue.$login.f.f_paperUseman = perperuseman
141
+ }catch (error) {
142
+ Vue.$login.f.f_paperUseman = []
143
+ console.log('票据使用人模块',error)
144
+
145
+ }
146
+ // 票据分配人
147
+ try {
148
+ let getPaperAllotman = await Vue.resetpost('/rs/search', {
149
+ source: 'this.getParentByType($organization$).getChildByName($票据分配人$).getUsers()',
150
+ userid: Vue.$login.f.id
151
+ }, {resolveMsg: null, rejectMsg: null})
152
+ let paperallotman = []
153
+ for (let i = 0; i < getPaperAllotman.data.length; i++) {
154
+ paperallotman.push(getPaperAllotman.data[i])
155
+ }
156
+ Vue.$login.f.f_paperAllotman = paperallotman
157
+ }catch (error) {
158
+ Vue.$login.f.f_paperAllotman = []
159
+ console.log('票据分配人模块',error)
160
+ }
161
+ // TODO 处理界面细节
162
+ try {
163
+ let viewDetails = await Vue.resetpost('rs/search', {
164
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
165
+ userid: Vue.$login.f.id
166
+ }, {resolveMsg: null, rejectMsg: null})
167
+ let r = viewDetails.data
168
+ Vue.$login.r = []
169
+ r.forEach(x => Vue.$login.r.push(x.name))
170
+ }catch (error) {
171
+ Vue.$login.r = []
172
+ console.log('加载模块失败',error)
173
+ }
174
+ // 调用登录后处理
175
+ for(let proc of Vue.$login.afterLogin) {
176
+ await proc(Vue.$login.f)
177
+ }
178
+ // 定时发送心跳
179
+ setInterval(()=> {
180
+ let http = new HttpResetClass()
181
+ http.load('POST', `rs/user/access/${Vue.$login.f.id}`, {}, {resolveMsg: null, rejectMsg: null}).then((req) => {
182
+ if(req.data.status==710){
183
+ Vue.prototype.$connectNumber = 0 //重连剩余次数
184
+ Vue.prototype.$socket.close() // 关闭websocket连接
185
+ Vue.showMessage(req.data.msg+",您将被强制退出系统", ['confirm']).then((res) => {
186
+ if (res === 'confirm') {
187
+ location.reload()
188
+ }
189
+ })
190
+ }
191
+ })
192
+ }, 2 * 60 * 1000)
193
+ }
194
+
195
+ } else {
196
+ let error = {status: 401, data: getLogin.data.states}
197
+ // 抛出错误
198
+ throw error
199
+ }
200
+ }
201
+
202
+ let GetLoginInfoService = {
203
+ // 登录后要处理的异步对象
204
+ afterLogin: [],
205
+ //验证码开关
206
+ Verification: 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