fetch('/static/001.txt')
.then(response => response.text())
.then(data => {
debugger
// 在这里处理获取到的文件内容
let b = data.replace(/'/g, '"')
let a = JSON.parse(b)
console.log(a);
})
.catch(error => {
console.log(error);
});
txt:
{ 'liming':'23'}