可以自己写个函数实现一下
ss = '{[1]={["discount"]=10000,["id"]=1},\
[2]={["discount"]=1041,["id"]=2}, \
[3]={["discount"]=5558,["id"]=3}}';
local tab = loadstring("return " .. ss);
print(tab()[1].discount);
function StringToTable(str)
local _result = loadstring("return " .. str);
return _result();
end