zhongrj
2024-03-29 5ce38eed96e6bb19725094d2d32ca765c5ec940e
client_id 修改,新增认证管理页面
5 files modified
1 files added
190 ■■■■■ changed files
src/api/logs.js 5 ●●●●● patch | view | raw | blame | history
src/config/website.js 10 ●●●● patch | view | raw | blame | history
src/util/auth.js 4 ●●●● patch | view | raw | blame | history
src/views/article/article.vue 4 ●●●● patch | view | raw | blame | history
src/views/monitor/log/api.vue 1 ●●●● patch | view | raw | blame | history
src/views/system/auth.vue 166 ●●●●● patch | view | raw | blame | history
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
    }
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, // 是否开启验证码模式
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() {
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",
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
src/views/system/auth.vue
New file
@@ -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>