system-phone 3.1.93 → 3.1.95

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.93",
3
+ "version": "3.1.95",
4
4
  "description": "手机模块 前端组件",
5
5
  "author": "何宁社 <524395609@qq.com>",
6
6
  "license": "ISC",
@@ -106,6 +106,7 @@
106
106
  import Vue from 'vue'
107
107
  import * as Util from '../Util'
108
108
  import cryptJS from './EncryptUtil'
109
+ import { validateStrongPasswordPhone } from '../plugins/validateStrongPasswordPhone.js'
109
110
  //获取json配置文件
110
111
  let asyncReady = async function (self, url) {
111
112
  // 获取配置信息
@@ -481,10 +482,13 @@ export default {
481
482
  console.log('获取参数结束')
482
483
  this.loaderShow = false
483
484
  // 弱口令验证
484
- if (this.weakPassword && !(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])(?!.*(123|321|abc|cba))[a-zA-Z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]{8,16}$/.test(this.password))) {
485
- await this.$showMessage('登录系统: 此账户的密码过于简单,请修改密码后重新登陆!!!', ['confirm'])
486
- this.modifyPassword = true
487
- return
485
+ if (this.weakPassword) {
486
+ const pwdResult = validateStrongPasswordPhone(this.password)
487
+ if (!pwdResult.isValid) {
488
+ await this.$showMessage('登录系统: 此账户的密码过于简单,' + (pwdResult.errors[0] || '请修改密码后重新登陆!!!'), ['confirm'])
489
+ this.modifyPassword = true
490
+ return
491
+ }
488
492
  }
489
493
  this.$goto('nav-bottom')
490
494
  },
@@ -1,220 +1,279 @@
1
- <template>
2
- <!--<div class="app-botton" @click="back()">-->
3
- <!--<span class="glyphicon glyphicon-menu-left">返回</span>-->
4
- <!--</div>-->
5
- <div class="auto">
6
- <div class="row app-row">
7
- <div class="col-xs-4">
8
- <img src="../assets/姓名.png" style="width: 20px;margin-bottom: 5px" alt="">
9
- <span class="text-left font">账号</span>
10
- </div>
11
- <div class="col-xs-8 input-font">
12
- <input type="text" class="search_input input-font" v-model="model.ename" readonly/>
13
- </div>
14
- </div>
15
- <div class="row app-row">
16
- <div class="col-xs-4" style="margin-top: 8px">
17
- <img src="../assets/原始密码.png" style="width: 20px;margin-bottom: 5px" alt="">
18
- <span class="text-left font">原始密码</span>
19
- </div>
20
- <div class="col-xs-8">
21
- <input type="password" id="oldpassword" class="search_input input-font" v-model="model.oldpassword"
22
- placeholder="请输入原始密码"/>
23
- </div>
24
- </div>
25
- <div class="row app-row">
26
- <div class="col-xs-4" style="margin-top: 8px">
27
- <img src="../assets/密码.png" style="width: 20px;margin-bottom: 5px">
28
- <span class="text-left font">新密码</span>
29
- </div>
30
- <div class="col-xs-8">
31
- <input type="password" id="newpassword1" class="search_input input-font" v-model="model.password"
32
- :placeholder="weakPassword?'需要包含大小写字母符号数字的12-18位密码':'请输入新密码'"/>
33
- </div>
34
- </div>
35
- <div class="row app-row">
36
- <div class="col-xs-4" style="margin-top: 8px">
37
- <img src="../assets/密码.png" style="width: 20px;margin-bottom: 5px" alt="">
38
- <span class="text-left font">确认密码</span>
39
- </div>
40
- <div class="col-xs-8">
41
- <input type="password" id="newpassword2" class="search_input input-font" v-model="model.newpassword"
42
- placeholder="请重新输入新密码"/>
43
- </div>
44
- </div>
45
- <div class="row app-row">
46
- <div class="col-xs-4" style="margin-top: 8px">
47
- <img src="../assets/选中.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="showpass" @click="showoff()">
48
- <img src="../assets/未选.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="!showpass" @click="showon()">
49
- <span class="text-left font">显示密码</span>
50
- </div>
51
- </div>
52
- <div class="row app-row text-center">
53
- <button type="button" class="btn btn-lg btn-font btn-color" style="width: 45%;" @click="save()">提交</button>
54
- </div>
55
- </div>
56
- </template>
57
- <script>
58
- import Vue from 'vue'
59
-
60
- let asyncCheck = async function (self, url) {
61
- try {
62
- let that = self
63
- let user = {
64
- ename: that.model.ename,
65
- newpassword: that.model.password,
66
- affirmpassword: that.model.newpassword,
67
- password: that.model.oldpassword
68
- }
69
- let res = await Vue.resetpost(`${url}/${Vue.isv4 ?'api/af-system':'rs'}/user/modifypwd`, {data: user}, {resolveMsg: null, rejectMsg: null})
70
- console.log("手机端验证登陆原始密码")
71
- console.log(res.data)
72
- if ((JSON.stringify(res.data).startsWith("{") || JSON.stringify(res.data).startsWith("[")) && res.data.code && res.data.msg) {
73
- if (res.data.code === 200) {
74
- that.$showMessage('修改密码成功!')
75
- if (that.sourse == 'login') {
76
- that.$emit('success', that.model.password)
77
- return
78
- }
79
- that.$back()
80
- } else {
81
- that.$showMessage('修改密码失败,请重新输入!' + res.data.msg)
82
- console.log(res.data)
83
- return
84
- }
85
- } else {
86
- if(res.data){
87
- that.$showMessage('修改密码成功!')
88
- if(that.sourse == 'login'){
89
- that.$emit('success',that.model.password)
90
- return
91
- }
92
- that.$back()
93
- }else {
94
- that.$showMessage('修改密码失败,请重新输入!')
95
- console.log(res.data)
96
- return
97
- }
98
- }
99
- } catch (error) {
100
- if (error.status == 500) {
101
- that.$showMessage('网络异常,请检查手机网络!')
102
- } else {
103
- throw error
104
- }
105
- }
106
- }
107
- import { validateStrongPasswordPhone } from '../plugins/validateStrongPasswordPhone.js'
108
- export default {
109
- title: '修改密码',
110
- data() {
111
- return {
112
- model: {
113
- user: Vue.user.name,
114
- userid: Vue.user.id,
115
- ename: Vue.user.ename,
116
- oldpassword: '',
117
- password: '',
118
- newpassword: ''
119
- },
120
- showpass: false
121
- }
122
- },
123
- props: {
124
- sourse: '',
125
- weakPassword: false
126
- },
127
- ready() {
128
-
129
- },
130
- methods: {
131
- back() {
132
- let _this = this
133
- this.$showMessage('所填写内容将不可恢复!', ['confirm', 'cancel']).then((res) => {
134
- if (res === 'confirm') {
135
- _this.$back()
136
- }
137
- })
138
- },
139
- // showpass(){
140
- // console.log('1')
141
- // document.getElementById("oldpassword").type = "text"
142
- // },
143
- showon() {
144
- this.showpass = true
145
- document.getElementById("oldpassword").type = "text"
146
- document.getElementById("newpassword1").type = "text"
147
- document.getElementById("newpassword2").type = "text"
148
- },
149
- showoff() {
150
- this.showpass = false
151
- document.getElementById("oldpassword").type = "password"
152
- document.getElementById("newpassword1").type = "password"
153
- document.getElementById("newpassword2").type = "password"
154
- },
155
- save() {
156
- // 先对新密码和确认密码是否一致
157
- if (this.model.password != this.model.newpassword) {
158
- this.$showMessage('两次输入密码不一致!')
159
- return
160
- }
161
- // 弱口令验证
162
- if (this.weakPassword) {
163
- const pwdResult = validateStrongPasswordPhone(this.model.password)
164
- if (!pwdResult.isValid) {
165
- this.$showMessage('密码过于简单,' + (pwdResult.errors[0] || '请按照要求修改密码!!!'))
166
- return
167
- }
168
- }
169
- // 检验原始密码是否符合 并修改密码
170
- asyncCheck(this, this.$androidUtil.getProxyUrl())
171
- }
172
- }
173
- }
174
- </script>
175
- <style>
176
- .search_input {
177
- border: 0;
178
- outline: none;
179
- }
180
-
181
- .app-row {
182
- background-color: white;
183
- padding: 10px 10px 0 10px;
184
- border-bottom: 1px solid rgba(235, 235, 235, 0.5);
185
- }
186
-
187
- .font {
188
- font: 15px PingFang-SC-Medium;
189
- }
190
-
191
- .btn-font {
192
- font: 600 16px PingFang-SC-Bold;
193
- color: #499EDF;
194
- }
195
-
196
- .btn-color {
197
- background-color: #FFFFFF;
198
- border-radius: 10px;
199
- border: 1px solid #499EDF;
200
- }
201
-
202
- .input-font {
203
- font: 15px PingFang-SC-Medium;
204
- color: #333333;
205
- }
206
-
207
- .app-botton {
208
- position: fixed;
209
- background: #87b2dd;
210
- color: #FFF;
211
- padding: 8px;
212
- text-align: center;
213
- font-size: 1.2em;
214
- z-index: 10;
215
- opacity: 0.5;
216
- bottom: 50px;
217
- margin-top: -10px;
218
- height: 40px;
219
- }
220
- </style>
1
+ <template>
2
+ <!--<div class="app-botton" @click="back()">-->
3
+ <!--<span class="glyphicon glyphicon-menu-left">返回</span>-->
4
+ <!--</div>-->
5
+ <div class="auto">
6
+ <div v-if="weakPassword" class="password-alert">
7
+ {{ passwordRuleHint }}
8
+ </div>
9
+ <div class="row app-row">
10
+ <div class="col-xs-4">
11
+ <img src="../assets/姓名.png" style="width: 20px;margin-bottom: 5px" alt="">
12
+ <span class="text-left font">账号</span>
13
+ </div>
14
+ <div class="col-xs-8 input-font">
15
+ <input type="text" class="search_input input-font" v-model="model.ename" readonly/>
16
+ </div>
17
+ </div>
18
+ <div class="row app-row">
19
+ <div class="col-xs-4" style="margin-top: 8px">
20
+ <img src="../assets/原始密码.png" style="width: 20px;margin-bottom: 5px" alt="">
21
+ <span class="text-left font">原始密码</span>
22
+ </div>
23
+ <div class="col-xs-8">
24
+ <input type="password" id="oldpassword" class="search_input input-font" v-model="model.oldpassword"
25
+ placeholder="请输入原始密码"/>
26
+ </div>
27
+ </div>
28
+ <div class="row app-row">
29
+ <div class="col-xs-4" style="margin-top: 8px">
30
+ <img src="../assets/密码.png" style="width: 20px;margin-bottom: 5px">
31
+ <span class="text-left font">新密码</span>
32
+ </div>
33
+ <div class="col-xs-8">
34
+ <input type="password" id="newpassword1" class="search_input input-font" v-model="model.password"
35
+ placeholder="请输入新密码"/>
36
+ <div v-if="weakPassword && passwordStrength.visible" class="password-strength">
37
+ <span class="strength-label">密码强度</span>
38
+ <span class="strength-tag" :class="passwordStrength.type">{{ passwordStrength.label }}</span>
39
+ <span class="strength-desc">{{ passwordStrength.desc }}</span>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <div class="row app-row">
44
+ <div class="col-xs-4" style="margin-top: 8px">
45
+ <img src="../assets/密码.png" style="width: 20px;margin-bottom: 5px" alt="">
46
+ <span class="text-left font">确认密码</span>
47
+ </div>
48
+ <div class="col-xs-8">
49
+ <input type="password" id="newpassword2" class="search_input input-font" v-model="model.newpassword"
50
+ placeholder="请重新输入新密码"/>
51
+ </div>
52
+ </div>
53
+ <div class="row app-row">
54
+ <div class="col-xs-4" style="margin-top: 8px">
55
+ <img src="../assets/选中.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="showpass" @click="showoff()">
56
+ <img src="../assets/未选.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="!showpass" @click="showon()">
57
+ <span class="text-left font">显示密码</span>
58
+ </div>
59
+ </div>
60
+ <div class="row app-row text-center">
61
+ <button type="button" class="btn btn-lg btn-font btn-color" style="width: 45%;" @click="save()">提交</button>
62
+ </div>
63
+ </div>
64
+ </template>
65
+ <script>
66
+ import Vue from 'vue'
67
+
68
+ let asyncCheck = async function (self, url) {
69
+ try {
70
+ let that = self
71
+ let user = {
72
+ ename: that.model.ename,
73
+ newpassword: that.model.password,
74
+ affirmpassword: that.model.newpassword,
75
+ password: that.model.oldpassword
76
+ }
77
+ let res = await Vue.resetpost(`${url}/${Vue.isv4 ?'api/af-system':'rs'}/user/modifypwd`, {data: user}, {resolveMsg: null, rejectMsg: null})
78
+ console.log("手机端验证登陆原始密码")
79
+ console.log(res.data)
80
+ if ((JSON.stringify(res.data).startsWith("{") || JSON.stringify(res.data).startsWith("[")) && res.data.code && res.data.msg) {
81
+ if (res.data.code === 200) {
82
+ that.$showMessage('修改密码成功!')
83
+ if (that.sourse == 'login') {
84
+ that.$emit('success', that.model.password)
85
+ return
86
+ }
87
+ that.$back()
88
+ } else {
89
+ that.$showMessage('修改密码失败,请重新输入!' + res.data.msg)
90
+ console.log(res.data)
91
+ return
92
+ }
93
+ } else {
94
+ if(res.data){
95
+ that.$showMessage('修改密码成功!')
96
+ if(that.sourse == 'login'){
97
+ that.$emit('success',that.model.password)
98
+ return
99
+ }
100
+ that.$back()
101
+ }else {
102
+ that.$showMessage('修改密码失败,请重新输入!')
103
+ console.log(res.data)
104
+ return
105
+ }
106
+ }
107
+ } catch (error) {
108
+ if (error.status == 500) {
109
+ that.$showMessage('网络异常,请检查手机网络!')
110
+ } else {
111
+ throw error
112
+ }
113
+ }
114
+ }
115
+ import { validateStrongPasswordPhone, getPasswordStrength, PASSWORD_RULE_HINT } from '../plugins/validateStrongPasswordPhone.js'
116
+ export default {
117
+ title: '修改密码',
118
+ data() {
119
+ return {
120
+ model: {
121
+ user: Vue.user.name,
122
+ userid: Vue.user.id,
123
+ ename: Vue.user.ename,
124
+ oldpassword: '',
125
+ password: '',
126
+ newpassword: ''
127
+ },
128
+ showpass: false,
129
+ passwordRuleHint: PASSWORD_RULE_HINT
130
+ }
131
+ },
132
+ computed: {
133
+ passwordStrength () {
134
+ return getPasswordStrength(this.model.password)
135
+ }
136
+ },
137
+ props: {
138
+ sourse: '',
139
+ weakPassword: false
140
+ },
141
+ ready() {
142
+
143
+ },
144
+ methods: {
145
+ back() {
146
+ let _this = this
147
+ this.$showMessage('所填写内容将不可恢复!', ['confirm', 'cancel']).then((res) => {
148
+ if (res === 'confirm') {
149
+ _this.$back()
150
+ }
151
+ })
152
+ },
153
+ // showpass(){
154
+ // console.log('1')
155
+ // document.getElementById("oldpassword").type = "text"
156
+ // },
157
+ showon() {
158
+ this.showpass = true
159
+ document.getElementById("oldpassword").type = "text"
160
+ document.getElementById("newpassword1").type = "text"
161
+ document.getElementById("newpassword2").type = "text"
162
+ },
163
+ showoff() {
164
+ this.showpass = false
165
+ document.getElementById("oldpassword").type = "password"
166
+ document.getElementById("newpassword1").type = "password"
167
+ document.getElementById("newpassword2").type = "password"
168
+ },
169
+ save() {
170
+ // 先对新密码和确认密码是否一致
171
+ if (this.model.password != this.model.newpassword) {
172
+ this.$showMessage('两次输入密码不一致!')
173
+ return
174
+ }
175
+ // 弱口令验证
176
+ if (this.weakPassword) {
177
+ const pwdResult = validateStrongPasswordPhone(this.model.password)
178
+ if (!pwdResult.isValid) {
179
+ this.$showMessage('密码过于简单,' + (pwdResult.errors[0] || '请按照要求修改密码!!!'))
180
+ return
181
+ }
182
+ }
183
+ // 检验原始密码是否符合 并修改密码
184
+ asyncCheck(this, this.$androidUtil.getProxyUrl())
185
+ }
186
+ }
187
+ }
188
+ </script>
189
+ <style>
190
+ .search_input {
191
+ border: 0;
192
+ outline: none;
193
+ }
194
+
195
+ .app-row {
196
+ background-color: white;
197
+ padding: 10px 10px 0 10px;
198
+ border-bottom: 1px solid rgba(235, 235, 235, 0.5);
199
+ }
200
+
201
+ .font {
202
+ font: 15px PingFang-SC-Medium;
203
+ }
204
+
205
+ .btn-font {
206
+ font: 600 16px PingFang-SC-Bold;
207
+ color: #499EDF;
208
+ }
209
+
210
+ .btn-color {
211
+ background-color: #FFFFFF;
212
+ border-radius: 10px;
213
+ border: 1px solid #499EDF;
214
+ }
215
+
216
+ .input-font {
217
+ font: 15px PingFang-SC-Medium;
218
+ color: #333333;
219
+ }
220
+
221
+ .password-alert {
222
+ margin: 10px 10px 0;
223
+ padding: 10px 12px;
224
+ border-radius: 6px;
225
+ background: #f5f7fa;
226
+ border: 1px solid #e4e7ed;
227
+ color: #606266;
228
+ font-size: 13px;
229
+ line-height: 1.6;
230
+ }
231
+
232
+ .password-strength {
233
+ margin-top: 8px;
234
+ font-size: 12px;
235
+ line-height: 1.6;
236
+ color: #606266;
237
+ }
238
+
239
+ .password-strength .strength-label {
240
+ margin-right: 6px;
241
+ color: #909399;
242
+ }
243
+
244
+ .password-strength .strength-tag {
245
+ display: inline-block;
246
+ margin-right: 8px;
247
+ padding: 1px 8px;
248
+ border-radius: 3px;
249
+ font-size: 12px;
250
+ }
251
+
252
+ .password-strength .strength-tag.success {
253
+ color: #2e7d32;
254
+ background: #e8f5e9;
255
+ }
256
+
257
+ .password-strength .strength-tag.error {
258
+ color: #c62828;
259
+ background: #ffebee;
260
+ }
261
+
262
+ .password-strength .strength-desc {
263
+ color: #606266;
264
+ }
265
+
266
+ .app-botton {
267
+ position: fixed;
268
+ background: #87b2dd;
269
+ color: #FFF;
270
+ padding: 8px;
271
+ text-align: center;
272
+ font-size: 1.2em;
273
+ z-index: 10;
274
+ opacity: 0.5;
275
+ bottom: 50px;
276
+ margin-top: -10px;
277
+ height: 40px;
278
+ }
279
+ </style>