fix: add close app

This commit is contained in:
xion 2025-03-19 17:29:21 +08:00
parent feaad567b4
commit e99a584887
2 changed files with 8 additions and 2 deletions

View File

@ -182,6 +182,10 @@ export class UserApp {
// return false; // return false;
fetchData.type = 'oss'; fetchData.type = 'oss';
} }
if (fetchData.status !== 'running') {
console.error('fetchData status is not running', fetchData.user, fetchData.key);
return { code: 500, message: 'app status is not running' };
}
console.log('fetchData', JSON.stringify(fetchData.data.files, null, 2)); console.log('fetchData', JSON.stringify(fetchData.data.files, null, 2));
this.setLoaded('loading', 'loading'); this.setLoaded('loading', 'loading');

View File

@ -176,9 +176,11 @@ export const handleRequest = async (req: http.IncomingMessage, res: http.ServerR
}; };
if (!isExist) { if (!isExist) {
try { try {
const { code, loading } = await userApp.setCacheData(); const { code, loading, message } = await userApp.setCacheData();
if (loading || code === 20000) { if (loading || code === 20000) {
return createRefreshPage(); return createRefreshPage();
} else if (code === 500) {
return createNotFoundPage(message || 'Not Found App\n');
} else if (code !== 200) { } else if (code !== 200) {
return createErrorPage(); return createErrorPage();
} }