Beispiel #1
0
def memberShare():
    resp = {'code': 200, 'msg': '操作成功~', 'data': {}}
    req = request.values
    url = req['url'] if 'url' in req else ''
    member_info = g.member_info  # 拦截器的方法,判断
    model_share = WxShareHistory()
    if member_info:
        model_share.member_id = member_info.id

    model_share.share_url = url
    model_share.created_time = getCurrentData()
    db.session.add(model_share)
    db.session.commit()
    return jsonify(resp)


# @route_api.route("/member/info")
# def memberInfo():
#     resp = {'code': 200, 'msg': '操作成功~', 'data': {}}
#     member_info = g.member_info
#     resp['data']['info'] = {
#         "nickname":member_info.nickname,
#         "avatar_url":member_info.avatar
#     }
#     return jsonify(resp)
Beispiel #2
0
def memberShare():
    resp = {"code":200, 'msg':'操作成功'}
    req = request.values
    url = req['url'] if 'url' in req else ''
    member_info = g.member_info
    model_share = WxShareHistory()
    if member_info:
        model_share.member_id = member_info.id
    model_share.share_url = url
    model_share.created_time = getCurrentDate()
    db.session.add(model_share)
    db.session.commit()
    return jsonify(resp)
Beispiel #3
0
def memberShare():
    resp = {'code': 200, 'msg': '操作成功~', 'data': {}}
    req = request.values
    url = req['url'] if 'url' in req else ''
    member_info = g.member_info  # 分享的会员id(拦截器中获得id)
    model_share = WxShareHistory()  # 创建模型
    if member_info:
        model_share.member_id = member_info.id
    model_share.share_url = url
    model_share.created_time = getCurrentDate()
    db.session.add(model_share)
    db.session.commit()
    return jsonify(resp)
Beispiel #4
0
def share():
    ret = {'code': 200, 'msg': '操作成功~~', 'data': {}}
    req = request.values
    url = req['url'] if 'url' in req else ''
    member_info = g.member_info
    model_share = WxShareHistory()
    if member_info:
        model_share.member_id = member_info.id
    model_share.share_url = url
    model_share.created_time = get_current_time()
    db.session.add(model_share)
    db.session.commit()
    return jsonify(ret)
Beispiel #5
0
def memberShare():
    resp = {"code": 200, "msg": "操作成功~", "data": {}}
    req = request.values
    url = req["url"] if "url" in req else ""
    member_info = g.member_info
    model_share = WxShareHistory()
    if member_info:
        model_share.member_id = member_info.id
    model_share.share_url = url
    model_share.created_time = getCurrentDate()
    db.session.add(model_share)
    db.session.commit()
    return jsonify(resp)