system-phone 3.1.22 → 3.1.24

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.22",
3
+ "version": "3.1.24",
4
4
  "description": "手机模块 前端组件",
5
5
  "author": "何宁社 <524395609@qq.com>",
6
6
  "license": "ISC",
@@ -39,7 +39,7 @@
39
39
  <header slot="modal-header" class="modal-header">
40
40
  </header>
41
41
  <article slot="modal-body" class="modal-body">
42
- <modify-pass-word :sourse="login" :weak-password="weakPassword" v-if="modifyPassword"
42
+ <modify-pass-word :sourse="login" :weak-password="weakPassword" v-if="modifyPassword"
43
43
  v-on:success="success"></modify-pass-word>
44
44
  </article>
45
45
  <footer slot="modal-footer" class="modal-footer">
@@ -70,32 +70,9 @@ let asyncReady = async function (self, url) {
70
70
  await self.$appdata.load()
71
71
  console.log('获取营收配置文件和参数【结束】,开始获取vue配置文件【开始】')
72
72
  let that = self
73
- const vueConfig={}
74
- const res = await Vue.resetget(`${url}/api/af-safecheck/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
75
- self.delConfigKey(res.data)
76
- vueConfig.safecheck = res.data
77
- const dir_module = res.data.global.dir_module
78
- for(let mod in dir_module) {
79
- if (dir_module[mod].name !== 'af-safecheck') {
80
- let mod_url = `${url}/api/${dir_module[mod].name}/vue`
81
- if (!dir_module[mod].name.startsWith('af-')) {
82
- mod_url = `${url}/${dir_module[mod].name}/rs/vue`
83
- }
84
- let config = null
85
- try{
86
- config = await Vue.resetget(mod_url, {data: {}}, {resolveMsg: null, rejectMsg: null})
87
- }catch (e) {
88
- console.log('获取配置报错-先跳过', e)
89
- }
90
- // 拿到的配置有问题就跳过
91
- if(config && config.data instanceof Object){
92
- self.delConfigKey(config.data)
93
- vueConfig[dir_module[mod].name] = config.data;
94
- }
95
- }
96
- }
97
- that.$set('config', vueConfig)
98
- Vue.config2 = vueConfig
73
+ let res = await Vue.resetget(`${url}/phone/rs/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
74
+ that.$set('config', res.data)
75
+ Vue.config2 = res.data
99
76
  // 判断是否需要弱密码校验
100
77
  if (self.config && self.config.telephone && self.config.telephone.LoginApp && 'undefined' != typeof self.config.telephone.LoginApp.weakPassword) {
101
78
  self.weakPassword = self.config.telephone.LoginApp.weakPassword
@@ -176,23 +153,20 @@ export default {
176
153
  },
177
154
  // 对资源菜单进行排序
178
155
  sortFunctions (val) {
179
- this.sortArr(val)
180
- val.forEach((item)=>{
181
- if(item.children && Array.isArray(item.children)){
182
- this.sortArr(item.children)
156
+ if (val && val.length > 0) {
157
+ for (var i = 0; i < val.length - 1; i++) {
158
+ for (var j = 0; j < val.length - 1 - i; j++) {
159
+ if (val[j].position > val[j + 1].position) {
160
+ var temp = val[j + 1]
161
+ val[j + 1] = val[j]
162
+ val[j] = temp
163
+ }
164
+ }
183
165
  }
184
- })
166
+ return val
167
+ }
185
168
  return val
186
169
  },
187
- sortArr(val){
188
- val.sort((itemA, itemB)=>{
189
- if(itemA.position !== itemB.position){
190
- return itemA.position - itemB.position
191
- }else{
192
- return itemA.id - itemB.id
193
- }
194
- })
195
- },
196
170
  // 记住密码选中/未选中
197
171
  showoff () {
198
172
  this.showsave = false
@@ -217,7 +191,7 @@ export default {
217
191
  async confirm () {
218
192
  this.loaderShow = true
219
193
  // 判断用户状态
220
- let users = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, {
194
+ let users = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
221
195
  data: {
222
196
  items: '*',
223
197
  tablename: 't_user',
@@ -233,128 +207,126 @@ export default {
233
207
  console.log('Vue.android:' + Vue.android)
234
208
  Vue.dataUrl = this.$androidUtil.getProxyUrl() + '/'
235
209
  let loginData = {}
236
- try {
237
- let ret = {}
238
210
  try {
239
- ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-auth/login`, {
240
- username: this.ename, password: this.password,
241
- resourceName: '手机服务'
242
- }, {
243
- resolveMsg: null,
244
- rejectMsg: null,
245
- headerConfig: {'Content-type': 'application/json'}
246
- })
247
- console.log(ret, '==')
248
- if (ret.data) {
249
- if (ret.data.resources.data && ret.data.resources.data.id) {
250
- loginData = ret.data.resources.data
211
+ let ret = {}
212
+ try {
213
+ ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-auth/login`, {
214
+ username: this.ename, password: this.password,
215
+ resourceName: '手机服务'
216
+ }, {
217
+ resolveMsg: null,
218
+ rejectMsg: null,
219
+ headerConfig: {'Content-type': 'application/json'}
220
+ })
221
+ console.log(ret, '==')
222
+ if (ret.data) {
223
+ if (ret.data.resources.data && ret.data.resources.data.id) {
224
+ loginData = ret.data.resources.data
225
+ } else {
226
+ loginData = ret.data.resources
227
+ }
228
+ this.$androidUtil.setPreference('siteId', loginData.f_extend1 || '')
229
+ this.$androidUtil.setPreference('flatId', loginData.f_extend2 || '')
230
+ this.$androidUtil.setPreference('name', loginData.name || '')
231
+ this.$androidUtil.setPreference('ename', loginData.ename || '')
251
232
  } else {
252
- loginData = ret.data.resources
233
+ throw {status: ret.data.code, message: ret.data.msg}
253
234
  }
254
- this.$androidUtil.setPreference('siteId', loginData.f_extend1 || '')
255
- this.$androidUtil.setPreference('flatId', loginData.f_extend2 || '')
256
- this.$androidUtil.setPreference('name', loginData.name || '')
257
- this.$androidUtil.setPreference('ename', loginData.ename || '')
258
- } else {
259
- throw {status: ret.data.code, message: ret.data.msg}
260
- }
261
- } catch (e) {
262
- if (Vue.android) {
263
- this.loaderShow = false
264
- this.$showMessage(e.message ? e.message : '登录失败!用户名或密码错误!')
235
+ } catch (e) {
236
+ if (Vue.android) {
237
+ this.loaderShow = false
238
+ this.$showMessage(e.message ? e.message : '登录失败!用户名或密码错误!')
239
+ }
240
+ return
265
241
  }
266
- return
267
- }
268
242
 
269
- // 设置登录人
270
- Vue.user = Util.f = loginData
271
-
272
- // 对资源菜单进行排序
273
- try{
274
- let viewDetails = await Vue.resetpost(`${this.$androidUtil.getProxyUrl()}/rs/search`, {
275
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
276
- userid: Vue.user.id
277
- }, {resolveMsg: null, rejectMsg: null})
278
- const rithtList = viewDetails.data
279
- Vue.user.r = []
280
- rithtList.forEach(x => Vue.user.r.push(x.name))
281
- }catch (e) {
282
- console.log('资源排序失败!暂时先不影响登录')
283
- }
284
- // 功能排序
285
- Vue.functions = this.sortFunctions(loginData.functions)
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
- }
243
+ // 设置登录人
244
+ Vue.user = Util.f = loginData
245
+
246
+ // 对资源菜单进行排序
247
+ try{
248
+ let viewDetails = await Vue.resetpost(`${this.$androidUtil.getProxyUrl()}/rs/search`, {
249
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
250
+ userid: Vue.user.id
299
251
  }, {resolveMsg: null, rejectMsg: null})
300
- console.log(`检测设备码存在是否:${result.data.length}`)
301
- if (result.data.length == 0) {
302
- HostApp.alert('设备码未绑定,请联系管理员!')
303
- return
304
- }
252
+ const rithtList = viewDetails.data
253
+ Vue.user.r = []
254
+ rithtList.forEach(x => Vue.user.r.push(x.name))
255
+ }catch (e) {
256
+ console.log('资源排序失败!暂时先不影响登录')
305
257
  }
306
- if (this.showsave) {
307
- userStr = `{'username':'${this.ename}','password':'${this.password}'}`
308
- } else {
309
- userStr = `{'username':'${this.ename}','password':''}`
258
+ Vue.functions = this.sortFunctions(loginData.functions)
259
+ let userStr
260
+ if (Vue.android) {
261
+ console.log(`Device_IEMI:${this.$androidUtil.getPreference('Device_IEMI')}`)
262
+ // 判断是否需要验证 设备码
263
+ if (this.$androidUtil.getPreference('Device_IEMI')) {
264
+ console.log(`手机设备码:${this.deviceIemi}`)
265
+ let result = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
266
+ data: {
267
+ items: '*',
268
+ tablename: 't_equipment',
269
+ orderitem: 'id desc',
270
+ condition: `f_terminal_number = '${this.deviceIemi}' and f_state = '正常'`
271
+ }
272
+ }, {resolveMsg: null, rejectMsg: null})
273
+ console.log(`检测设备码存在是否:${result.data.length}`)
274
+ if (result.data.length == 0) {
275
+ HostApp.alert('设备码未绑定,请联系管理员!')
276
+ return
277
+ }
278
+ }
279
+ if (this.showsave) {
280
+ userStr = `{'username':'${this.ename}','password':'${this.password}'}`
281
+ } else {
282
+ userStr = `{'username':'${this.ename}','password':''}`
283
+ }
284
+ console.log(this.showauto)
285
+ this.$androidUtil.setPreference('login_user_cache', userStr)
286
+ this.$androidUtil.setPreference('f_repairman_id', Util.f.id)
287
+ this.$androidUtil.setPreference('f_repairman_name', Util.f.name)
288
+ this.$androidUtil.setPreference('f_orgid', Util.f.orgid)
289
+ this.$androidUtil.setPreference('f_role_name', Util.f.f_role_name || '')
290
+ console.log('自动登陆标识' + Util.f.f_role_name)
291
+ console.log(this.showauto)
292
+ this.$androidUtil.setPreference('auto_login', this.showauto)
310
293
  }
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
- this.$androidUtil.setPreference('access_token', ret.data.access_token)
318
- console.log('自动登陆标识' + Util.f.f_role_name)
319
- console.log(this.showauto)
320
- this.$androidUtil.setPreference('auto_login', this.showauto)
321
- }
322
- Vue.$login = Vue.prototype.$login = {
323
- jwt: loginData.id,
324
- jwtNew: ret.data.access_token,
325
- toStandardDateString () {
326
- let dt = new Date()
327
- let month = dt.getMonth() + 1
328
- let date = dt.getDate()
329
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
330
- }, toStandardTimeString () {
331
- let dt = new Date()
332
- let month = dt.getMonth() + 1
333
- let date = dt.getDate()
334
- let hour = dt.getHours()
335
- let min = dt.getMinutes()
336
- let sec = dt.getSeconds()
337
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
338
- + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
294
+ Vue.$login = Vue.prototype.$login = {
295
+ jwt: loginData.id,
296
+ jwtNew: ret.data.access_token,
297
+ toStandardDateString () {
298
+ let dt = new Date()
299
+ let month = dt.getMonth() + 1
300
+ let date = dt.getDate()
301
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
302
+ }, toStandardTimeString () {
303
+ let dt = new Date()
304
+ let month = dt.getMonth() + 1
305
+ let date = dt.getDate()
306
+ let hour = dt.getHours()
307
+ let min = dt.getMinutes()
308
+ let sec = dt.getSeconds()
309
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
310
+ + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
311
+ }
339
312
  }
340
- }
341
- // 获取参数
342
- console.log('获取参数system以及安检参数')
343
- const flag = await asyncReady(this, this.$androidUtil.getProxyUrl())
313
+ // 获取参数
314
+ console.log('获取参数system以及安检参数')
315
+ const flag = await asyncReady(this, this.$androidUtil.getProxyUrl())
344
316
  if (!flag) {
317
+ this.loaderShow = false
318
+ console.log('获取参数异常')
319
+ return
320
+ }
321
+ console.log('获取参数结束')
345
322
  this.loaderShow = false
346
- console.log('获取参数异常')
347
- return
323
+ // 弱口令验证
324
+ if (this.weakPassword && !(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?!.*(123|321|abc|cba))[a-zA-Z\d!@#$%^&*()_+-=<>?]{8,16}$/.test(this.password))) {
325
+ await this.$showMessage('登录系统: 此账户的密码过于简单,请修改密码后重新登陆!!!', ['confirm'])
326
+ this.modifyPassword = true
327
+ return
348
328
  }
349
- console.log('获取参数结束')
350
- this.loaderShow = false
351
- // 弱口令验证
352
- if (this.weakPassword && !(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?!.*(123|321|abc|cba))[a-zA-Z\d!@#$%^&*()_+-=<>?]{8,16}$/.test(this.password))) {
353
- await this.$showMessage('登录系统: 此账户的密码过于简单,请修改密码后重新登陆!!!', ['confirm'])
354
- this.modifyPassword = true
355
- return
356
- }
357
- this.$goto('nav-bottom')
329
+ this.$goto('nav-bottom')
358
330
  } catch (e) {
359
331
  if (Vue.android) {
360
332
  this.loaderShow = false
@@ -362,18 +334,6 @@ export default {
362
334
  console.error('登录异常,LoginApp的confirm函数错误', e)
363
335
  this.$showMessage('登陆失败!,')
364
336
  }
365
- },
366
- delConfigKey(obj){
367
- // 从琉璃中获取的配置中会包含 $开头的一些额外描述新的key。为了兼容v3的代码逻辑在此函数中去掉
368
- Object.keys(obj).forEach(key =>{
369
- Object.keys(obj[key]).forEach(col => {
370
- // 检查键是否以$开头
371
- if (col.startsWith('$')) {
372
- // 使用delete操作符删除键
373
- delete obj[key][col];
374
- }
375
- })
376
- })
377
337
  }
378
338
  },
379
339
  watch: {