From 5ce38eed96e6bb19725094d2d32ca765c5ec940e Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Fri, 29 Mar 2024 22:01:15 +0800
Subject: [PATCH] client_id 修改,新增认证管理页面

---
 src/config/website.js         |   10 +-
 src/util/auth.js              |    4 
 src/views/article/article.vue |    4 
 src/api/logs.js               |    5 
 src/views/monitor/log/api.vue |    1 
 src/views/system/auth.vue     |  166 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 179 insertions(+), 11 deletions(-)

diff --git a/src/api/logs.js b/src/api/logs.js
index 287ace9..826221d 100644
--- a/src/api/logs.js
+++ b/src/api/logs.js
@@ -11,11 +11,12 @@
   })
 }
 
-export const getApiList = (current, size) => {
+export const getApiList = (current, size,params) => {
   return request({
-    url: '/api/blade-log/api/list',
+    url: '/api/blade-log/api/page',
     method: 'get',
     params: {
+      ...params,
       current,
       size
     }
diff --git a/src/config/website.js b/src/config/website.js
index 7747a21..52c2033 100644
--- a/src/config/website.js
+++ b/src/config/website.js
@@ -2,12 +2,12 @@
  * 全局配置文件
  */
 export default {
-  title: "saber",
-  logo: "S",
-  key: "saber", //配置主键,目前用于存储
+  title: "jczz",
+  logo: "J",
+  key: "jczz", //配置主键,目前用于存储
   indexTitle: "基层智治综合协同平台",
-  clientId: "saber", // 客户端id
-  clientSecret: "saber_secret", // 客户端密钥
+  clientId: "jczz", // 客户端id
+  clientSecret: "jczz_secret_FaXfddsafRsfjlsdf2A12412", // 客户端密钥
   tenantMode: true, // 是否开启租户模式
   tenantId: "000000", // 管理组租户编号
   captchaMode: true, // 是否开启验证码模式
diff --git a/src/util/auth.js b/src/util/auth.js
index 2e7544a..9003a11 100644
--- a/src/util/auth.js
+++ b/src/util/auth.js
@@ -1,6 +1,6 @@
 import Cookies from 'js-cookie'
-const TokenKey = 'saber-access-token'
-const RefreshTokenKey = 'saber-refresh-token'
+const TokenKey = 'jczz-access-token'
+const RefreshTokenKey = 'jczz-refresh-token'
 const SessionId = 'JSESSIONID';
 const UserId = 'b-user-id';
 export function getToken() {
diff --git a/src/views/article/article.vue b/src/views/article/article.vue
index d7068e5..3d7a969 100644
--- a/src/views/article/article.vue
+++ b/src/views/article/article.vue
@@ -185,10 +185,10 @@
               prop: "articleList",
               span: 12,
               minRows: 2,
-              type: "cascader",
+              type: "tree",
               multiple: true,
               tags: true,
-              search: true,
+              // search: true,
               dicData: [],
               props: {
                 label: "name",
diff --git a/src/views/monitor/log/api.vue b/src/views/monitor/log/api.vue
index 2209fbf..acd1e01 100644
--- a/src/views/monitor/log/api.vue
+++ b/src/views/monitor/log/api.vue
@@ -142,6 +142,7 @@
             this.onLoad(this.page, this.query)
         },
         onLoad (page, params = {}) {
+            params['type'] = '2'
             this.loading = true
             getApiList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                 const data = res.data.data
diff --git a/src/views/system/auth.vue b/src/views/system/auth.vue
new file mode 100644
index 0000000..84af0c4
--- /dev/null
+++ b/src/views/system/auth.vue
@@ -0,0 +1,166 @@
+<template>
+  <basic-container>
+      <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
+          :permission="permissionList" :before-open="beforeOpen" :page.sync="page" @search-change="searchChange"
+          @search-reset="searchReset" @current-change="currentChange" @size-change="sizeChange"
+          @refresh-change="refreshChange" @on-load="onLoad">
+      </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import { getApiList, getApiLogs } from "@/api/logs"
+import { mapGetters } from "vuex"
+
+export default {
+  data () {
+      return {
+          form: {},
+          selectionList: [],
+          query: {},
+          loading: true,
+          page: {
+              pageSize: 10,
+              currentPage: 1,
+              total: 0
+          },
+          option: {
+              labelWidth: 96,
+              searchLabelWidth: 72,
+              searchShow: true,
+              searchMenuSpan: 3,
+              menuWidth: 80,
+
+              height: 'auto',
+              calcHeight: 30,
+              tip: false,
+              border: true,
+              index: true,
+              viewBtn: true,
+              editBtn: false,
+              addBtn: false,
+              delBtn: false,
+              dialogType: 'drawer',
+              column: [
+                  {
+                      label: "应用id",
+                      prop: "applicationId",
+                      width: '120',
+                      searchSpan: 4,
+                      search: true,
+                      searchLabelWidth: 60,
+                  },
+                  {
+                      label: "服务id",
+                      prop: "serviceId",
+                      width: '120',
+                      searchSpan: 4,
+                      search: true,
+                      searchLabelWidth: 60,
+                  },
+                  {
+                      label: "服务host",
+                      prop: "serverHost",
+                      searchSpan: 4,
+                      searchLabelWidth: 86,
+                      search: true
+                  },
+                  {
+                      label: "服务ip",
+                      prop: "serverIp",
+                      width: '160'
+                  },
+                  {
+                      label: "软件环境",
+                      prop: "env",
+                      width: '80',
+                  },
+                  {
+                      label: "名称",
+                      prop: "title"
+                  },
+                  {
+                      label: "请求方法",
+                      prop: "method",
+                      width: '80'
+                  },
+                  {
+                      label: "认证接口",
+                      prop: "requestUri"
+                  },
+                  {
+                      label: "时间",
+                      prop: "createTime",
+                      width: '180'
+                  },
+                  {
+                      label: "用户代理",
+                      prop: "userAgent",
+                      span: 24,
+                      hide: true
+                  },
+                  {
+                      label: "请求数据",
+                      prop: "params",
+                      type: "textarea",
+                      span: 24,
+                      minRows: 2,
+                      hide: true
+                  }
+              ]
+          },
+          data: []
+      }
+  },
+
+  computed: {
+      ...mapGetters(["permission"]),
+      permissionList () {
+          return {
+              viewBtn: this.vaildData(this.permission.log_api_view, false)
+          }
+      }
+  },
+  methods: {
+      searchReset () {
+          this.query = {}
+          this.onLoad(this.page)
+      },
+      searchChange (params, done) {
+          this.query = params
+          this.page.currentPage = 1
+          this.onLoad(this.page, params)
+          done()
+      },
+      beforeOpen (done, type) {
+          if (["edit", "view"].includes(type)) {
+              getApiLogs(this.form.id).then(res => {
+                  this.form = res.data.data
+              })
+          }
+          done()
+      },
+      currentChange (currentPage) {
+          this.page.currentPage = currentPage
+      },
+      sizeChange (pageSize) {
+          this.page.pageSize = pageSize
+      },
+      refreshChange () {
+          this.onLoad(this.page, this.query)
+      },
+      onLoad (page, params = {}) {
+        params['type'] = 1;
+          this.loading = true
+          getApiList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+              const data = res.data.data
+              this.page.total = data.total
+              this.data = data.records
+              this.loading = false
+          })
+      }
+  }
+}
+</script>
+
+<style></style>

--
Gitblit v1.9.3