问题
我在“/artists”有一个 axios 调用,它获取艺术家列表作为 JSON 数组返回。它在开发中工作。但是,在生产中,它会输出一个 HTML 元素,说明您需要启用 Javascript,因为从“/artists”返回的数据未定义(证明如下):
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./favicon.ico" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="./logo192.png" />
<link rel="manifest" href="./manifest.json" />
<title>React App</title>
<link href="./static/css/main.5eece21d.chunk.css" rel="stylesheet" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script>
!(function (e) {
function t(t) {
for (var n, f, i = t[0], l = …Run Code Online (Sandbox Code Playgroud)