system-phone 3.1.97 → 3.1.98

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.97",
3
+ "version": "3.1.98",
4
4
  "description": "手机模块 前端组件",
5
5
  "author": "何宁社 <524395609@qq.com>",
6
6
  "license": "ISC",
@@ -1,279 +1,280 @@
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>
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
+ this.weakPassword = this.$appdata.getSingleValue('手机端弱密码校验')
143
+
144
+ },
145
+ methods: {
146
+ back() {
147
+ let _this = this
148
+ this.$showMessage('所填写内容将不可恢复!', ['confirm', 'cancel']).then((res) => {
149
+ if (res === 'confirm') {
150
+ _this.$back()
151
+ }
152
+ })
153
+ },
154
+ // showpass(){
155
+ // console.log('1')
156
+ // document.getElementById("oldpassword").type = "text"
157
+ // },
158
+ showon() {
159
+ this.showpass = true
160
+ document.getElementById("oldpassword").type = "text"
161
+ document.getElementById("newpassword1").type = "text"
162
+ document.getElementById("newpassword2").type = "text"
163
+ },
164
+ showoff() {
165
+ this.showpass = false
166
+ document.getElementById("oldpassword").type = "password"
167
+ document.getElementById("newpassword1").type = "password"
168
+ document.getElementById("newpassword2").type = "password"
169
+ },
170
+ save() {
171
+ // 先对新密码和确认密码是否一致
172
+ if (this.model.password != this.model.newpassword) {
173
+ this.$showMessage('两次输入密码不一致!')
174
+ return
175
+ }
176
+ // 弱口令验证
177
+ if (this.weakPassword) {
178
+ const pwdResult = validateStrongPasswordPhone(this.model.password)
179
+ if (!pwdResult.isValid) {
180
+ this.$showMessage('密码过于简单,' + (pwdResult.errors[0] || '请按照要求修改密码!!!'))
181
+ return
182
+ }
183
+ }
184
+ // 检验原始密码是否符合 并修改密码
185
+ asyncCheck(this, this.$androidUtil.getProxyUrl())
186
+ }
187
+ }
188
+ }
189
+ </script>
190
+ <style>
191
+ .search_input {
192
+ border: 0;
193
+ outline: none;
194
+ }
195
+
196
+ .app-row {
197
+ background-color: white;
198
+ padding: 10px 10px 0 10px;
199
+ border-bottom: 1px solid rgba(235, 235, 235, 0.5);
200
+ }
201
+
202
+ .font {
203
+ font: 15px PingFang-SC-Medium;
204
+ }
205
+
206
+ .btn-font {
207
+ font: 600 16px PingFang-SC-Bold;
208
+ color: #499EDF;
209
+ }
210
+
211
+ .btn-color {
212
+ background-color: #FFFFFF;
213
+ border-radius: 10px;
214
+ border: 1px solid #499EDF;
215
+ }
216
+
217
+ .input-font {
218
+ font: 15px PingFang-SC-Medium;
219
+ color: #333333;
220
+ }
221
+
222
+ .password-alert {
223
+ margin: 10px 10px 0;
224
+ padding: 10px 12px;
225
+ border-radius: 6px;
226
+ background: #f5f7fa;
227
+ border: 1px solid #e4e7ed;
228
+ color: #606266;
229
+ font-size: 13px;
230
+ line-height: 1.6;
231
+ }
232
+
233
+ .password-strength {
234
+ margin-top: 8px;
235
+ font-size: 12px;
236
+ line-height: 1.6;
237
+ color: #606266;
238
+ }
239
+
240
+ .password-strength .strength-label {
241
+ margin-right: 6px;
242
+ color: #909399;
243
+ }
244
+
245
+ .password-strength .strength-tag {
246
+ display: inline-block;
247
+ margin-right: 8px;
248
+ padding: 1px 8px;
249
+ border-radius: 3px;
250
+ font-size: 12px;
251
+ }
252
+
253
+ .password-strength .strength-tag.success {
254
+ color: #2e7d32;
255
+ background: #e8f5e9;
256
+ }
257
+
258
+ .password-strength .strength-tag.error {
259
+ color: #c62828;
260
+ background: #ffebee;
261
+ }
262
+
263
+ .password-strength .strength-desc {
264
+ color: #606266;
265
+ }
266
+
267
+ .app-botton {
268
+ position: fixed;
269
+ background: #87b2dd;
270
+ color: #FFF;
271
+ padding: 8px;
272
+ text-align: center;
273
+ font-size: 1.2em;
274
+ z-index: 10;
275
+ opacity: 0.5;
276
+ bottom: 50px;
277
+ margin-top: -10px;
278
+ height: 40px;
279
+ }
280
+ </style>