system-phone 3.1.78 → 3.1.80

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.78",
3
+ "version": "3.1.80",
4
4
  "description": "手机模块 前端组件",
5
5
  "author": "何宁社 <524395609@qq.com>",
6
6
  "license": "ISC",
@@ -200,40 +200,112 @@ export default {
200
200
  console.log("加密后的用户登录信息", userDataEncrypt)
201
201
  try {
202
202
  let ret = {}
203
- try {
204
- ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/user/userLogin/新手机服务`, userDataEncrypt, {
205
- resolveMsg: null,
206
- rejectMsg: null
207
- })
208
- console.log('获取登陆信息:', ret.data)
209
- if(ret.data.state == '离职'){
210
- this.loaderShow = false
211
- this.$showMessage('登录失败!用户名或密码错误!')
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
- //秦华---(siteId==站点id)===============(flatId==平板id)
215
- this.$androidUtil.setPreference('siteId', ret.data.f_extend1 || '')
216
- this.$androidUtil.setPreference('flatId', ret.data.f_extend2 || '')
217
- this.$androidUtil.setPreference('name', ret.data.name || '')
218
- this.$androidUtil.setPreference('ename', ret.data.ename || '')
219
- if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code !== 200) {
220
- throw {status: ret.data.code, message: ret.data.msg}
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
- } catch (e) {
223
- if (Vue.android) {
224
- this.loaderShow = false
225
- this.$showMessage(e.message ? e.message : '登录失败!用户名或密码错误!')
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 ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).data.startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
232
- Vue.user = Util.f = ret.data.data
233
- } else {
234
- Vue.user = Util.f = ret.data
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) {
@@ -1,5 +1,5 @@
1
1
  const REG_STRONG_PWD =
2
- /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*(),.?":{}|<>~`+=_\\-])[A-Za-z\d!@#$%^&*(),.?":{}|<>~`+=_\\-]{8,}$/;
2
+ /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])(?!.*(123|321|abc|cba))[a-zA-Z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]{8,16}$/;
3
3
 
4
4
  // 常见密码列表(可以根据需要扩展)
5
5
  const COMMON_PASSWORDS = [