def RunLinkButton(): BTID = request.values.get('BTID') SHELL = request.values.get('SHELL') if not BTID: return json.dumps({'resultCode': 1, 'result': '???'}) SearchShell = sql.selectShellForLinkButton(BTID)[0][0] if SearchShell != SHELL: result = sql.updateLinkButton(BTID, SHELL) return json.dumps({'resultCode': 0})
def getShell(): if request.method == 'GET': #根据ID号单独获取按钮的SHELL,估计用不到这里 BTID = request.values.get('BTID') result = sql.selectShellForLinkButton(BTID) try: result = result[0][0] except: result = '查询的按钮ID不存在' return json.dumps({'resultCode': 0, 'result': result}) else: BTID = request.values.get('BTID') SHELL = request.values.get('SHELL') result = sql.updateLinkButton(BTID, SHELL) if result[0]: return json.dumps({'resultCode': 0}) else: return json.dumps({'resultCode': 1, 'result': str(result[1])})