-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from biaov/hotfix/20231023/permission
修复控制台权限详情不能访问的问题
- Loading branch information
Showing
32 changed files
with
466 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"editor.formatOnSave": true | ||
} | ||
{ | ||
"editor.formatOnSave": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import React from 'react' | ||
import { ConfigProvider } from 'antd' | ||
import dayjs from 'dayjs' | ||
import 'dayjs/locale/zh-cn' | ||
import zhCN from 'antd/locale/zh_CN' | ||
import 'antd/dist/reset.css' | ||
import RouterView from '@/router' | ||
|
||
dayjs.locale('zh-cn') | ||
|
||
const App: React.FC = () => ( | ||
<ConfigProvider locale={zhCN}> | ||
<RouterView /> | ||
</ConfigProvider> | ||
) | ||
|
||
export default App | ||
import React from 'react' | ||
import { ConfigProvider } from 'antd' | ||
import dayjs from 'dayjs' | ||
import 'dayjs/locale/zh-cn' | ||
import zhCN from 'antd/locale/zh_CN' | ||
import 'antd/dist/reset.css' | ||
import RouterView from '@/router' | ||
|
||
dayjs.locale('zh-cn') | ||
|
||
const App: React.FC = () => ( | ||
<ConfigProvider locale={zhCN}> | ||
<RouterView /> | ||
</ConfigProvider> | ||
) | ||
|
||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { service } from '@/utils/request' | ||
import { defaultPageSize } from '@/config' | ||
import { PagingResponse } from './types' | ||
|
||
export const restful = (path: string) => ({ | ||
paging: <T>(query = {}): Promise<PagingResponse<T>> => service.get(path, { params: { current: 1, pageSize: defaultPageSize, ...query } }), | ||
all: <T>(query = {}) => service.get(path, { params: { ...query, all: true } }) as Promise<T>, | ||
get: <T>(id: number): Promise<T> => service.get(`${path}/${id}`), | ||
create: (data = {}) => service.post(path, data), | ||
delete: (id: number) => service.delete(`${path}/${id}`), | ||
update: (id: number, data = {}) => service.patch(`${path}/${id}`, data), | ||
replace: (id: number, data = {}) => service.put(`${path}/${id}`, data) | ||
}) | ||
|
||
export const command = (path: string) => ({ | ||
get: <T>(query = {}) => service.get(path, { params: query }) as Promise<T>, | ||
post: <T>(data = {}, config = {}) => service.post(path, data, config) as Promise<T> | ||
}) | ||
import { service } from '@/utils/request' | ||
import { defaultPageSize } from '@/config' | ||
import { PagingResponse } from './types' | ||
|
||
export const restful = (path: string) => ({ | ||
paging: <T>(query = {}): Promise<PagingResponse<T>> => service.get(path, { params: { current: 1, pageSize: defaultPageSize, ...query } }), | ||
all: <T>(query = {}) => service.get(path, { params: { ...query, all: true } }) as Promise<T>, | ||
get: <T>(id: number): Promise<T> => service.get(`${path}/${id}`), | ||
create: (data = {}) => service.post(path, data), | ||
delete: (id: number) => service.delete(`${path}/${id}`), | ||
update: (id: number, data = {}) => service.patch(`${path}/${id}`, data), | ||
replace: (id: number, data = {}) => service.put(`${path}/${id}`, data) | ||
}) | ||
|
||
export const command = (path: string) => ({ | ||
get: <T>(query = {}) => service.get(path, { params: query }) as Promise<T>, | ||
post: <T>(data = {}, config = {}) => service.post(path, data, config) as Promise<T> | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
interface Meta { | ||
total: number | ||
current: number | ||
pageSize: number | ||
} | ||
|
||
export interface PagingResponse<T = Record<string, any>> { | ||
meta: Meta | ||
items: T[] | ||
} | ||
interface Meta { | ||
total: number | ||
current: number | ||
pageSize: number | ||
} | ||
|
||
export interface PagingResponse<T = Record<string, any>> { | ||
meta: Meta | ||
items: T[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.m-loading { | ||
width: 400px; | ||
margin: 0 auto; | ||
padding: 100px; | ||
text-align: center; | ||
.m-loading { | ||
width: 400px; | ||
margin: 0 auto; | ||
padding: 100px; | ||
text-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { Spin } from 'antd' | ||
import Styles from './index.module.less' | ||
|
||
/** | ||
* 页面加载组件 | ||
*/ | ||
export default function PageLoadingComponent() { | ||
return ( | ||
<div className={Styles['m-loading']}> | ||
<Spin tip="加载中..." spinning={true} /> | ||
</div> | ||
) | ||
} | ||
import { Spin } from 'antd' | ||
import Styles from './index.module.less' | ||
|
||
/** | ||
* 页面加载组件 | ||
*/ | ||
export default function PageLoadingComponent() { | ||
return ( | ||
<div className={Styles['m-loading']}> | ||
<Spin tip="加载中..." spinning={true} /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import { useEffect, useState } from 'react' | ||
import ReactQuill from 'react-quill' | ||
import 'react-quill/dist/quill.snow.css' | ||
import type { Props } from './types' | ||
|
||
export default function richTextComponent(props: Partial<Props> = {}) { | ||
const { value = '', onChange } = props | ||
const [richTextValue, setRichTextValue] = useState('') | ||
|
||
useEffect(() => { | ||
setRichTextValue(value) | ||
}, []) | ||
|
||
const modules = { | ||
toolbar: [ | ||
['bold', 'italic', 'underline', 'strike'], | ||
['blockquote', 'code-block'], | ||
|
||
[{ header: 1 }, { header: 2 }], | ||
[{ list: 'ordered' }, { list: 'bullet' }], | ||
[{ script: 'sub' }, { script: 'super' }], | ||
[{ indent: '-1' }, { indent: '+1' }], | ||
[{ direction: 'rtl' }], | ||
|
||
[{ size: ['small', false, 'large', 'huge'] }], | ||
[{ header: [1, 2, 3, 4, 5, 6, false] }], | ||
|
||
[{ color: [] }, { background: [] }], | ||
[{ font: [] }], | ||
[{ align: [] }], | ||
|
||
['clean'] | ||
] | ||
} | ||
|
||
const onChangeRichText = (val: string) => { | ||
setRichTextValue(val) | ||
onChange && onChange(val) | ||
} | ||
|
||
return <ReactQuill placeholder="请输入内容" theme="snow" {...{ richTextValue, modules }} style={{ height: '300px', marginBottom: '43px' }} onChange={onChangeRichText} /> | ||
} | ||
import { useEffect, useState } from 'react' | ||
import ReactQuill from 'react-quill' | ||
import 'react-quill/dist/quill.snow.css' | ||
import type { Props } from './types' | ||
|
||
export default function richTextComponent(props: Partial<Props> = {}) { | ||
const { value = '', onChange } = props | ||
const [richTextValue, setRichTextValue] = useState('') | ||
|
||
useEffect(() => { | ||
setRichTextValue(value) | ||
}, []) | ||
|
||
const modules = { | ||
toolbar: [ | ||
['bold', 'italic', 'underline', 'strike'], | ||
['blockquote', 'code-block'], | ||
|
||
[{ header: 1 }, { header: 2 }], | ||
[{ list: 'ordered' }, { list: 'bullet' }], | ||
[{ script: 'sub' }, { script: 'super' }], | ||
[{ indent: '-1' }, { indent: '+1' }], | ||
[{ direction: 'rtl' }], | ||
|
||
[{ size: ['small', false, 'large', 'huge'] }], | ||
[{ header: [1, 2, 3, 4, 5, 6, false] }], | ||
|
||
[{ color: [] }, { background: [] }], | ||
[{ font: [] }], | ||
[{ align: [] }], | ||
|
||
['clean'] | ||
] | ||
} | ||
|
||
const onChangeRichText = (val: string) => { | ||
setRichTextValue(val) | ||
onChange && onChange(val) | ||
} | ||
|
||
return <ReactQuill placeholder="请输入内容" theme="snow" {...{ richTextValue, modules }} style={{ height: '300px', marginBottom: '43px' }} onChange={onChangeRichText} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import ReactDOM from 'react-dom/client' | ||
import { Provider } from 'react-redux' | ||
import App from './App' | ||
import store from './store' | ||
import './styles/index.less' | ||
|
||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( | ||
<Provider store={store}> | ||
<App /> | ||
</Provider> | ||
) | ||
import ReactDOM from 'react-dom/client' | ||
import { Provider } from 'react-redux' | ||
import App from './App' | ||
import store from './store' | ||
import './styles/index.less' | ||
|
||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( | ||
<Provider store={store}> | ||
<App /> | ||
</Provider> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.