system-clients 3.2.54-test-1 → 3.2.55-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "system-clients",
|
3
|
-
"version": "3.2.
|
3
|
+
"version": "3.2.55-1",
|
4
4
|
"description": "系统基础框架",
|
5
5
|
"main": "src/index.js",
|
6
6
|
"directories": {
|
@@ -79,7 +79,7 @@
|
|
79
79
|
"style": "0.0.3",
|
80
80
|
"style-loader": "^0.20.3",
|
81
81
|
"url-loader": "^0.5.7",
|
82
|
-
"vue-client": "1.24.
|
82
|
+
"vue-client": "1.24.79",
|
83
83
|
"vue-hot-reload-api": "^1.2.0",
|
84
84
|
"vue-html-loader": "^1.0.0",
|
85
85
|
"vue-loader": "^8.2.1",
|
@@ -1,15 +1,19 @@
|
|
1
1
|
import Vue from 'vue'
|
2
2
|
import {HttpResetClass} from 'vue-client'
|
3
3
|
import cryptJS from './EncryptUtil'
|
4
|
+
|
4
5
|
let loginGen = async function (name, password, cue) {
|
5
6
|
let data = {name: name, password: password}
|
6
|
-
data = '$'+cryptJS.RSAEncrypt(JSON.stringify(data))
|
7
|
+
data = '$' + cryptJS.RSAEncrypt(JSON.stringify(data))
|
7
8
|
let getLogin = await Vue.resetpost('/rs/logic/getLogin', data, {resolveMsg: null, rejectMsg: null})
|
8
9
|
if (getLogin.data.states === '登录成功') {
|
10
|
+
//获取jwt
|
11
|
+
Vue.$login.jwt = getLogin.data.jwt
|
12
|
+
Vue.$login.jwtNew = getLogin.data.jwtNew
|
9
13
|
// 调用远程登录服务,获取所有有权访问的功能
|
10
14
|
data = {username: name, password: password}
|
11
15
|
data = cryptJS.RSAEncrypt(JSON.stringify(data))
|
12
|
-
|
16
|
+
const resource = await Vue.resetpost(`/rs/user/userLogin/客服系统`, data, {
|
13
17
|
resolveMsg: null,
|
14
18
|
rejectMsg: null
|
15
19
|
})
|
@@ -22,11 +26,11 @@ let loginGen = async function (name, password, cue) {
|
|
22
26
|
console.log('登陆获取Util', JSON.stringify(resourceResult))
|
23
27
|
|
24
28
|
Vue.$login.f = resourceResult.data.data
|
25
|
-
//获取jwt
|
26
|
-
Vue.$login.jwt = getLogin.data.jwt
|
27
29
|
// 把登录用户添加到cookie里
|
28
30
|
Vue.cookie.set('loginId', Vue.$login.f.id)
|
29
31
|
|
32
|
+
console.log("当前登录信息Vue.$login.f", Vue.$login.f)
|
33
|
+
|
30
34
|
try {
|
31
35
|
//获取有权限的功能树
|
32
36
|
let hasRight = await Vue.resetpost(`/rs/search`, {
|
@@ -39,18 +43,16 @@ let loginGen = async function (name, password, cue) {
|
|
39
43
|
})
|
40
44
|
console.log('有权限功能返回数据', JSON.stringify(hasRight.data))
|
41
45
|
//准备替换功能树
|
42
|
-
var fun=[]
|
46
|
+
var fun = []
|
43
47
|
hasRight.data[0].children[0].children.forEach((item) => {
|
44
|
-
if(item.name
|
48
|
+
if (item.name === '客服系统') {
|
45
49
|
item.children.forEach((item1) => {
|
46
50
|
fun.push(item1)
|
47
51
|
})
|
48
52
|
}
|
49
53
|
})
|
50
|
-
|
51
|
-
|
52
|
-
Vue.$login.f.functions=fun
|
53
|
-
}catch (error) {
|
54
|
+
Vue.$login.f.functions = fun
|
55
|
+
} catch (error) {
|
54
56
|
}
|
55
57
|
if (Vue.$login.f.id !== '11') {
|
56
58
|
try {
|
@@ -64,9 +66,9 @@ let loginGen = async function (name, password, cue) {
|
|
64
66
|
areaTemp.push({label: getAllArea.data[i].name, value: getAllArea.data[i]})
|
65
67
|
}
|
66
68
|
Vue.$login.f.f_allArea = areaTemp
|
67
|
-
}catch (error) {
|
68
|
-
Vue.$login.f.f_allArea =[]
|
69
|
-
console.log('获取区县',error)
|
69
|
+
} catch (error) {
|
70
|
+
Vue.$login.f.f_allArea = []
|
71
|
+
console.log('获取区县', error)
|
70
72
|
}
|
71
73
|
// 获取抄表员
|
72
74
|
try {
|
@@ -79,9 +81,9 @@ let loginGen = async function (name, password, cue) {
|
|
79
81
|
gasman.push(getGasman.data[i])
|
80
82
|
}
|
81
83
|
Vue.$login.f.f_gasman = gasman
|
82
|
-
}catch (error) {
|
84
|
+
} catch (error) {
|
83
85
|
Vue.$login.f.f_gasman = []
|
84
|
-
console.log('抄表员模块',error)
|
86
|
+
console.log('抄表员模块', error)
|
85
87
|
}
|
86
88
|
// 获取安装人
|
87
89
|
try {
|
@@ -95,9 +97,9 @@ let loginGen = async function (name, password, cue) {
|
|
95
97
|
installman.push(getInstallman.data[i])
|
96
98
|
}
|
97
99
|
Vue.$login.f.f_installman = installman
|
98
|
-
}catch (error) {
|
99
|
-
Vue.$login.f.f_installman =[]
|
100
|
-
console.log('安装人模块',error)
|
100
|
+
} catch (error) {
|
101
|
+
Vue.$login.f.f_installman = []
|
102
|
+
console.log('安装人模块', error)
|
101
103
|
}
|
102
104
|
// 获取换表员
|
103
105
|
// try {
|
@@ -114,20 +116,22 @@ let loginGen = async function (name, password, cue) {
|
|
114
116
|
// Vue.$login.f.f_changemeterman = []
|
115
117
|
// console.log('换表员模块',error)
|
116
118
|
// }
|
117
|
-
|
119
|
+
// 获取资源服务权限
|
118
120
|
try {
|
119
|
-
let getLic = await Vue.resetpost('/rs/search', {
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
121
|
+
let getLic = await Vue.resetpost('/rs/search', {
|
122
|
+
data: {
|
123
|
+
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
|
124
|
+
userid: Vue.$login.f.id
|
125
|
+
}
|
126
|
+
}, {resolveMsg: null, rejectMsg: null})
|
127
|
+
let arry = []
|
128
|
+
getLic.data.forEach((item) => {
|
129
|
+
arry.push(item.name)
|
130
|
+
})
|
131
|
+
Vue.$login.f.lics = arry
|
132
|
+
} catch (error) {
|
129
133
|
Vue.$login.f.f_gasman = []
|
130
|
-
console.log('资源服务权限',error)
|
134
|
+
console.log('资源服务权限', error)
|
131
135
|
}
|
132
136
|
// // 票据使用人
|
133
137
|
// try {
|
@@ -169,26 +173,29 @@ let loginGen = async function (name, password, cue) {
|
|
169
173
|
let r = viewDetails.data
|
170
174
|
Vue.$login.r = []
|
171
175
|
r.forEach(x => Vue.$login.r.push(x.name))
|
172
|
-
}catch (error) {
|
176
|
+
} catch (error) {
|
173
177
|
Vue.$login.r = []
|
174
|
-
console.log('加载模块失败',error)
|
178
|
+
console.log('加载模块失败', error)
|
175
179
|
}
|
176
180
|
// 调用登录后处理
|
177
|
-
for(let proc of Vue.$login.afterLogin) {
|
181
|
+
for (let proc of Vue.$login.afterLogin) {
|
178
182
|
await proc(Vue.$login.f)
|
179
183
|
}
|
180
184
|
// 定时发送心跳
|
181
|
-
if (cue){
|
182
|
-
setInterval(()=> {
|
185
|
+
if (cue) {
|
186
|
+
setInterval(() => {
|
183
187
|
let http = new HttpResetClass()
|
184
188
|
//暂时不出现不出现异地登录校验
|
185
|
-
http.load('POST', `rs/user/access/${Vue.$login.f.id}`, {}, {
|
186
|
-
|
189
|
+
http.load('POST', `rs/user/access/${Vue.$login.f.id}`, {}, {
|
190
|
+
resolveMsg: null,
|
191
|
+
rejectMsg: null
|
192
|
+
}).then((req) => {
|
193
|
+
if (req.data.forcestate && req.data.forcestate == 1) {
|
187
194
|
Vue.showMessage("您被强制下线!", ['confirm']).then((res) => {
|
188
195
|
location.reload()
|
189
196
|
})
|
190
|
-
}else if(req.data.status==710){
|
191
|
-
Vue.showMessage(req.data.msg+",您将被强制退出系统", ['confirm']).then((res) => {
|
197
|
+
} else if (req.data.status == 710) {
|
198
|
+
Vue.showMessage(req.data.msg + ",您将被强制退出系统", ['confirm']).then((res) => {
|
192
199
|
if (res === 'confirm') {
|
193
200
|
location.reload()
|
194
201
|
}
|
@@ -213,14 +220,12 @@ let GetLoginInfoService = {
|
|
213
220
|
Verification: true,
|
214
221
|
//登录信息展示开关
|
215
222
|
depPrompt: true,
|
216
|
-
install
|
223
|
+
install(Vue, options) {
|
217
224
|
// 给vue增添对话框显示方法
|
218
225
|
Vue.$login = Vue.prototype.$login = GetLoginInfoService
|
219
226
|
},
|
220
227
|
|
221
|
-
f: {
|
222
|
-
|
223
|
-
},
|
228
|
+
f: {},
|
224
229
|
|
225
230
|
/**
|
226
231
|
* 登录
|
@@ -228,14 +233,14 @@ let GetLoginInfoService = {
|
|
228
233
|
* @param password
|
229
234
|
* @param cue true/false 是/否显示异地登录
|
230
235
|
*/
|
231
|
-
login
|
232
|
-
if (cue === undefined || cue === null || cue === ''){
|
236
|
+
login(name, password, cue) {
|
237
|
+
if (cue === undefined || cue === null || cue === '') {
|
233
238
|
cue = true
|
234
239
|
}
|
235
240
|
return loginGen(name, password, cue)
|
236
241
|
},
|
237
242
|
|
238
|
-
convertToIn
|
243
|
+
convertToIn(val) {
|
239
244
|
let temp = ''
|
240
245
|
if (val instanceof Array) {
|
241
246
|
if (val.length >= 1) {
|
@@ -249,26 +254,26 @@ let GetLoginInfoService = {
|
|
249
254
|
return temp
|
250
255
|
},
|
251
256
|
|
252
|
-
toStandardYearMonth
|
257
|
+
toStandardYearMonth() {
|
253
258
|
let dt = new Date()
|
254
259
|
let month = dt.getMonth() + 1
|
255
260
|
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month)
|
256
261
|
},
|
257
262
|
|
258
|
-
toStandardYearMonth1
|
263
|
+
toStandardYearMonth1() {
|
259
264
|
let dt = new Date()
|
260
265
|
let month = dt.getMonth() + 1
|
261
266
|
return dt.getFullYear() + (month < 10 ? '0' + month : month)
|
262
267
|
},
|
263
268
|
|
264
|
-
toStandardDateString
|
269
|
+
toStandardDateString() {
|
265
270
|
let dt = new Date()
|
266
271
|
let month = dt.getMonth() + 1
|
267
272
|
let date = dt.getDate()
|
268
273
|
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
269
274
|
},
|
270
275
|
|
271
|
-
toStartAndEndDateString
|
276
|
+
toStartAndEndDateString() {
|
272
277
|
let dt = new Date()
|
273
278
|
let month = dt.getMonth() + 1
|
274
279
|
// let date = dt.getDate()
|
@@ -277,7 +282,7 @@ let GetLoginInfoService = {
|
|
277
282
|
// return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
278
283
|
},
|
279
284
|
|
280
|
-
toStandardTimeString
|
285
|
+
toStandardTimeString() {
|
281
286
|
let dt = new Date()
|
282
287
|
let month = dt.getMonth() + 1
|
283
288
|
let date = dt.getDate()
|
@@ -288,7 +293,7 @@ let GetLoginInfoService = {
|
|
288
293
|
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
289
294
|
},
|
290
295
|
|
291
|
-
guid
|
296
|
+
guid() {
|
292
297
|
let buf = new Uint16Array(8)
|
293
298
|
window.crypto.getRandomValues(buf)
|
294
299
|
let S4 = function (num) {
|
@@ -301,7 +306,7 @@ let GetLoginInfoService = {
|
|
301
306
|
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]))
|
302
307
|
},
|
303
308
|
|
304
|
-
choices
|
309
|
+
choices(role, param, hasBlank = false, blankHint = '请选择') {
|
305
310
|
if (role == 'view') {
|
306
311
|
Vue.getParams(param, [null])
|
307
312
|
} else {
|
@@ -320,7 +325,7 @@ let GetLoginInfoService = {
|
|
320
325
|
}
|
321
326
|
},
|
322
327
|
|
323
|
-
required
|
328
|
+
required(param) {
|
324
329
|
if (typeof param === 'number' && param == 0)
|
325
330
|
return false
|
326
331
|
if (!param)
|
@@ -332,16 +337,16 @@ let GetLoginInfoService = {
|
|
332
337
|
return false
|
333
338
|
},
|
334
339
|
|
335
|
-
isInt
|
340
|
+
isInt(n) {
|
336
341
|
return !window.isNaN(n) && n % 1 === 0
|
337
342
|
},
|
338
343
|
|
339
|
-
isFloat
|
344
|
+
isFloat(n) {
|
340
345
|
return !window.isNaN(n)
|
341
346
|
},
|
342
347
|
|
343
348
|
// this will convert all true/false to boolean
|
344
|
-
booleanFilter
|
349
|
+
booleanFilter(paper) {
|
345
350
|
for (let key in paper) {
|
346
351
|
if (!paper.hasOwnProperty(key))
|
347
352
|
continue
|
@@ -354,7 +359,7 @@ let GetLoginInfoService = {
|
|
354
359
|
}
|
355
360
|
},
|
356
361
|
// recursively traverse through each path
|
357
|
-
ratifyPics
|
362
|
+
ratifyPics(paper) {
|
358
363
|
for (let key in paper) {
|
359
364
|
if (key.endsWith('_path')) {
|
360
365
|
if (!paper[key]) {
|
@@ -369,7 +374,7 @@ let GetLoginInfoService = {
|
|
369
374
|
},
|
370
375
|
|
371
376
|
// load script and other stuff
|
372
|
-
loadscript
|
377
|
+
loadscript(type, fileName) {
|
373
378
|
return new Promise((resolve, reject) => {
|
374
379
|
let element
|
375
380
|
if (type == 'css') {
|
@@ -396,11 +401,11 @@ let GetLoginInfoService = {
|
|
396
401
|
})
|
397
402
|
},
|
398
403
|
// 不能选择器中截取掉多余的字符
|
399
|
-
orgName
|
404
|
+
orgName(name) {
|
400
405
|
return name.substring(10)
|
401
406
|
},
|
402
407
|
|
403
|
-
getNowDate
|
408
|
+
getNowDate(name) {
|
404
409
|
// 求取当前时间的工具
|
405
410
|
let myweekday = ''
|
406
411
|
let year = ''
|
@@ -415,7 +420,7 @@ let GetLoginInfoService = {
|
|
415
420
|
return year + '年' + mymonth + '月' + myday + '日 ' + week[myweekday]
|
416
421
|
},
|
417
422
|
|
418
|
-
addDate
|
423
|
+
addDate(date, days) {
|
419
424
|
// 求取当前时间的工具
|
420
425
|
let endDate = new Date(date)
|
421
426
|
endDate = endDate.valueOf()
|
@@ -432,7 +437,7 @@ let GetLoginInfoService = {
|
|
432
437
|
},
|
433
438
|
|
434
439
|
// 通过地址栏的参数获取参数内容
|
435
|
-
getUrlParames
|
440
|
+
getUrlParames(param) {
|
436
441
|
var query = window.location.search
|
437
442
|
var iLen = param.length
|
438
443
|
var iStart = query.indexOf(param)
|
@@ -448,7 +453,7 @@ let GetLoginInfoService = {
|
|
448
453
|
},
|
449
454
|
|
450
455
|
// 从地址栏获取加密的参数
|
451
|
-
getUrlCompileParames
|
456
|
+
getUrlCompileParames(param) {
|
452
457
|
let code = unescape(window.location.search.slice(1, window.location.search.length))
|
453
458
|
let query = String.fromCharCode(code.charCodeAt(0) - code.length)
|
454
459
|
for (var i = 1; i < code.length; i++) {
|
@@ -468,7 +473,7 @@ let GetLoginInfoService = {
|
|
468
473
|
},
|
469
474
|
|
470
475
|
// 对字符串进行加密
|
471
|
-
compileStr
|
476
|
+
compileStr(code) {
|
472
477
|
let c = String.fromCharCode(code.charCodeAt(0) + code.length)
|
473
478
|
for (let i = 1; i < code.length; i++) {
|
474
479
|
c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
|
@@ -476,7 +481,7 @@ let GetLoginInfoService = {
|
|
476
481
|
return escape(c)
|
477
482
|
},
|
478
483
|
// 字符串进行解密
|
479
|
-
uncompileStr
|
484
|
+
uncompileStr(code) {
|
480
485
|
code = unescape(code)
|
481
486
|
let c = String.fromCharCode(code.charCodeAt(0) - code.length)
|
482
487
|
for (var i = 1; i < code.length; i++) {
|
@@ -485,7 +490,7 @@ let GetLoginInfoService = {
|
|
485
490
|
return c
|
486
491
|
},
|
487
492
|
|
488
|
-
dateDescripte
|
493
|
+
dateDescripte(date) {
|
489
494
|
let nowTime = new Date().getTime()
|
490
495
|
let oldTime = new Date(date).getTime()
|
491
496
|
let timeDiff = nowTime - oldTime
|
@@ -518,7 +523,7 @@ let GetLoginInfoService = {
|
|
518
523
|
return des
|
519
524
|
},
|
520
525
|
|
521
|
-
nextMonth20
|
526
|
+
nextMonth20(date) {
|
522
527
|
let ds = date.split('-')
|
523
528
|
let nextMonth = ds[1] - 0 + 1
|
524
529
|
return ds[0] + '-' + (nextMonth < 10 ? '0' + nextMonth : nextMonth) + '-20 00:00:00'
|