refactor: migrate demo applications to playground (#4116)

* chore: detail adjustment

* refactor: Migrate demo applications to playground

* perf: logic optimization

* chore: update docs

* chore: update docs
This commit is contained in:
Vben
2024-08-11 16:09:32 +08:00
committed by GitHub
parent 654bf90c0d
commit b464b87ac5
138 changed files with 3197 additions and 682 deletions

View File

@@ -1 +0,0 @@
export * from './status';

View File

@@ -1,10 +0,0 @@
import { requestClient } from '#/api/request';
/**
* 模拟任意状态码
*/
async function getMockStatusApi(status: string) {
return requestClient.get('/status', { params: { status } });
}
export { getMockStatusApi };

View File

@@ -1,2 +1 @@
export * from './core';
export * from './demos';

View File

@@ -59,7 +59,7 @@ function createRequestClient(baseURL: string) {
if (status >= 200 && status < 400 && code === 0) {
return data;
}
throw new Error(msg);
throw new Error(`Error ${status}: ${msg}`);
});
return client;
}