()
return jsonify({'data': path, "msg": "上传成功", "status": 1})
文件上传
文件上传
文件上传
def api_upload_pic():
    """ 文件上传 """
    data = request.files
    file = data['file']
    name = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) + str(random.randint(100, 999))
    file.save(os.path.join(NOTES_ADDRESS, name + '.png'))

    path = '![image]' + '(http://www.heiman.website/notes/{}.png)'.format(name)
    return jsonify({'data': path, "msg": "上传成功", "status": 1})
def api_upload_pic ( ) : data = request . files file = data [ 'file' ] name = time . strftime ( "%Y-%m-%d-%H-%M-%S" , time . localtime ( ) ) + str ( random . randint ( 100 , 999 ) ) file . save ( os . path . join ( NOTES_ADDRESS , name + '.png' ) ) path = '![image]' + '(http://www.heiman.website/notes/{}.png)' . format ( name ) return jsonify ( { 'data' : path , "msg" : "上传成功", "statu s : 1})