瀏覽代碼

清除用户登录缓存

sangwenwei 7 月之前
父節點
當前提交
3464efa470
共有 2 個文件被更改,包括 24 次插入1 次删除
  1. 7 0
      src/api/sys/userService.js
  2. 17 1
      src/views/human/enrollment/registration/EnrollmentRegistrationList.vue

+ 7 - 0
src/api/sys/userService.js

@@ -43,6 +43,13 @@ export default {
 			params: { ids: ids },
 		});
 	},
+	removeRedis: function (ids) {
+		return request({
+			url: prefix + "/sys/user/removeRedis",
+			method: "get",
+			params: { id: ids },
+		});
+	},
 
 	queryById: function (id) {
 		return request({

+ 17 - 1
src/views/human/enrollment/registration/EnrollmentRegistrationList.vue

@@ -89,7 +89,9 @@
                       scope.row.type === '5' || scope.row.type === '4' || scope.row.type === '3'" text type="primary" @click="edit(scope.row.id)">修改</el-button>
                 <el-button v-if="
                       scope.row.type === '5' || scope.row.type === '4' || scope.row.type === '3'" text type="primary" @click="del(scope.row.id)">删除</el-button>
-              </div>
+				  <el-button v-if="
+                      scope.row.type === '5' || scope.row.type === '4' || scope.row.type === '3'" text type="primary" @click="removeRedis(scope.row.userId)">清除登录缓存</el-button>
+			  </div>
             </template>
           </vxe-column>
         </vxe-table>
@@ -351,6 +353,20 @@
 				})
 			})
 		},
+		removeRedis(userId){
+			this.$confirm(`确定清除所选项登陆缓存吗?`, '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				this.loading = true
+				userService.removeRedis(userId).then((data) => {
+					this.$message.success(data)
+					this.refreshList()
+					this.loading = false
+				})
+			})
+		}
     }
   }
 </script>