n20-common-lib 2.2.1 → 2.2.2

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.2.1",
3
+ "version": "2.2.2",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -43,7 +43,7 @@
43
43
  </el-input>
44
44
  不自动填充密码End -->
45
45
  </el-form-item>
46
- <el-form-item class="m-b" :label="'图形验证码' | $lc" prop="imageCode">
46
+ <el-form-item v-if="showImageCode" 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" />
@@ -186,6 +186,10 @@ export default {
186
186
  extraForm: {
187
187
  type: Object,
188
188
  default: () => ({})
189
+ },
190
+ showImageCode: {
191
+ type: Boolean,
192
+ default: false
189
193
  }
190
194
  },
191
195
  data() {
@@ -256,12 +260,18 @@ export default {
256
260
  }
257
261
  },
258
262
  getImgCode() {
259
- if (this.theType === 'account') {
263
+ if (this.theType === 'account' && this.showImageCode) {
260
264
  this.$set(this.form, 'imageCode', '')
261
265
  this.imageUrl && URL.revokeObjectURL(this.imageUrl)
262
- axios.get('/bems/prod_1.0/uas/api/authorization/captcha/image', null, { responseType: 'blob' }).then((blob) => {
263
- this.imageUrl = URL.createObjectURL(blob)
264
- })
266
+ axios
267
+ .get('/bems/prod_1.0/uas/api/authorization/captcha/image', null, {
268
+ responseType: 'blob',
269
+ loading: false,
270
+ noMsg: true
271
+ })
272
+ .then((blob) => {
273
+ this.imageUrl = URL.createObjectURL(blob)
274
+ })
265
275
  }
266
276
  },
267
277
  // 发送短信
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div v-if="alV" v-loading="alV" class="login-wrap">
2
+ <div v-if="alV" v-loading="alV" class="login-wrap" element-loading-custom-class="auto-login-loading">
3
3
  <loginForm
4
4
  ref="login-form"
5
+ class="login-form"
5
6
  :before-login="beforeLogin"
6
7
  :login-types="loginTypes"
7
8
  :login-then="loginThen"
8
9
  :async-rela-nos="asyncRelaNos"
9
- class="login-form"
10
10
  style="display: none"
11
11
  />
12
12
  </div>
@@ -20,11 +20,12 @@
20
20
  <div doc="登录页标语" v-html="loginSloganHtml"></div>
21
21
  <loginForm
22
22
  v-if="operateType === 'login'"
23
+ class="login-form"
23
24
  :before-login="beforeLogin"
24
25
  :login-types="loginTypes"
25
26
  :login-then="loginThen"
26
27
  :async-rela-nos="asyncRelaNos"
27
- class="login-form"
28
+ :show-image-code="showImageCode"
28
29
  @changType="getChangetype"
29
30
  >
30
31
  <div slot="header" class="login-form-header m-b text-c">{{ '欢 迎 登 录' | $lc }}</div>
@@ -84,6 +85,10 @@ export default {
84
85
  asyncRelaNos: {
85
86
  type: Boolean,
86
87
  default: false
88
+ },
89
+ showImageCode: {
90
+ type: Boolean,
91
+ default: false
87
92
  }
88
93
  },
89
94
  data() {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div style="width: 100vw; height: 100vh; overflow: hidden">
3
- <div v-if="alV" v-loading="alV" class="login-wrap">
3
+ <div v-if="alV" v-loading="alV" class="login-wrap" element-loading-custom-class="auto-login-loading">
4
4
  <loginForm
5
5
  ref="login-form"
6
6
  :before-login="beforeLogin"
@@ -87,6 +87,7 @@
87
87
  :login-then="loginThenT"
88
88
  :async-rela-nos="asyncRelaNos"
89
89
  :extra-form="extraForm"
90
+ :show-image-code="showImageCode"
90
91
  @changType="getChangetype"
91
92
  >
92
93
  <div slot="header" class="login-form-header m-b text-c">{{ '欢 迎 登 录' | $lc }}</div>
@@ -173,6 +174,10 @@ export default {
173
174
  asyncRelaNos: {
174
175
  type: Boolean,
175
176
  default: false
177
+ },
178
+ showImageCode: {
179
+ type: Boolean,
180
+ default: true
176
181
  }
177
182
  },
178
183
  data() {
@@ -531,8 +536,10 @@ export default {
531
536
  position: absolute;
532
537
  right: 103px;
533
538
  top: 50%;
534
- transform: translateY(-50%);
539
+ width: 324px;
540
+ min-height: 360px;
535
541
  padding: 30px 30px 18px !important;
542
+ transform: translateY(-50%);
536
543
  background: #f7f6f6;
537
544
  }
538
545
  .login-bg-light .login-form {
@@ -111,9 +111,9 @@ function errorFn(status, msg, noMsg, isErr, res) {
111
111
  } else if (status === 500 || (isErr && msg.includes('500'))) {
112
112
  noMsg || showMsg($lc('500,服务器链接失败!'))
113
113
  } else if (status === 'ECONNABORTED' && msg.includes('timeout')) {
114
- showMsg($lc('请求超时'))
114
+ noMsg || showMsg($lc('请求超时'))
115
115
  } else if (msg === 'Network Error') {
116
- showMsg($lc('请求错误'))
116
+ noMsg || showMsg($lc('请求错误'))
117
117
  } else if (status >= 900 || status === -1) {
118
118
  noMsg || showMsg(msg)
119
119
  } else {