//这是config.json文件在静态资源里
{
"apiEndpoint": "http://www.aggsg.com:6091/",
"apiKey": "0558-88888888",
"timeout": 5000,
"debugMode": true
}
//加载config.json文件
fetch('/config.json')
.then(response => response.json())
.then(config => {
// 使用配置项
console.log(config.apiEndpoint);
console.log(config.apiKey);
number.value = config.apiKey
// ...
})
.catch(error => {
console.error('Failed to load config file:', error);
});