n20-common-lib 2.1.1 → 2.1.3

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": "n20-common-lib",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -523,7 +523,9 @@ export default {
523
523
  getUserImg() {
524
524
  return this.$axios
525
525
  .get(`/bems/1.0/attach/${this.userNo}_img`, null, {
526
- responseType: 'blob'
526
+ responseType: 'blob',
527
+ loading: false,
528
+ noMsg: true
527
529
  })
528
530
  .then((login) => {
529
531
  this.headerUserUrl = window.URL.createObjectURL(login)
@@ -229,8 +229,7 @@ export default {
229
229
  { label: $lc('账户密码登录'), value: 'account' },
230
230
  { label: $lc('手机验证码登录'), value: 'pthon' },
231
231
  { label: $lc('二维码扫码登录'), value: 'qrcode' },
232
- { label: $lc('账户密码验证码登录'), value: 'accountPthon' },
233
- { label: $lc('账号密码图形验证码登录'), value: 'accountImage' }
232
+ { label: $lc('账户密码验证码登录'), value: 'accountPthon' }
234
233
  ],
235
234
  systemItem: undefined
236
235
  }
@@ -8,7 +8,7 @@
8
8
  <path d="M0,0L52,0L52,52Z" @click="cutQrcode" />
9
9
  </svg>
10
10
  <!-- 账号/密码登录 -->
11
- <div v-if="theType === 'account' || theType === 'accountImage'" class="flex-item">
11
+ <div v-if="theType === 'account'" class="flex-item">
12
12
  <el-form
13
13
  ref="login-form"
14
14
  :model="form"
@@ -43,12 +43,12 @@
43
43
  </el-input>
44
44
  不自动填充密码End -->
45
45
  </el-form-item>
46
- <el-form-item v-if="theType === 'accountImage'" class="m-b" :label="'图形验证码' | $lc" prop="imageCode">
46
+ <el-form-item class="m-b" :label="'图形验证码' | $lc" prop="imageCode">
47
47
  <br />
48
48
  <div class="flex-box">
49
49
  <el-input v-model="form.imageCode" class="flex-item m-r-s" :placeholder="'请输入图形验证码' | $lc" />
50
50
  <el-button plain class="p-a-0" @click="getImgCode">
51
- <img v-if="imageUrl" :src="imageUrl" style="width: 80px; height: 28px" />
51
+ <img v-if="imageUrl" :src="imageUrl" style="width: 80px; height: 30px; margin-bottom: -2px" />
52
52
  </el-button>
53
53
  </div>
54
54
  </el-form-item>
@@ -192,8 +192,7 @@ export default {
192
192
  account: $lc('账号密码登录'),
193
193
  pthon: $lc('手机验证码登录'),
194
194
  qrcode: $lc('二维码扫码登录'),
195
- accountPthon: $lc('账户密码验证码登录'),
196
- accountImage: $lc('账号密码图形验证码登录')
195
+ accountPthon: $lc('账户密码验证码登录')
197
196
  },
198
197
  theType: this.loginTypes[0],
199
198
  userNo: undefined,
@@ -225,12 +224,15 @@ export default {
225
224
  watch: {
226
225
  loginTypes() {
227
226
  this.theType = this.loginTypes[0]
228
- this.getImgCode()
227
+ },
228
+ theType: {
229
+ handler() {
230
+ this.getImgCode()
231
+ },
232
+ immediate: true
229
233
  }
230
234
  },
231
- mounted() {
232
- this.getImgCode()
233
- },
235
+ mounted() {},
234
236
  methods: {
235
237
  // 忘记密码
236
238
  forgetPw() {
@@ -249,9 +251,11 @@ export default {
249
251
  }
250
252
  },
251
253
  getImgCode() {
252
- if (this.theType === 'accountImage') {
253
- // axios.get('/bems/prod_1.0/uas/api/authorization/captcha/image', null, { responseType: 'blob' })
254
- this.imageUrl = require('./imgcode.png')
254
+ if (this.theType === 'account') {
255
+ this.imageUrl && URL.revokeObjectURL(this.imageUrl)
256
+ axios.get('/bems/prod_1.0/uas/api/authorization/captcha/image', null, { responseType: 'blob' }).then((blob) => {
257
+ this.imageUrl = URL.createObjectURL(blob)
258
+ })
255
259
  }
256
260
  },
257
261
  // 发送短信
@@ -316,13 +320,11 @@ export default {
316
320
  this.theType === 'account' && this.passwordLogin()
317
321
  this.theType === 'pthon' && this.phoneLogin()
318
322
  this.theType === 'accountPthon' && this.accountPthonLogin()
319
- this.theType === 'accountImage' && this.passwordLogin()
320
323
  })
321
324
  } else {
322
325
  this.theType === 'account' && this.passwordLogin()
323
326
  this.theType === 'pthon' && this.phoneLogin()
324
327
  this.theType === 'accountPthon' && this.accountPthonLogin()
325
- this.theType === 'accountImage' && this.passwordLogin()
326
328
  }
327
329
  })
328
330
  },
@@ -373,7 +375,7 @@ export default {
373
375
  username,
374
376
  password: this.pwd,
375
377
  code,
376
- imageCode: this.theType === 'accountImage' ? imageCode : undefined
378
+ imageCode: imageCode || undefined
377
379
  },
378
380
  {
379
381
  loading: this.loadingSub
@@ -436,7 +438,7 @@ export default {
436
438
  code,
437
439
  sign,
438
440
  certDn,
439
- imageCode: this.theType === 'accountImage' ? imageCode : undefined
441
+ imageCode: imageCode || undefined
440
442
  },
441
443
  {
442
444
  loading: this.loadingSub
@@ -460,7 +462,7 @@ export default {
460
462
  username,
461
463
  password: this.pwd,
462
464
  code,
463
- imageCode: this.theType === 'accountImage' ? imageCode : undefined
465
+ imageCode: imageCode || undefined
464
466
  },
465
467
  { loading: this.loadingSub }
466
468
  )
@@ -111,7 +111,15 @@ export default {
111
111
  },
112
112
  computed: {
113
113
  loginTypes() {
114
- return this.pageData.LOGIN_MODE?.pmValue?.split(',') || this.jsonData.loginTypes || ['account']
114
+ let LOGIN_MODE = this.pageData.LOGIN_MODE?.pmValue
115
+ if (LOGIN_MODE) {
116
+ try {
117
+ LOGIN_MODE = JSON.parse(LOGIN_MODE)
118
+ } catch (error) {
119
+ LOGIN_MODE = LOGIN_MODE.split(',')
120
+ }
121
+ }
122
+ return LOGIN_MODE || this.jsonData.loginTypes || ['account']
115
123
  },
116
124
  loginBg() {
117
125
  if (this.pageData.BgImage) {