From 4cb9aab9ce91d3208f8cf919c50a61c16262eaf5 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期六, 28 五月 2022 23:23:39 +0800
Subject: [PATCH] update 优化 验证码 登录 登出 注册 等接口 使用匿名注解放行
---
ruoyi-ui/src/views/monitor/online/index.vue | 122 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 122 insertions(+), 0 deletions(-)
diff --git a/ruoyi-ui/src/views/monitor/online/index.vue b/ruoyi-ui/src/views/monitor/online/index.vue
new file mode 100644
index 0000000..ad613c9
--- /dev/null
+++ b/ruoyi-ui/src/views/monitor/online/index.vue
@@ -0,0 +1,122 @@
+<template>
+ <div class="app-container">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
+ <el-form-item label="鐧诲綍鍦板潃" prop="ipaddr">
+ <el-input
+ v-model="queryParams.ipaddr"
+ placeholder="璇疯緭鍏ョ櫥褰曞湴鍧�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item label="鐢ㄦ埛鍚嶇О" prop="userName">
+ <el-input
+ v-model="queryParams.userName"
+ placeholder="璇疯緭鍏ョ敤鎴峰悕绉�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
+ </el-form-item>
+
+ </el-form>
+ <el-table
+ v-loading="loading"
+ :data="list.slice((pageNum-1)*pageSize,pageNum*pageSize)"
+ style="width: 100%;"
+ >
+ <el-table-column label="搴忓彿" type="index" align="center">
+ <template slot-scope="scope">
+ <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="浼氳瘽缂栧彿" align="center" prop="tokenId" :show-overflow-tooltip="true" />
+ <el-table-column label="鐧诲綍鍚嶇О" align="center" prop="userName" :show-overflow-tooltip="true" />
+ <el-table-column label="閮ㄩ棬鍚嶇О" align="center" prop="deptName" />
+ <el-table-column label="涓绘満" align="center" prop="ipaddr" :show-overflow-tooltip="true" />
+ <el-table-column label="鐧诲綍鍦扮偣" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
+ <el-table-column label="娴忚鍣�" align="center" prop="browser" />
+ <el-table-column label="鎿嶄綔绯荤粺" align="center" prop="os" />
+ <el-table-column label="鐧诲綍鏃堕棿" align="center" prop="loginTime" width="180">
+ <template slot-scope="scope">
+ <span>{{ parseTime(scope.row.loginTime) }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ @click="handleForceLogout(scope.row)"
+ v-hasPermi="['monitor:online:forceLogout']"
+ >寮洪��</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
+ </div>
+</template>
+
+<script>
+import { list, forceLogout } from "@/api/monitor/online";
+
+export default {
+ name: "Online",
+ data() {
+ return {
+ // 閬僵灞�
+ loading: true,
+ // 鎬绘潯鏁�
+ total: 0,
+ // 琛ㄦ牸鏁版嵁
+ list: [],
+ pageNum: 1,
+ pageSize: 10,
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ ipaddr: undefined,
+ userName: undefined
+ }
+ };
+ },
+ created() {
+ this.getList();
+ },
+ methods: {
+ /** 鏌ヨ鐧诲綍鏃ュ織鍒楄〃 */
+ getList() {
+ this.loading = true;
+ list(this.queryParams).then(response => {
+ this.list = response.rows;
+ this.total = response.total;
+ this.loading = false;
+ });
+ },
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ handleQuery() {
+ this.pageNum = 1;
+ this.getList();
+ },
+ /** 閲嶇疆鎸夐挳鎿嶄綔 */
+ resetQuery() {
+ this.resetForm("queryForm");
+ this.handleQuery();
+ },
+ /** 寮洪��鎸夐挳鎿嶄綔 */
+ handleForceLogout(row) {
+ this.$modal.confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勭敤鎴凤紵').then(function() {
+ return forceLogout(row.tokenId);
+ }).then(() => {
+ this.getList();
+ this.$modal.msgSuccess("寮洪��鎴愬姛");
+ }).catch(() => {});
+ }
+ }
+};
+</script>
+
--
Gitblit v1.9.3