Ver Fonte

feta add user

Young há 4 meses atrás
pai
commit
5757bb98d1

+ 12 - 0
config/routes.ts

@@ -45,6 +45,18 @@ export default [
     ],
   },
   {
+    path: '/peak',
+    name: 'peak',
+    icon: 'crown',
+    routes: [
+      {
+        path: '/peak/list',
+        name: 'peak_list',
+        component: './Peak/Peak',
+      },
+    ],
+  },
+  {
     path: '/settings',
     name: 'settings',
     icon: 'crown',

+ 66 - 0
src/pages/Peak/Peak.tsx

@@ -0,0 +1,66 @@
+import {ActionType, PageContainer, ProTable,} from '@ant-design/pro-components';
+import {Card} from 'antd';
+import React, {useRef} from 'react';
+import {getPeakListApi} from '@/services/swagger/peakAdmin';
+
+const Peak: React.FC = () => {
+  const ref = useRef<ActionType>();
+
+  return (
+    <PageContainer content={''}>
+      <Card>
+        <ProTable<SectApi.StaffVO>
+          rowKey={'id'}
+
+          request={async (_) => {
+            const res = await getPeakListApi();
+            return {
+              success: res.success,
+              data: res.data,
+            };
+          }}
+          columns={[
+            {
+              title: 'ID',
+              dataIndex: 'id',
+            },
+            {
+              title: '名称',
+              dataIndex: 'name',
+            },
+            {
+              title: '等级',
+              dataIndex: 'name',
+            },
+            {
+              title: '人数',
+              dataIndex: 'mobile',
+            },
+            {
+              title: '经验值',
+              dataIndex: 'nickname',
+            },
+            {
+              title: '操作',
+              valueType: 'option',
+              render: () => [
+                <a key={'stat'}>查看数据</a>,
+                <a key={'details'}>基础信息</a>,
+              ],
+            },
+          ]
+          }
+          pagination={false}
+          search={false}
+          form={{
+            ignoreRules: false,
+          }}
+
+          actionRef={ref}
+        ></ProTable>
+      </Card>
+    </PageContainer>
+  );
+};
+
+export default Peak;

+ 1 - 1
src/pages/Settings/Settings.tsx

@@ -16,7 +16,7 @@ import { AddOutline } from 'antd-mobile-icons';
 import { EditBundle, useEdit } from '@/core/hooks/useEdit';
 import dayjs from 'dayjs';
 import ReactJson from 'react-json-view';
-import { getConfigGetApi, postConfigPageApi, postConfigSaveApi } from '@/services/swagger/DictConfigAdmin';
+import { getConfigGetApi, postConfigPageApi, postConfigSaveApi } from '@/services/swagger/configAdmin';
 
 enum ConfigPermission {
   /**

+ 87 - 0
src/services/swagger/configAdmin.ts

@@ -0,0 +1,87 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 根据ID获取字典配置 GET /apis/admin/config/get */
+export async function getConfigGetApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.getConfigGetApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.ConfigVO>('/apis/admin/config/get', {
+    method: 'GET',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 根据ID获取字典配置 POST /apis/admin/config/list */
+export async function postConfigListApi(body: string[], options?: { [key: string]: any }) {
+  return request<SectApi.ConfigVO[]>('/apis/admin/config/list', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 根据前缀获取字典配置 POST /apis/admin/config/list_prefix */
+export async function postConfigListPrefixApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.postConfigListPrefixApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.ConfigVO[]>('/apis/admin/config/list_prefix', {
+    method: 'POST',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 分页查询字典配置 POST /apis/admin/config/page */
+export async function postConfigPageApi(
+  body: SectApi.ConfigPageQuery,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.IPageConfigVO>('/apis/admin/config/page', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 保存字典配置 POST /apis/admin/config/save */
+export async function postConfigSaveApi(body: SectApi.Config, options?: { [key: string]: any }) {
+  return request<boolean>('/apis/admin/config/save', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 批量保存字典配置 POST /apis/admin/config/save_batch */
+export async function postConfigSaveBatchApi(
+  body: SectApi.Config[],
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/admin/config/save_batch', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}

+ 4 - 4
src/services/swagger/index.ts

@@ -19,8 +19,8 @@ import * as peakLevelAdmin from './peakLevelAdmin';
 import * as peakAdmin from './peakAdmin';
 import * as menuAdmin from './menuAdmin';
 import * as factionLevelAdmin from './factionLevelAdmin';
-import * as zidianpeizhiguanlihoutaiApi from './zidianpeizhiguanlihoutaiApi';
-import * as yonghuqiandaokehuduanApi from './yonghuqiandaokehuduanApi';
+import * as configAdmin from './configAdmin';
+import * as userSignClients from './userSignClients';
 export default {
   userConfigClients,
   userLevelClients,
@@ -39,6 +39,6 @@ export default {
   peakAdmin,
   menuAdmin,
   factionLevelAdmin,
-  zidianpeizhiguanlihoutaiApi,
-  yonghuqiandaokehuduanApi,
+  configAdmin,
+  userSignClients,
 };

+ 42 - 0
src/services/swagger/userSignClients.ts

@@ -0,0 +1,42 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 获取用户签到次数 GET /apis/clients/user_sign/cnt */
+export async function getUserSignCntApi(options?: { [key: string]: any }) {
+  return request<number>('/apis/clients/user_sign/cnt', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+
+/** 查询用户当天是否签到 GET /apis/clients/user_sign/is_sign */
+export async function getUserSignIsSignApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.getUserSignIsSignApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/clients/user_sign/is_sign', {
+    method: 'GET',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 获取用户签到列表 GET /apis/clients/user_sign/list */
+export async function getUserSignListApi(options?: { [key: string]: any }) {
+  return request<number[]>('/apis/clients/user_sign/list', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+
+/** 用户签到 GET /apis/clients/user_sign/sign */
+export async function getUserSignSignApi(options?: { [key: string]: any }) {
+  return request<boolean>('/apis/clients/user_sign/sign', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}