移除错误信息的具体描述,简化错误响应内容
This commit is contained in:
parent
6550f9539b
commit
4aac5588e3
@ -6,7 +6,6 @@ const cors = require('cors');
|
|||||||
const app = express();
|
const app = express();
|
||||||
const PORT = 3213;
|
const PORT = 3213;
|
||||||
|
|
||||||
// 引入并使用cors中间件,允许所有跨域访问
|
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
|
|
||||||
app.get('/api/minm/open', async (req, res) => {
|
app.get('/api/minm/open', async (req, res) => {
|
||||||
@ -50,7 +49,6 @@ app.get('/api/minm/open', async (req, res) => {
|
|||||||
res.json({ Open: openValue, Volume: volumeValue, DaysRange: daysRangeValue, Week52Range: week52RangeValue, MarketCap: marketCapValue, change: changeValue });
|
res.json({ Open: openValue, Volume: volumeValue, DaysRange: daysRangeValue, Week52Range: week52RangeValue, MarketCap: marketCapValue, change: changeValue });
|
||||||
} else {
|
} else {
|
||||||
res.status(404).json({
|
res.status(404).json({
|
||||||
error: '未找到全部数据',
|
|
||||||
Open: openValue,
|
Open: openValue,
|
||||||
Volume: volumeValue,
|
Volume: volumeValue,
|
||||||
DaysRange: daysRangeValue,
|
DaysRange: daysRangeValue,
|
||||||
@ -60,7 +58,7 @@ app.get('/api/minm/open', async (req, res) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
res.status(500).json({ error: '请求或解析失败', detail: err.message });
|
res.status(500).json({ error: '', detail: err.message });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user