react-toolkits 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import Login from './Login'
2
+ import NoMatch from './NoMatch'
2
3
  import permission from './permission'
3
4
 
4
- export { Login, permission }
5
+ export { Login, NoMatch, permission }
@@ -2,7 +2,7 @@ import { Highlight, PermissionButton, QueryList } from '@/components'
2
2
  import { useFormModal } from '@/components/FormModal/hooks'
3
3
  import type { Role, RoleListItem } from '@/features/permission'
4
4
  import { PermissionList, useCreateRole, useRemoveRole, useUpdateRole } from '@/features/permission'
5
- import { useFetcher, usePermission } from '@/hooks'
5
+ import { useHttpClient, usePermission } from '@/hooks'
6
6
  import { useQueryTriggerStore } from '@/stores'
7
7
  import { UsergroupAddOutlined } from '@ant-design/icons'
8
8
  import type { TableColumnsType } from 'antd'
@@ -17,7 +17,7 @@ export const swrKey = {
17
17
  const RoleList = () => {
18
18
  const { accessible: viewable } = usePermission('200005')
19
19
  const { modal, message } = App.useApp()
20
- const fetcher = useFetcher()
20
+ const httpClient = useHttpClient()
21
21
  const create = useCreateRole()
22
22
  const remove = useRemoveRole()
23
23
  const update = useUpdateRole()
@@ -129,9 +129,7 @@ const RoleList = () => {
129
129
  size="small"
130
130
  type="link"
131
131
  onClick={async () => {
132
- const role = await fetcher<Role>({
133
- method: 'GET',
134
- url: '/api/usystem/role/info',
132
+ const role = await httpClient.get<Role>('/api/usystem/role/info', {
135
133
  params: { name: value.name },
136
134
  })
137
135
  showUpdateModal({
@@ -153,11 +151,13 @@ const RoleList = () => {
153
151
  onClick={() => {
154
152
  modal.confirm({
155
153
  title: '删除角色',
156
- content: <Highlight texts={[value.name]}>
157
- 确定要删除角色&nbsp;
158
- {value.name}
159
- &nbsp;吗?
160
- </Highlight>,
154
+ content: (
155
+ <Highlight texts={[value.name]}>
156
+ 确定要删除角色&nbsp;
157
+ {value.name}
158
+ &nbsp;吗?
159
+ </Highlight>
160
+ ),
161
161
  async onOk() {
162
162
  await remove.trigger(
163
163
  {
@@ -182,7 +182,7 @@ const RoleList = () => {
182
182
  },
183
183
  },
184
184
  ],
185
- [trigger, viewable, fetcher, modal, message, remove, showUpdateModal],
185
+ [trigger, viewable, httpClient, modal, message, remove, showUpdateModal],
186
186
  )
187
187
 
188
188
  return (
@@ -1,20 +1,3 @@
1
- import type { ItemType2 } from '@/layouts/NavBar'
2
-
3
- export interface UserInfo {
4
- authorityId: string
5
- exp: number
6
- }
7
-
8
- export interface LoaderData {
9
- navs: ItemType2[] // 导航栏数据
10
- }
11
-
12
- export interface BackendResponse<T> {
13
- code: number
14
- msg: string
15
- data: T
16
- }
17
-
18
1
  export interface ListResponse<T> {
19
2
  List: T[]
20
3
  Page: number