Merge branch 'master' of https://bdgit.educoder.net/puf7keiya/aaaa into LvYH_branch
commit
5b42f80a80
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,53 @@
|
|||||||
|
from codecs import ignore_errors
|
||||||
|
from pickle import TRUE
|
||||||
|
import turtle
|
||||||
|
from xmlrpc.client import boolean
|
||||||
|
import numpy as np
|
||||||
|
from asyncore import write
|
||||||
|
import xlrd
|
||||||
|
import pandas as pd
|
||||||
|
import openpyxl
|
||||||
|
from xlrd import Book
|
||||||
|
import datetime
|
||||||
|
import time
|
||||||
|
import time
|
||||||
|
from flask import Flask,request
|
||||||
|
from encodings import utf_8
|
||||||
|
import pymssql
|
||||||
|
import json
|
||||||
|
import base64
|
||||||
|
import jpype
|
||||||
|
class admin_log():
|
||||||
|
def admin_log1(c,a):
|
||||||
|
b={
|
||||||
|
'test1':[],
|
||||||
|
'text':'2'
|
||||||
|
}
|
||||||
|
# 把数据装载成json格式并回传
|
||||||
|
#a='{"a":{"test":1},"b":2,"c":3,"d":4,"e":5}'
|
||||||
|
conn =pymssql.connect(
|
||||||
|
server="LAPTOP-FLH9FTB4",#本地服务器
|
||||||
|
user="sa",password="as2799094948",
|
||||||
|
database="software_project",
|
||||||
|
charset="utf8"
|
||||||
|
)
|
||||||
|
if conn:
|
||||||
|
print('连接数据库成功!')#测试是否连接上
|
||||||
|
cursor =conn.cursor() #使用cursor()方法获取操作游标
|
||||||
|
a= request.json
|
||||||
|
username=a['username']
|
||||||
|
passwd=a['password']
|
||||||
|
sql_select="SELECT [password] FROM admin where username = '{}'".format(username) #数据库查询语句
|
||||||
|
cursor.execute(sql_select) #执行语句
|
||||||
|
results =cursor.fetchall() #获取所有记录列表
|
||||||
|
if len(results)==0:
|
||||||
|
b['text']=1
|
||||||
|
elif results[0][0]==passwd:
|
||||||
|
b['text']=2
|
||||||
|
else: b['text']=3
|
||||||
|
conn.commit()
|
||||||
|
cursor.close()
|
||||||
|
conn.close()
|
||||||
|
# 把数据装载成json格式并回传
|
||||||
|
a1=json.dumps(b,ensure_ascii=False)
|
||||||
|
return a1
|
@ -0,0 +1,54 @@
|
|||||||
|
from codecs import ignore_errors
|
||||||
|
from pickle import TRUE
|
||||||
|
import turtle
|
||||||
|
from xmlrpc.client import boolean
|
||||||
|
import numpy as np
|
||||||
|
from asyncore import write
|
||||||
|
import xlrd
|
||||||
|
import pandas as pd
|
||||||
|
import openpyxl
|
||||||
|
from xlrd import Book
|
||||||
|
import datetime
|
||||||
|
import time
|
||||||
|
import time
|
||||||
|
from flask import Flask,request
|
||||||
|
from encodings import utf_8
|
||||||
|
import pymssql
|
||||||
|
import json
|
||||||
|
import base64
|
||||||
|
import jpype
|
||||||
|
class user_log():
|
||||||
|
def user_log1(p,a):
|
||||||
|
b={
|
||||||
|
'test1':[],
|
||||||
|
'text':'2'
|
||||||
|
}
|
||||||
|
# 把数据装载成json格式并回传
|
||||||
|
#a='{"a":{"test":1},"b":2,"c":3,"d":4,"e":5}'
|
||||||
|
conn =pymssql.connect(
|
||||||
|
server="LAPTOP-FLH9FTB4",#本地服务器
|
||||||
|
user="sa",password="as2799094948",
|
||||||
|
database="software_project",
|
||||||
|
charset="utf8"
|
||||||
|
)
|
||||||
|
if conn:
|
||||||
|
print('连接数据库成功!')#测试是否连接上
|
||||||
|
cursor =conn.cursor() #使用cursor()方法获取操作游标
|
||||||
|
a= request.json
|
||||||
|
username=a['username']
|
||||||
|
passwd=a['password']
|
||||||
|
sql_select="SELECT password FROM [user] where username = '{}'".format(username) #数据库查询语句
|
||||||
|
cursor.execute(sql_select) #执行语句
|
||||||
|
results =cursor.fetchall() #获取所有记录列表
|
||||||
|
if len(results)==0:
|
||||||
|
b['text']=1
|
||||||
|
elif results[0][0]==passwd:
|
||||||
|
b['text']=2
|
||||||
|
else: b['text']=3
|
||||||
|
conn.commit()
|
||||||
|
cursor.close()
|
||||||
|
conn.close()
|
||||||
|
# 把数据装载成json格式并回传
|
||||||
|
a1=json.dumps(b,ensure_ascii=False)
|
||||||
|
#a='{"a":{"test":1},"b":2,"c":3,"d":4,"e":5}'
|
||||||
|
return a1
|
Loading…
Reference in new issue