好的老师,解决了
def read_json():
#打开Config底下的user.json配置文件
with open(path + "/6-unitterst的使用方法/Config/user.json") as f:
#这样情况下读取json文件,当JSON数据存在中文时,中文部分会变成乱码
#读取该json文件时,先按照gbk的方式对其解码再编码为utf-8的格式
new_result= f.read().encode(encoding='gbk').decode(encoding='utf-8')
data = json.loads(new_result)
return data