system-phone 3.1.77 → 3.1.79
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.
|
@@ -367,7 +367,7 @@ export default {
|
|
|
367
367
|
console.log('获取参数结束')
|
|
368
368
|
this.loaderShow = false
|
|
369
369
|
// 弱口令验证
|
|
370
|
-
if (this.weakPassword && !(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?!.*(123|321|abc|cba))[a-zA-Z\d!@#$%^&*()_
|
|
370
|
+
if (this.weakPassword && !(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])(?!.*(123|321|abc|cba))[a-zA-Z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]{8,16}$/.test(this.password))) {
|
|
371
371
|
await this.$showMessage('登录系统: 此账户的密码过于简单,请修改密码后重新登陆!!!', ['confirm'])
|
|
372
372
|
this.modifyPassword = true
|
|
373
373
|
return
|
|
@@ -200,40 +200,112 @@ export default {
|
|
|
200
200
|
console.log("加密后的用户登录信息", userDataEncrypt)
|
|
201
201
|
try {
|
|
202
202
|
let ret = {}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
this.
|
|
211
|
-
|
|
203
|
+
let loginData = {
|
|
204
|
+
username: this.ename,
|
|
205
|
+
password: this.password,
|
|
206
|
+
resourceName: '新手机服务'
|
|
207
|
+
}
|
|
208
|
+
if(Vue.isafsystem){
|
|
209
|
+
try {
|
|
210
|
+
ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-auth/login`, loginData, {
|
|
211
|
+
resolveMsg: null,
|
|
212
|
+
rejectMsg: null,
|
|
213
|
+
headerConfig: {'Content-type': 'application/json'}
|
|
214
|
+
})
|
|
215
|
+
if (ret.data) {
|
|
216
|
+
if (ret.data.resources.data && ret.data.resources.data.id) {
|
|
217
|
+
loginData = ret.data.resources.data
|
|
218
|
+
} else {
|
|
219
|
+
loginData = ret.data.resources
|
|
220
|
+
}
|
|
221
|
+
this.$androidUtil.setPreference('siteId', loginData.f_extend1 || '')
|
|
222
|
+
this.$androidUtil.setPreference('flatId', loginData.f_extend2 || '')
|
|
223
|
+
this.$androidUtil.setPreference('name', loginData.name || '')
|
|
224
|
+
this.$androidUtil.setPreference('ename', loginData.ename || '')
|
|
225
|
+
} else {
|
|
226
|
+
throw {status: ret.data.code, message: ret.data.msg}
|
|
227
|
+
}
|
|
228
|
+
// 设置登录人
|
|
229
|
+
Vue.user = Util.f = loginData
|
|
230
|
+
// 功能排序
|
|
231
|
+
Vue.functions = this.sortFunctions(loginData.functions)
|
|
232
|
+
}catch (e) {
|
|
233
|
+
if (Vue.android) {
|
|
234
|
+
this.loaderShow = false
|
|
235
|
+
this.$showMessage(e.message ? e.message : '登录失败!用户名或密码错误!')
|
|
236
|
+
}
|
|
212
237
|
return
|
|
213
238
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
239
|
+
}else{
|
|
240
|
+
try {
|
|
241
|
+
ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/user/userLogin/新手机服务`, userDataEncrypt, {
|
|
242
|
+
resolveMsg: null,
|
|
243
|
+
rejectMsg: null
|
|
244
|
+
})
|
|
245
|
+
console.log('获取登陆信息:', ret.data)
|
|
246
|
+
if(ret.data.state == '离职'){
|
|
247
|
+
this.loaderShow = false
|
|
248
|
+
this.$showMessage('登录失败!用户名或密码错误!')
|
|
249
|
+
return
|
|
250
|
+
}
|
|
251
|
+
//秦华---(siteId==站点id)===============(flatId==平板id)
|
|
252
|
+
this.$androidUtil.setPreference('siteId', ret.data.f_extend1 || '')
|
|
253
|
+
this.$androidUtil.setPreference('flatId', ret.data.f_extend2 || '')
|
|
254
|
+
this.$androidUtil.setPreference('name', ret.data.name || '')
|
|
255
|
+
this.$androidUtil.setPreference('ename', ret.data.ename || '')
|
|
256
|
+
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code !== 200) {
|
|
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.functions = this.sortFunctions(ret.data.data.functions)
|
|
262
|
+
} else {
|
|
263
|
+
Vue.functions = this.sortFunctions(ret.data.functions)
|
|
264
|
+
}
|
|
265
|
+
} catch (e) {
|
|
266
|
+
if (Vue.android) {
|
|
267
|
+
this.loaderShow = false
|
|
268
|
+
this.$showMessage(e.message ? e.message : '登录失败!用户名或密码错误!')
|
|
269
|
+
}
|
|
270
|
+
return
|
|
221
271
|
}
|
|
222
|
-
|
|
223
|
-
if (
|
|
224
|
-
|
|
225
|
-
|
|
272
|
+
// 设置登录人
|
|
273
|
+
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
|
|
274
|
+
Vue.user = Util.f = ret.data.data
|
|
275
|
+
} else {
|
|
276
|
+
Vue.user = Util.f = ret.data
|
|
226
277
|
}
|
|
227
|
-
return
|
|
228
278
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
279
|
+
let jwt = ''
|
|
280
|
+
let access_token = ''
|
|
281
|
+
if(Vue.isafsystem){
|
|
282
|
+
jwt = loginData.id
|
|
283
|
+
access_token = ret.data.access_token
|
|
284
|
+
}else{
|
|
285
|
+
console.log("ret", ret)
|
|
286
|
+
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
|
|
287
|
+
jwt = ret.data.data.id
|
|
288
|
+
}else{
|
|
289
|
+
jwt = ret.data.id
|
|
290
|
+
}
|
|
235
291
|
}
|
|
236
|
-
|
|
292
|
+
Vue.$login = Vue.prototype.$login = {jwt: jwt,
|
|
293
|
+
jwtNew:access_token,
|
|
294
|
+
toStandardDateString () {
|
|
295
|
+
let dt = new Date()
|
|
296
|
+
let month = dt.getMonth() + 1
|
|
297
|
+
let date = dt.getDate()
|
|
298
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
299
|
+
}, toStandardTimeString () {
|
|
300
|
+
let dt = new Date()
|
|
301
|
+
let month = dt.getMonth()+1
|
|
302
|
+
let date = dt.getDate()
|
|
303
|
+
let hour = dt.getHours()
|
|
304
|
+
let min = dt.getMinutes()
|
|
305
|
+
let sec = dt.getSeconds()
|
|
306
|
+
return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
|
|
307
|
+
+ ' ' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
|
|
308
|
+
}}
|
|
237
309
|
// 对资源菜单进行排序
|
|
238
310
|
let viewDetails = await Vue.resetpost(`${this.$androidUtil.getProxyUrl()}/rs/search`, {
|
|
239
311
|
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
|
|
@@ -242,12 +314,6 @@ export default {
|
|
|
242
314
|
const rithtList = viewDetails.data
|
|
243
315
|
Vue.user.r = []
|
|
244
316
|
rithtList.forEach(x => Vue.user.r.push(x.name))
|
|
245
|
-
// 功能排序
|
|
246
|
-
if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
|
|
247
|
-
Vue.functions = this.sortFunctions(ret.data.data.functions)
|
|
248
|
-
} else {
|
|
249
|
-
Vue.functions = this.sortFunctions(ret.data.functions)
|
|
250
|
-
}
|
|
251
317
|
console.log('登陆人信息', JSON.stringify(Vue.user))
|
|
252
318
|
let userStr
|
|
253
319
|
if (Vue.android) {
|