system-phone 3.1.84 → 3.1.85

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-phone",
3
- "version": "3.1.84",
3
+ "version": "3.1.85",
4
4
  "description": "手机模块 前端组件",
5
5
  "author": "何宁社 <524395609@qq.com>",
6
6
  "license": "ISC",
@@ -243,11 +243,26 @@ export default {
243
243
  data = '$' + cryptJS.RSAEncrypt(JSON.stringify(data))
244
244
  const getLogin = await Vue.resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/getLogin`, data, {resolveMsg: null, rejectMsg: null})
245
245
  if (getLogin.data.states === '登录成功'){
246
- // 获取jwt
247
- Vue.$login.jwt = getLogin.data.jwt
248
- Vue.$login.jwtNew = getLogin.data.jwtNew
249
- if (getLogin.data.s) {
250
- Vue.$login['v3-session-key'] = cryptJS.RSADecrypt(getLogin.data.s)
246
+ // 初始化 Vue.$login
247
+ Vue.$login = Vue.prototype.$login = {
248
+ jwt: getLogin.data.jwt,
249
+ jwtNew: getLogin.data.jwtNew,
250
+ 'v3-session-key': getLogin.data.s ? cryptJS.RSADecrypt(getLogin.data.s) : '',
251
+ toStandardDateString() {
252
+ const dt = new Date()
253
+ const month = dt.getMonth() + 1
254
+ const date = dt.getDate()
255
+ return `${dt.getFullYear()}-${month < 10 ? '0' + month : month}-${date < 10 ? '0' + date : date}`
256
+ },
257
+ toStandardTimeString() {
258
+ const dt = new Date()
259
+ const month = dt.getMonth() + 1
260
+ const date = dt.getDate()
261
+ const hour = dt.getHours()
262
+ const min = dt.getMinutes()
263
+ const sec = dt.getSeconds()
264
+ return `${dt.getFullYear()}-${month < 10 ? '0' + month : month}-${date < 10 ? '0' + date : date} ${hour < 10 ? '0' + hour : hour}:${min < 10 ? '0' + min : min}:${sec < 10 ? '0' + sec : sec}`
265
+ }
251
266
  }
252
267
  // 调用远程登录服务,获取所有有权访问的功能
253
268
  data = {username: this.ename, password: this.password}
@@ -265,9 +280,9 @@ export default {
265
280
  }
266
281
  // 设置登录人
267
282
  if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
268
- Vue.user = Util.f = ret.data.data
283
+ Vue.user = Vue.$login.f = Util.f = ret.data.data
269
284
  } else {
270
- Vue.user = Util.f = ret.data
285
+ Vue.user = Vue.$login.f = Util.f = ret.data
271
286
  }
272
287
  // 功能排序
273
288
  if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
@@ -288,42 +303,16 @@ export default {
288
303
  return
289
304
  }
290
305
  }
291
- // 获取jwt
292
- let jwt = ''
293
- let access_token = ''
294
- let sessionKey = ''
306
+ // 更新 jwt(Vue.$login 已在 getLogin 成功后初始化)
295
307
  if(Vue.isafsystem){
296
- jwt = loginData.id
297
- access_token = ret.data.access_token
308
+ Vue.$login.jwt = loginData.id
309
+ Vue.$login.jwtNew = ret.data.access_token
298
310
  }else{
299
311
  console.log("ret", ret)
300
312
  if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
301
- jwt = ret.data.data.id
313
+ Vue.$login.jwt = ret.data.data.id
302
314
  }else{
303
- jwt = ret.data.id
304
- }
305
- sessionKey = Vue.$login ? Vue.$login['v3-session-key'] : ''
306
- access_token = Vue.$login ? Vue.$login.jwtNew : ''
307
- }
308
- // 初始化 Vue.$login
309
- Vue.$login = Vue.prototype.$login = {
310
- jwt: jwt,
311
- jwtNew: access_token,
312
- 'v3-session-key': sessionKey,
313
- toStandardDateString() {
314
- const dt = new Date()
315
- const month = dt.getMonth() + 1
316
- const date = dt.getDate()
317
- return `${dt.getFullYear()}-${month < 10 ? '0' + month : month}-${date < 10 ? '0' + date : date}`
318
- },
319
- toStandardTimeString() {
320
- const dt = new Date()
321
- const month = dt.getMonth() + 1
322
- const date = dt.getDate()
323
- const hour = dt.getHours()
324
- const min = dt.getMinutes()
325
- const sec = dt.getSeconds()
326
- return `${dt.getFullYear()}-${month < 10 ? '0' + month : month}-${date < 10 ? '0' + date : date} ${hour < 10 ? '0' + hour : hour}:${min < 10 ? '0' + min : min}:${sec < 10 ? '0' + sec : sec}`
315
+ Vue.$login.jwt = ret.data.id
327
316
  }
328
317
  }
329
318
  // 对资源菜单进行排序