liuzhihui лет назад: 2
Родитель
Сommit
125355e342

+ 4 - 2
CallCenterWeb.UI/RMYY/src/store/modules/user.js

@@ -84,8 +84,10 @@ const user = {
84 84
       return new Promise((resolve, reject) => {
85 85
         login(username, password, loginway)
86 86
           .then(response => {
87
-            setToken(response.data)
88
-            commit('SET_TOKEN', response.data)
87
+            setToken(response.data.token)
88
+            commit('SET_TOKEN', response.data.token)
89
+            window.localStorage.setItem('changePwdFlag', response.data.changePwdFlag)
90
+            window.localStorage.setItem('storageUsercode', response.data.usercode)
89 91
             resolve()
90 92
           })
91 93
           .catch(error => {

+ 1 - 1
CallCenterWeb.UI/RMYY/src/views/dashboard/index.vue

@@ -157,7 +157,7 @@
157 157
     created() {
158 158
       this.getAllowDept()
159 159
       this.updatePass()
160
-      this.isLongPass()
160
+      // this.isLongPass()
161 161
     },
162 162
     mounted() {
163 163
       if (window.localStorage.getItem('roleCode') === 'DDZX' || window.localStorage.getItem('roleCode') === 'DDBZ') {

+ 3 - 0
CallCenterWeb.UI/RMYY/src/views/layout/components/Navbar/permsgEdit.vue

@@ -122,6 +122,9 @@ export default {
122 122
 	      if (this.form.confirmpas !== '') {
123 123
 	        this.$refs.ruleForm.validateField('confirmpas')
124 124
 	      }
125
+        if(this.form.newpas == this.form.oldpas){
126
+          callback(new Error('新密码不能和原密码相同!'))
127
+        }
125 128
 	      callback()
126 129
 	    }
127 130
 	  }

+ 121 - 10
CallCenterWeb.UI/RMYY/src/views/login/index.vue

@@ -51,6 +51,20 @@
51 51
         <!-- 综合保障服务中心 &copy; -->
52 52
       </p>
53 53
     </div>
54
+    <el-dialog title="修改密码" width="40%" :visible.sync="dialogTableVisible" :modal-append-to-body="false" :show-close="false">
55
+      <el-form ref="ruleForm" :model="form" :rules="rules" label-width="100px">
56
+        <el-form-item label="" prop="oldpas">
57
+          <span style="color: #ff0000; ">*</span>原密码:<el-input v-model="form.oldpas" show-password type="password" autocomplete="off" placeholder="请输入原密码"/>
58
+        </el-form-item>
59
+        <el-form-item label="" prop="newpas">
60
+          <span style="color: #ff0000; ">*</span>新密码:<el-input v-model="form.newpas" show-password type="password" autocomplete="off" placeholder="请输入新密码"/>
61
+        </el-form-item>
62
+        <el-form-item label="" prop="confirmpas">
63
+          <span style="color: #ff0000; ">*</span>确认密码:<el-input v-model="form.confirmpas" show-password type="password" autocomplete="off" placeholder="请输入确认密码"/>
64
+        </el-form-item>
65
+        <el-button type="primary" style="margin-left: 45%;" @click="onsub()">确 定</el-button>
66
+      </el-form>
67
+    </el-dialog>
54 68
   </div>
55 69
 </template>
56 70
 
@@ -60,23 +74,27 @@
60 74
   } from "@/utils/dd";
61 75
   import md5 from "js-md5";
62 76
   import SvgIcon from "@/components/common/SvgIcon"; // svg组件
63
-
77
+  import permsgEdit from "../layout/components/Navbar/permsgEdit.vue";
78
+  import { getResetPwd } from '@/api/layout/permsgEdit'
64 79
   import {
65 80
     validUsername,
66 81
     validPassword,
67
-    validExtension
82
+    validExtension,
83
+    strongvalidPassword
68 84
   } from "@/utils/validate";
69 85
   import {
70 86
     getAllowUserDept
71 87
   } from "@/api/login"
72 88
   const sm2 = require('sm-crypto').sm2
73
-  const cipherMode = 0  // 1 - C1C3C2,0 - C1C2C3,默认为1
74
-  const publicKey = "042DBA45E7B03394F603CADAFCDDEC854D3E01A4E9C52CD799B85B1A14BDB970137AE58BA553D79F058604DC1CD4B77DE5408BA3308E767584100C2B663510C819"
89
+  const cipherMode = 0 // 1 - C1C3C2,0 - C1C2C3,默认为1
90
+  const publicKey =
91
+    "042DBA45E7B03394F603CADAFCDDEC854D3E01A4E9C52CD799B85B1A14BDB970137AE58BA553D79F058604DC1CD4B77DE5408BA3308E767584100C2B663510C819"
75 92
   const privateKey = "BF1F907B4E0487F798DC80AFD7BC2A6201E8514233002272EA3BE2FC6F797843"
76 93
   export default {
77 94
     name: "Login",
78 95
     components: {
79 96
       SvgIcon,
97
+      permsgEdit
80 98
     },
81 99
     data() {
82 100
       const validateUser = (rule, value, callback) => {
@@ -95,7 +113,59 @@
95 113
           callback();
96 114
         }
97 115
       };
116
+      const validatePass1 = (rule, value, callback) => {
117
+        if (!strongvalidPassword(value)) {
118
+          callback(
119
+            new Error('请输入有效的密码(8-20个字符必须包含字母大小写和数字)!')
120
+          )
121
+        } else {
122
+          if (this.form.confirmpas !== '') {
123
+            this.$refs.ruleForm.validateField('confirmpas')
124
+          }
125
+          if(this.form.newpas == this.form.oldpas){
126
+            callback(new Error('新密码不能和原密码相同!'))
127
+          }
128
+          callback()
129
+        }
130
+      }
131
+      const validatePass2 = (rule, value, callback) => {
132
+        if (!strongvalidPassword(this.form.confirmpas)) {
133
+          callback(
134
+            new Error(
135
+              '请输入有效的密码(8-20个字符必须包含字母大小写和数字)!'
136
+            )
137
+          )
138
+        } else {
139
+          if (this.form.confirmpas !== this.form.newpas) {
140
+            callback(new Error('两次输入密码不一致!'))
141
+          }
142
+          callback()
143
+        }
144
+      }
98 145
       return {
146
+        rules: {
147
+          oldpas: [{
148
+            required: true,
149
+            trigger: 'blur',
150
+            message: '请输入原密码'
151
+          }],
152
+          newpas: [{
153
+            required: true,
154
+            trigger: 'blur',
155
+            validator: validatePass1
156
+          }],
157
+          confirmpas: [{
158
+            required: true,
159
+            trigger: 'blur',
160
+            validator: validatePass2
161
+          }]
162
+        },
163
+        form: {
164
+          oldpas: '',
165
+          newpas: '',
166
+          confirmpas: '',
167
+        },
168
+        ruleForm: {},
99 169
         isAllow: "",
100 170
         userRole: "0",
101 171
         isShow: true,
@@ -129,6 +199,7 @@
129 199
         },
130 200
         loading: false,
131 201
         pwdType: "password",
202
+        dialogTableVisible: false
132 203
       };
133 204
     },
134 205
     created() {
@@ -141,6 +212,9 @@
141 212
       ) {
142 213
         this.handleOAlogin();
143 214
       }
215
+      // if (window.localStorage.getItem('changePwdFlag') == 1) {
216
+      //   this.isLongPass()
217
+      // }
144 218
     },
145 219
     methods: {
146 220
       init() {
@@ -183,9 +257,9 @@
183 257
           obj[arr[0]] = arr[1];
184 258
         }
185 259
         console.log(obj);
186
-        if(obj.dept){
260
+        if (obj.dept) {
187 261
           window.localStorage.setItem('oadept', obj.dept)
188
-        }else{
262
+        } else {
189 263
           window.localStorage.setItem('oadept', '0')
190 264
         }
191 265
         this.$store
@@ -212,21 +286,27 @@
212 286
         this.$refs.loginForm.validate((valid) => {
213 287
           if (valid) {
214 288
             // this.loading = true;
215
-            const password = this.loginForm.password;
216
-            console.log(password)
289
+            // console.log(password)
217 290
             // this.loginForm.jiamiword = this.encrypt(md5(password));
291
+            const password = this.loginForm.password;
218 292
             this.loginForm.jiamiword = sm2.doEncrypt(md5(password), publicKey, cipherMode);
219 293
             this.loginForm.loginway = "pc";
220 294
             this.$store
221 295
               .dispatch("Login", this.loginForm)
222 296
               .then(() => {
223
-                this.$message.success("登录成功");
297
+                // this.$message.success("登录成功");
224 298
                 window.localStorage.setItem('loginpass', password)
225 299
                 window.localStorage.setItem('loginway', 'pc')
226 300
                 window.localStorage.setItem('oadept', '0')
227 301
                 window.localStorage.setItem('clickChangeDept', '0')
228 302
                 this.loading = false;
229
-                this.getAllowDept()
303
+                const changePwdFlag = window.localStorage.getItem('changePwdFlag')
304
+                if (changePwdFlag == 1) {
305
+                  this.isLongPass()
306
+                } else {
307
+                  this.getAllowDept()
308
+                }
309
+                // this.getAllowDept()
230 310
                 // this.$router.push({
231 311
                 //   path: "/Dashboard",
232 312
                 // });
@@ -240,6 +320,37 @@
240 320
           }
241 321
         });
242 322
       },
323
+      isLongPass() {
324
+        this.$alert('您的密码已经超三个月未修改,请更新密码!', '提示', {
325
+          showClose: false,
326
+          confirmButtonText: '确定',
327
+          callback: action => {
328
+            this.dialogTableVisible = true
329
+          }
330
+        });
331
+      },
332
+      onsub() {
333
+        this.$refs.ruleForm.validate((valid) => {
334
+          if (valid) {
335
+            const params = {
336
+              oldpwd: md5(this.form.oldpas),
337
+              usercode: localStorage.getItem('storageUsercode'),
338
+              pwd: md5(this.form.confirmpas)
339
+            }
340
+            getResetPwd(params).then((response) => {
341
+              if (response.state.toLowerCase() === 'success') {
342
+                this.$message.success('恭喜你,重置密码成功!')
343
+                this.dialogTableVisible = false
344
+                window.localStorage.setItem('loginpass', this.form.confirmpas)
345
+                window.localStorage.setItem('loginway', 'pc')
346
+                window.localStorage.setItem('oadept', '0')
347
+                window.localStorage.setItem('clickChangeDept', '0')
348
+                this.getAllowDept()
349
+              }
350
+            })
351
+          }
352
+        })
353
+      },
243 354
       toggle() {
244 355
         const validateExt = (rule, value, callback) => {
245 356
           if (!validExtension(value)) {

+ 4 - 4
CallCenterWeb.UI/RMYYAPP/pages/index/index.vue

@@ -121,10 +121,10 @@
121 121
 								}
122 122
 								
123 123
 							})
124
-						}else{
125
-							uni.reLaunch({
126
-								url: '/pages/login/login'
127
-							});
124
+						}else{							
125
+							// uni.reLaunch({
126
+							// 	url: '/pages/login/login'
127
+							// });
128 128
 						}
129 129
 					}
130 130
 				})

+ 79 - 55
CallCenterWeb.UI/RMYYAPP/pages/login/login.vue

@@ -10,7 +10,7 @@
10 10
 				<wInput v-model="phoneData" type="text" maxlength="11" placeholder="用户名" :focus="isFocus"></wInput>
11 11
 				<wInput v-model="passData" type="password" maxlength="11" placeholder="密码"></wInput>
12 12
 			</view>
13
-			
13
+
14 14
 			<wButton class="wbutton" text="登 录" :rotate="isRotate" @click="startLogin"></wButton>
15 15
 			<!-- <wButton class="wbutton" text="用户注册" @click="registerStart"></wButton> -->
16 16
 			<!-- <view class="registerStyle" @click="registerStart"></view> -->
@@ -19,7 +19,6 @@
19 19
 </template>
20 20
 
21 21
 <script>
22
-	
23 22
 	import wInput from '@/components/watch-login/watch-input.vue' //input
24 23
 	import wButton from '@/components/watch-login/watch-button.vue' //button
25 24
 	// import CryptoJS from '@/static/js/crypto-js/crypto-js.js'
@@ -27,8 +26,9 @@
27 26
 	// import { encrypt, decrypt } from "@/utils/jsencrypt";
28 27
 	import pageData from '../myTask/repairList/addRepair/pageData.js'
29 28
 	const sm2 = require('sm-crypto').sm2
30
-	const cipherMode = 0  // 1 - C1C3C2,0 - C1C2C3,默认为1
31
-	const publicKey = "042DBA45E7B03394F603CADAFCDDEC854D3E01A4E9C52CD799B85B1A14BDB970137AE58BA553D79F058604DC1CD4B77DE5408BA3308E767584100C2B663510C819"
29
+	const cipherMode = 0 // 1 - C1C3C2,0 - C1C2C3,默认为1
30
+	const publicKey =
31
+		"042DBA45E7B03394F603CADAFCDDEC854D3E01A4E9C52CD799B85B1A14BDB970137AE58BA553D79F058604DC1CD4B77DE5408BA3308E767584100C2B663510C819"
32 32
 	const privateKey = "BF1F907B4E0487F798DC80AFD7BC2A6201E8514233002272EA3BE2FC6F797843"
33 33
 	// let pwd= sm2.doEncrypt(800100, publicKey, cipherMode) // sm2加密
34 34
 	// console.log(pwd)
@@ -36,7 +36,7 @@
36 36
 	export default {
37 37
 		data() {
38 38
 			return {
39
-				isAllow:"",
39
+				isAllow: "",
40 40
 				//logo图片 base64
41 41
 				logoImage: '/static/login-icon.png',
42 42
 				phoneData: '', //用户/电话
@@ -54,7 +54,7 @@
54 54
 		},
55 55
 
56 56
 		methods: {
57
-			updatePass(){
57
+			updatePass() {
58 58
 				const reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/;
59 59
 				const pass = uni.getStorageSync('loginpass');
60 60
 				if (!reg.test(pass)) {
@@ -72,9 +72,30 @@
72 72
 							}
73 73
 						}
74 74
 					});
75
+				} else {
76
+					this.isLongPass()
77
+				}
78
+			},
79
+			isLongPass() {
80
+				const changePwdFlag = uni.getStorageSync('changePwdFlag')
81
+				if(changePwdFlag == 1){
82
+					uni.showModal({
83
+						title: '提示',
84
+						content: '您的密码已经超三个月未修改,请更新密码!',
85
+						showCancel: false,
86
+						success: function(res) {
87
+							if (res.confirm) {
88
+								uni.navigateTo({
89
+									url: "/pages/setting/fontSizeSettingPass/fontSizeSettingPass"
90
+								})
91
+							} else if (res.cancel) {
92
+								console.log('取消');
93
+							}
94
+						}
95
+					});
75 96
 				}else{
76 97
 					this.getAllowDept()
77
-				}
98
+				}			
78 99
 			},
79 100
 			startLogin(e) {
80 101
 				this.saveDept()
@@ -96,77 +117,78 @@
96 117
 				let params = {
97 118
 					"usercode": this.phoneData,
98 119
 					"password": sm2.doEncrypt(md5.hex_md5(this.passData), publicKey, cipherMode),
99
-					"loginway":"phone"
120
+					"loginway": "phone"
100 121
 				}
101
-				
102
-				
103
-				this.$mStore.dispatch("Login", params).then((e)=>{
122
+
123
+
124
+				this.$mStore.dispatch("Login", params).then((e) => {
104 125
 					this.isRotate = false
105
-					if(e.state.toLowerCase() == 'success') {
106
-					    uni.setStorageSync('loginpass', this.passData)
107
-						uni.setStorageSync('token', e.data)
108
-						uni.setStorageSync('loginway','phone')
109
-						
110
-					}else{
126
+					if (e.state.toLowerCase() == 'success') {
127
+						uni.setStorageSync('loginpass', this.passData)
128
+						uni.setStorageSync('token', e.data.token)
129
+						uni.setStorageSync('loginway', 'phone')
130
+						uni.setStorageSync('userCode', e.data.usercode)
131
+						uni.setStorageSync('changePwdFlag', e.data.changePwdFlag)
132
+					} else {
111 133
 						this.$mHelper.toast(e.message)
112
-						return 
134
+						return
113 135
 					}
114
-					
115
-					this.$mStore.dispatch("GetInfo").then((e)=>{
136
+
137
+					this.$mStore.dispatch("GetInfo").then((e) => {
116 138
 						uni.setStorageSync('roleCode', e.data.Role.F_RoleCode)
117 139
 						uni.setStorageSync('userName', e.data.User.F_UserName)
118
-						if(e.data.Dept){
140
+						if (e.data.Dept) {
119 141
 							uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
120 142
 							uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
121 143
 						}
122
-						
144
+
123 145
 						uni.setStorageSync('userCode', e.data.User.F_UserCode)
124 146
 						uni.setStorageSync('userId', e.data.User.F_UserId.toString())
125 147
 						uni.setStorageSync('storageAllowUserDept', e.data.User.F_AllowDepartment)
126
-						const code = uni.getStorageSync("roleCode"); 
148
+						const code = uni.getStorageSync("roleCode");
127 149
 						this.updatePass()
128
-
129
-						if(!uni.getStorageSync('fontSizeValue')){
150
+						// this.isLongPass()
151
+						if (!uni.getStorageSync('fontSizeValue')) {
130 152
 							uni.setStorageSync('fontSizeValue', 1)
131
-						}					
132
-						 // ||code == 'GLY' || code == 'DDZX'
153
+						}
154
+						// ||code == 'GLY' || code == 'DDZX'
133 155
 						// if(code == 'WXY' || code == 'DDZX'|| code == 'GLY' || code == 'jcgn'  || code == 'GQY' || 
134 156
 						// code == 'SJ' || code == 'WXBZZ' || code == 'APRY' || code == 'APRY') {}else{
135 157
 						// 	this.$mHelper.toast("没有登录权限");
136 158
 						// 	return;
137 159
 						// }
138 160
 					})
139
-				}).catch((e)=>{
161
+				}).catch((e) => {
140 162
 					this.isRotate = false
141 163
 				})
142
-				
164
+
143 165
 			},
144
-			getAllowDept(){
145
-			  const params = {}
146
-			  this.$http.get('Index/GetUserDept', params).then(res=>{
147
-			    if(res.message == '需要选择科室'){
148
-			      this.isAllow = "1"
149
-			    }else{
150
-			      this.isAllow = "0"
151
-			    }
152
-				uni.setStorageSync('isAllow', this.isAllow)
153
-			    uni.switchTab({
154
-			    	url: '/pages/myTask/myTask'
155
-			    });
156
-			  })
166
+			getAllowDept() {
167
+				const params = {}
168
+				this.$http.get('Index/GetUserDept', params).then(res => {
169
+					if (res.message == '需要选择科室') {
170
+						this.isAllow = "1"
171
+					} else {
172
+						this.isAllow = "0"
173
+					}
174
+					uni.setStorageSync('isAllow', this.isAllow)
175
+					uni.switchTab({
176
+						url: '/pages/myTask/myTask'
177
+					});
178
+				})
157 179
 			},
158
-			registerStart(){
180
+			registerStart() {
159 181
 				uni.navigateTo({
160 182
 					url: '/pages/register/register'
161 183
 				})
162 184
 			},
163
-			saveDept(){
185
+			saveDept() {
164 186
 				pageData.getDet((res, data) => {
165
-					uni.setStorageSync('deptTreeData',JSON.stringify(res))
166
-					uni.setStorageSync('deptAllList',JSON.stringify(data))
187
+					uni.setStorageSync('deptTreeData', JSON.stringify(res))
188
+					uni.setStorageSync('deptAllList', JSON.stringify(data))
167 189
 				})
168 190
 			}
169
-			
191
+
170 192
 		}
171 193
 	}
172 194
 </script>
@@ -174,14 +196,16 @@
174 196
 <style>
175 197
 	@import url("@/components/watch-login/css/icon.css");
176 198
 	@import url("@/pages/login/css/main.css");
177
-	.wbutton{
199
+
200
+	.wbutton {
178 201
 		margin-top: 30px;
179 202
 	}
180
-	.registerStyle{
181
-		    color: blue;
182
-		    text-align: center;
183
-		    height: 30px;
184
-		    line-height: 30px;
185
-		    margin-top: 20px;
203
+
204
+	.registerStyle {
205
+		color: blue;
206
+		text-align: center;
207
+		height: 30px;
208
+		line-height: 30px;
209
+		margin-top: 20px;
186 210
 	}
187
-</style>
211
+</style>

+ 1 - 1
CallCenterWeb.UI/RMYYAPP/pages/myTask/myTask.vue

@@ -179,7 +179,7 @@
179 179
 				})
180 180
 			}
181 181
 			// this.updatePass()			
182
-			this.isLongPass()
182
+			// this.isLongPass()
183 183
 			// uni.hideTabBar()
184 184
 		},
185 185
 		methods: {

+ 7 - 4
CallCenterWeb.UI/RMYYAPP/pages/myTask/reportForm/reportForm.vue

@@ -182,10 +182,10 @@
182 182
 				<uni-tr>
183 183
 					<uni-th align="center" width="100rpx" class="thcol">姓名</uni-th>
184 184
 					<uni-th align="center" width="150rpx" class="thcol">班组</uni-th>
185
-					<uni-th align="center" width="110rpx" class="thcol" :sortable="true">接单量</uni-th>
186
-					<uni-th align="center" width="110rpx" class="thcol" :sortable="true">未完成</uni-th>
187
-					<uni-th align="center" width="120rpx" class="thcol" :sortable="true">超时工单</uni-th>
188
-					<uni-th align="center" width="110rpx" class="thcol" :sortable="true">不满意</uni-th>
185
+					<uni-th align="center" width="110rpx" class="thcol" sortable @sort-change="sortChange">接单量</uni-th>
186
+					<uni-th align="center" width="110rpx" class="thcol" sortable>未完成</uni-th>
187
+					<uni-th align="center" width="120rpx" class="thcol" sortable>超时工单</uni-th>
188
+					<uni-th align="center" width="110rpx" class="thcol" sortable>不满意</uni-th>
189 189
 				</uni-tr>
190 190
 				<uni-tr v-for="items in renyuanData">
191 191
 					<uni-td align="center" class="tdcol">{{ items.Maintenancer }}</uni-td>
@@ -281,6 +281,9 @@
281 281
 			this.chart = echarts.init(document.getElementById('echartbox'))
282 282
 		},
283 283
 		methods: {
284
+			sortChange(data){
285
+				console.log(data)
286
+			},
284 287
 			gotoDetail(num) {
285 288
 				console.log(num)
286 289
 				uni.navigateTo({

+ 5 - 1
CallCenterWeb.UI/RMYYAPP/pages/setting/fontSizeSettingPass/fontSizeSettingPass.vue

@@ -82,6 +82,10 @@
82 82
 					this.$mHelper.toast("新密码不能为空");
83 83
 					return
84 84
 				}
85
+				if(this.newpass == this.oldpass){
86
+					this.$mHelper.toast("新密码不能和原密码相同!");
87
+					return
88
+				}
85 89
 				if(!this.confirmpass){
86 90
 					this.$mHelper.toast("确认密码不能为空");
87 91
 					return
@@ -97,7 +101,7 @@
97 101
 				const params={
98 102
 					oldpwd: md5.hex_md5(this.oldpass),
99 103
 					pwd: md5.hex_md5(this.confirmpass),
100
-					username: uni.getStorageSync("userName"),
104
+					// username: uni.getStorageSync("userName"),
101 105
 					usercode: uni.getStorageSync("userCode"),
102 106
 				}
103 107
 				this.$http.get("UserAccount/ResetPwd", params).then((response) => {

+ 2 - 2
CallCenterWeb.UI/RMYYAPP/store/modules/user.js

@@ -47,8 +47,8 @@ const user = {
47 47
 		}, userInfo) {
48 48
 			return new Promise((resolve, reject) => {
49 49
 				http.post("/Home/Login", userInfo).then((response) => {
50
-						setToken(response.data)
51
-						commit('SET_TOKEN', response.data)
50
+						setToken(response.data.token)
51
+						commit('SET_TOKEN', response.data.token)
52 52
 						resolve(response)
53 53
 					})
54 54
 					.catch((e) => {