错误原因:可能是因为没有判空,判断一下就好了 Cannot read property 'toString' of undefined Cannot read property 'slice' of undefined 原错误代码 修改后