system-phone 3.0.12 → 3.0.13

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.
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "system-phone",
3
- "version": "3.0.12",
3
+ "version": "3.0.13",
4
4
  "description": "手机模块 前端组件",
5
5
  "author": "何宁社 <524395609@qq.com>",
6
6
  "license": "ISC",
@@ -278,9 +278,39 @@ export default {
278
278
  }
279
279
  // 设置当前登录人信息
280
280
  if ((JSON.stringify(ret.data).startsWith("{") || JSON.stringify(ret.data).startsWith("[")) && ret.data.code && ret.data.msg && ret.data.code === 200) {
281
- Vue.$login = {jwt: ret.data.data.id}
281
+ Vue.prototype.$login = {jwt: ret.data.data.id,
282
+ toStandardDateString () {
283
+ let dt = new Date()
284
+ let month = dt.getMonth() + 1
285
+ let date = dt.getDate()
286
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
287
+ }, toStandardTimeString () {
288
+ let dt = new Date()
289
+ let month = dt.getMonth() + 1
290
+ let date = dt.getDate()
291
+ let hour = dt.getHours()
292
+ let min = dt.getMinutes()
293
+ let sec = dt.getSeconds()
294
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
295
+ + ' ' + (hour < 10 ? '0' + hour : hour)
296
+ }}
282
297
  } else {
283
- Vue.$login = {jwt: ret.data.id}
298
+ Vue.prototype.$login = {jwt: ret.data.id,
299
+ toStandardDateString () {
300
+ let dt = new Date()
301
+ let month = dt.getMonth() + 1
302
+ let date = dt.getDate()
303
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
304
+ }, toStandardTimeString () {
305
+ let dt = new Date()
306
+ let month = dt.getMonth() + 1
307
+ let date = dt.getDate()
308
+ let hour = dt.getHours()
309
+ let min = dt.getMinutes()
310
+ let sec = dt.getSeconds()
311
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
312
+ + ' ' + (hour < 10 ? '0' + hour : hour)
313
+ }}
284
314
  }
285
315
  // 获取参数
286
316
  console.log('获取参数system以及安检参数')
@@ -1,216 +1,216 @@
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?'需要包含大小写字母符号数字':'请输入新密码'"/>
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}/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
-
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
- if (this.weakPassword && this.model.password && !(/^(?:(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])).*$/.test(this.model.password))) {
162
- this.$showMessage('新密码必须包含大小写字母、数字、符号!')
163
- return
164
- }
165
- // 检验原始密码是否符合 并修改密码
166
- asyncCheck(this, this.$androidUtil.getProxyUrl())
167
- }
168
- }
169
- }
170
- </script>
171
- <style>
172
- .search_input {
173
- border: 0;
174
- outline: none;
175
- }
176
-
177
- .app-row {
178
- background-color: white;
179
- padding: 10px 10px 0 10px;
180
- border-bottom: 1px solid rgba(235, 235, 235, 0.5);
181
- }
182
-
183
- .font {
184
- font: 15px PingFang-SC-Medium;
185
- }
186
-
187
- .btn-font {
188
- font: 600 16px PingFang-SC-Bold;
189
- color: #499EDF;
190
- }
191
-
192
- .btn-color {
193
- background-color: #FFFFFF;
194
- border-radius: 10px;
195
- border: 1px solid #499EDF;
196
- }
197
-
198
- .input-font {
199
- font: 15px PingFang-SC-Medium;
200
- color: #333333;
201
- }
202
-
203
- .app-botton {
204
- position: fixed;
205
- background: #87b2dd;
206
- color: #FFF;
207
- padding: 8px;
208
- text-align: center;
209
- font-size: 1.2em;
210
- z-index: 10;
211
- opacity: 0.5;
212
- bottom: 50px;
213
- margin-top: -10px;
214
- height: 40px;
215
- }
216
- </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 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?'需要包含大小写字母符号数字':'请输入新密码'"/>
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}/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
+
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
+ if (this.weakPassword && this.model.password && !(/^(?:(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])).*$/.test(this.model.password))) {
162
+ this.$showMessage('新密码必须包含大小写字母、数字、符号!')
163
+ return
164
+ }
165
+ // 检验原始密码是否符合 并修改密码
166
+ asyncCheck(this, this.$androidUtil.getProxyUrl())
167
+ }
168
+ }
169
+ }
170
+ </script>
171
+ <style>
172
+ .search_input {
173
+ border: 0;
174
+ outline: none;
175
+ }
176
+
177
+ .app-row {
178
+ background-color: white;
179
+ padding: 10px 10px 0 10px;
180
+ border-bottom: 1px solid rgba(235, 235, 235, 0.5);
181
+ }
182
+
183
+ .font {
184
+ font: 15px PingFang-SC-Medium;
185
+ }
186
+
187
+ .btn-font {
188
+ font: 600 16px PingFang-SC-Bold;
189
+ color: #499EDF;
190
+ }
191
+
192
+ .btn-color {
193
+ background-color: #FFFFFF;
194
+ border-radius: 10px;
195
+ border: 1px solid #499EDF;
196
+ }
197
+
198
+ .input-font {
199
+ font: 15px PingFang-SC-Medium;
200
+ color: #333333;
201
+ }
202
+
203
+ .app-botton {
204
+ position: fixed;
205
+ background: #87b2dd;
206
+ color: #FFF;
207
+ padding: 8px;
208
+ text-align: center;
209
+ font-size: 1.2em;
210
+ z-index: 10;
211
+ opacity: 0.5;
212
+ bottom: 50px;
213
+ margin-top: -10px;
214
+ height: 40px;
215
+ }
216
+ </style>
File without changes