1.login登录接口,有name/password两个参数
2.name/password值从数据库当中全部捞出来
3.return返回name/password那个值
4.在接口调用时,name/password一直就是张三/123456这个值
问题:如何写出在每个用户调用的接口传递的name/password值不是一样的了?
代码如下:
class UserBae(TaskSet):
def getActivitieResourceList(self):
name, password = self.select_user()
payload = {
"name": name,
"password":password
}
json_ = json.dumps(payload)
self.client.post("/wiseserver/api/getActivitieResourceList", data=json_ )
def select_user(self):
user = self.conn.cursor()
user.execute("SELECT * FROM t_e_user_login ")
user = user.fetchall()
for i in user:
name = i[0]
password = i[1]
return name,password
慕容708150