system-phone 3.1.67 → 3.1.68
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 +1 -1
- package/src/components/LoginApp.vue +111 -112
package/package.json
CHANGED
|
@@ -205,8 +205,8 @@ export default {
|
|
|
205
205
|
password: this.password,
|
|
206
206
|
resourceName: '手机服务'
|
|
207
207
|
}
|
|
208
|
+
let ret = {}
|
|
208
209
|
if(Vue.isafsystem){
|
|
209
|
-
let ret = {}
|
|
210
210
|
try {
|
|
211
211
|
ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-auth/login`, loginData, {
|
|
212
212
|
resolveMsg: null,
|
|
@@ -238,130 +238,129 @@ export default {
|
|
|
238
238
|
return
|
|
239
239
|
}
|
|
240
240
|
}else{
|
|
241
|
-
// rsa加密
|
|
242
241
|
let encrypt = new JSEncrypt();
|
|
243
242
|
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB');
|
|
244
243
|
const userDataEncrypt = encrypt.encrypt(JSON.stringify(userData))
|
|
245
244
|
console.log("加密后的用户登录信息", userDataEncrypt)
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
throw {status: ret.data.code, message: ret.data.msg}
|
|
258
|
-
}
|
|
259
|
-
// 设置登录人
|
|
260
|
-
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
|
|
261
|
-
Vue.user = Util.f = ret.data.data
|
|
262
|
-
} else {
|
|
263
|
-
Vue.user = Util.f = ret.data
|
|
264
|
-
}
|
|
265
|
-
// 功能排序
|
|
266
|
-
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
|
|
267
|
-
Vue.functions = this.sortFunctions(ret.data.data.functions)
|
|
268
|
-
} else {
|
|
269
|
-
Vue.functions = this.sortFunctions(ret.data.functions)
|
|
270
|
-
}
|
|
271
|
-
}catch (e) {
|
|
272
|
-
if (Vue.android) {
|
|
273
|
-
this.loaderShow = false
|
|
274
|
-
this.$showMessage(e.message ? e.message : '登录失败!用户名或密码错误!')
|
|
275
|
-
}
|
|
276
|
-
return
|
|
245
|
+
try {
|
|
246
|
+
ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/user/userLogin/手机服务`, userDataEncrypt, {
|
|
247
|
+
resolveMsg: null,
|
|
248
|
+
rejectMsg: null
|
|
249
|
+
})
|
|
250
|
+
this.$androidUtil.setPreference('siteId', ret.data.f_extend1 || '')
|
|
251
|
+
this.$androidUtil.setPreference('flatId', ret.data.f_extend2 || '')
|
|
252
|
+
this.$androidUtil.setPreference('name', ret.data.name || '')
|
|
253
|
+
this.$androidUtil.setPreference('ename', ret.data.ename || '')
|
|
254
|
+
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code !== 200) {
|
|
255
|
+
throw {status: ret.data.code, message: ret.data.msg}
|
|
277
256
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
284
|
-
const rithtList = viewDetails.data
|
|
285
|
-
Vue.user.r = []
|
|
286
|
-
rithtList.forEach(x => Vue.user.r.push(x.name))
|
|
287
|
-
console.log('登陆人信息', JSON.stringify(Vue.user))
|
|
288
|
-
let userStr
|
|
289
|
-
if (Vue.android) {
|
|
290
|
-
console.log(`Device_IEMI:${this.$androidUtil.getPreference('Device_IEMI')}`)
|
|
291
|
-
// 判断是否需要验证 设备码
|
|
292
|
-
if (this.$androidUtil.getPreference('Device_IEMI')) {
|
|
293
|
-
console.log(`手机设备码:${this.deviceIemi}`)
|
|
294
|
-
let result = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
|
|
295
|
-
data: {
|
|
296
|
-
items: '*',
|
|
297
|
-
tablename: 't_equipment',
|
|
298
|
-
orderitem: 'id desc',
|
|
299
|
-
condition: `f_terminal_number = '${this.deviceIemi}' and f_state = '正常'`
|
|
300
|
-
}
|
|
301
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
302
|
-
console.log(`检测设备码存在是否:${result.data.length}`)
|
|
303
|
-
if (result.data.length == 0) {
|
|
304
|
-
HostApp.alert('设备码未绑定,请联系管理员!')
|
|
305
|
-
return
|
|
306
|
-
}
|
|
257
|
+
// 设置登录人
|
|
258
|
+
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
|
|
259
|
+
Vue.user = Util.f = ret.data.data
|
|
260
|
+
} else {
|
|
261
|
+
Vue.user = Util.f = ret.data
|
|
307
262
|
}
|
|
308
|
-
|
|
309
|
-
|
|
263
|
+
// 功能排序
|
|
264
|
+
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
|
|
265
|
+
Vue.functions = this.sortFunctions(ret.data.data.functions)
|
|
310
266
|
} else {
|
|
311
|
-
|
|
267
|
+
Vue.functions = this.sortFunctions(ret.data.functions)
|
|
268
|
+
}
|
|
269
|
+
}catch (e) {
|
|
270
|
+
if (Vue.android) {
|
|
271
|
+
this.loaderShow = false
|
|
272
|
+
this.$showMessage(e.message ? e.message : '登录失败!用户名或密码错误!')
|
|
312
273
|
}
|
|
313
|
-
|
|
314
|
-
this.$androidUtil.setPreference('login_user_cache', userStr)
|
|
315
|
-
this.$androidUtil.setPreference('f_repairman_id', Util.f.id)
|
|
316
|
-
this.$androidUtil.setPreference('f_repairman_name', Util.f.name)
|
|
317
|
-
this.$androidUtil.setPreference('f_orgid', Util.f.orgid)
|
|
318
|
-
this.$androidUtil.setPreference('f_role_name', Util.f.f_role_name || '')
|
|
319
|
-
console.log("自动登陆标识" + Util.f.f_role_name)
|
|
320
|
-
this.$androidUtil.setPreference('auto_login', this.showauto)
|
|
274
|
+
return
|
|
321
275
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
276
|
+
}
|
|
277
|
+
// 对资源菜单进行排序
|
|
278
|
+
let viewDetails = await Vue.resetpost(`${this.$androidUtil.getProxyUrl()}/rs/search`, {
|
|
279
|
+
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
|
|
280
|
+
userid: Vue.user.id
|
|
281
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
282
|
+
const rithtList = viewDetails.data
|
|
283
|
+
Vue.user.r = []
|
|
284
|
+
rithtList.forEach(x => Vue.user.r.push(x.name))
|
|
285
|
+
console.log('登陆人信息', JSON.stringify(Vue.user))
|
|
286
|
+
let userStr
|
|
287
|
+
if (Vue.android) {
|
|
288
|
+
console.log(`Device_IEMI:${this.$androidUtil.getPreference('Device_IEMI')}`)
|
|
289
|
+
// 判断是否需要验证 设备码
|
|
290
|
+
if (this.$androidUtil.getPreference('Device_IEMI')) {
|
|
291
|
+
console.log(`手机设备码:${this.deviceIemi}`)
|
|
292
|
+
let result = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
|
|
293
|
+
data: {
|
|
294
|
+
items: '*',
|
|
295
|
+
tablename: 't_equipment',
|
|
296
|
+
orderitem: 'id desc',
|
|
297
|
+
condition: `f_terminal_number = '${this.deviceIemi}' and f_state = '正常'`
|
|
298
|
+
}
|
|
299
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
300
|
+
console.log(`检测设备码存在是否:${result.data.length}`)
|
|
301
|
+
if (result.data.length == 0) {
|
|
302
|
+
HostApp.alert('设备码未绑定,请联系管理员!')
|
|
303
|
+
return
|
|
330
304
|
}
|
|
331
305
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
let date = dt.getDate()
|
|
337
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
338
|
-
}, toStandardTimeString () {
|
|
339
|
-
let dt = new Date()
|
|
340
|
-
let month = dt.getMonth()+1
|
|
341
|
-
let date = dt.getDate()
|
|
342
|
-
let hour = dt.getHours()
|
|
343
|
-
let min = dt.getMinutes()
|
|
344
|
-
let sec = dt.getSeconds()
|
|
345
|
-
return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
|
|
346
|
-
+ ' ' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
|
|
347
|
-
}}
|
|
348
|
-
// 获取参数
|
|
349
|
-
console.log('获取参数system以及安检参数')
|
|
350
|
-
const flag = await asyncReady(this, this.$androidUtil.getProxyUrl())
|
|
351
|
-
if (!flag) {
|
|
352
|
-
this.loaderShow = false
|
|
353
|
-
console.log('获取参数异常')
|
|
354
|
-
return
|
|
306
|
+
if (this.showsave) {
|
|
307
|
+
userStr = `{'username':'${this.ename}','password':'${this.password}'}`
|
|
308
|
+
} else {
|
|
309
|
+
userStr = `{'username':'${this.ename}','password':''}`
|
|
355
310
|
}
|
|
356
|
-
console.log(
|
|
357
|
-
this.
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
311
|
+
console.log(this.showauto)
|
|
312
|
+
this.$androidUtil.setPreference('login_user_cache', userStr)
|
|
313
|
+
this.$androidUtil.setPreference('f_repairman_id', Util.f.id)
|
|
314
|
+
this.$androidUtil.setPreference('f_repairman_name', Util.f.name)
|
|
315
|
+
this.$androidUtil.setPreference('f_orgid', Util.f.orgid)
|
|
316
|
+
this.$androidUtil.setPreference('f_role_name', Util.f.f_role_name || '')
|
|
317
|
+
console.log("自动登陆标识" + Util.f.f_role_name)
|
|
318
|
+
this.$androidUtil.setPreference('auto_login', this.showauto)
|
|
319
|
+
}
|
|
320
|
+
let jwt = ''
|
|
321
|
+
if(Vue.isafsystem){
|
|
322
|
+
jwt = loginData.id
|
|
323
|
+
}else{
|
|
324
|
+
console.log("ret", ret)
|
|
325
|
+
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
|
|
326
|
+
jwt = ret.data.data.id
|
|
327
|
+
}else{
|
|
328
|
+
jwt = ret.data.id
|
|
363
329
|
}
|
|
364
|
-
|
|
330
|
+
}
|
|
331
|
+
Vue.$login = Vue.prototype.$login = {jwt: jwt,
|
|
332
|
+
toStandardDateString () {
|
|
333
|
+
let dt = new Date()
|
|
334
|
+
let month = dt.getMonth() + 1
|
|
335
|
+
let date = dt.getDate()
|
|
336
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
337
|
+
}, toStandardTimeString () {
|
|
338
|
+
let dt = new Date()
|
|
339
|
+
let month = dt.getMonth()+1
|
|
340
|
+
let date = dt.getDate()
|
|
341
|
+
let hour = dt.getHours()
|
|
342
|
+
let min = dt.getMinutes()
|
|
343
|
+
let sec = dt.getSeconds()
|
|
344
|
+
return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
|
|
345
|
+
+ ' ' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
|
|
346
|
+
}}
|
|
347
|
+
// 获取参数
|
|
348
|
+
console.log('获取参数system以及安检参数')
|
|
349
|
+
const flag = await asyncReady(this, this.$androidUtil.getProxyUrl())
|
|
350
|
+
if (!flag) {
|
|
351
|
+
this.loaderShow = false
|
|
352
|
+
console.log('获取参数异常')
|
|
353
|
+
return
|
|
354
|
+
}
|
|
355
|
+
console.log('获取参数结束')
|
|
356
|
+
this.loaderShow = false
|
|
357
|
+
// 弱口令验证
|
|
358
|
+
if (this.weakPassword && !(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?!.*(123|321|abc|cba))[a-zA-Z\d!@#$%^&*()_+-=<>?]{8,16}$/.test(this.password))) {
|
|
359
|
+
await this.$showMessage('登录系统: 此账户的密码过于简单,请修改密码后重新登陆!!!', ['confirm'])
|
|
360
|
+
this.modifyPassword = true
|
|
361
|
+
return
|
|
362
|
+
}
|
|
363
|
+
this.$goto('nav-bottom')
|
|
365
364
|
},
|
|
366
365
|
},
|
|
367
366
|
watch: {
|