Merge remote-tracking branch 'origin/main' into T-2327-refactor2

This commit is contained in:
dream2023 2024-01-12 10:18:02 +08:00
commit 3c79cf419c
3 changed files with 6 additions and 10 deletions

View File

@ -8,8 +8,8 @@ NocoBase is in early stage of development and is subject to frequent changes, pl
## Recent major updates
- [v0.19: Application process optimization - 2014/01/08](https://blog.nocobase.com/posts/release-v019/)
- [v0.18: Establish a sound testing system - 2013/12/21](https://blog.nocobase.com/posts/release-v018/)
- [v0.19: Application process optimization - 2024/01/08](https://blog.nocobase.com/posts/release-v019/)
- [v0.18: Establish a sound testing system - 2023/12/21](https://blog.nocobase.com/posts/release-v018/)
- [v0.17: New SchemaInitializer and SchemaSettings - 2023/12/11](https://blog.nocobase.com/posts/release-v017/)
- [v0.16: New cache manager - 2023/11/20](https://blog.nocobase.com/posts/release-v016/)
- [v0.15: New plugin settings manager - 2023/11/13](https://blog.nocobase.com/posts/release-v015/)

View File

@ -174,11 +174,7 @@ export const useTableBlockProps = () => {
ctx.service.refresh();
},
onChange({ current, pageSize }, filters, sorter) {
const sort = sorter.order
? sorter.order === `ascend`
? [sorter.field]
: [`-${sorter.field}`]
: globalSort || ctx.service.params?.[0]?.sort;
const sort = sorter.order ? (sorter.order === `ascend` ? [sorter.field] : [`-${sorter.field}`]) : globalSort;
ctx.service.run({ ...ctx.service.params?.[0], page: current, pageSize, sort });
},
onClickRow(record, setSelectedRow, selectedRow) {

View File

@ -12,13 +12,13 @@ const Documentation = () => {
const apiClient = useAPIClient();
const { t } = useTranslation();
const swaggerUIRef = useRef();
const { data: urls } = useRequest<{ data: { name: string; url: string }[] }>({ url: 'swagger:getUrls' });
const requestInterceptor = (req) => {
if (!req.headers['Authorization']) {
const match = location.pathname.match(/^\/apps\/([^/]*)\//);
// multi apps need to set X-App header
req.headers['X-App'] = match?.[1] || 'main';
if (match?.[1]) {
req.headers['X-App'] = match?.[1];
}
req.headers['Authorization'] = `Bearer ${apiClient.auth.getToken()}`;
}
return req;