node调用存储过程
1 创建存储过程
delimiter //
create procedure newgetadmin(in name1 varchar(255),out acc int)
begin
select account into acc from admin where name=name1 and telephone=telephone1;
select acc;
end//
delimiter ;
2 node中的sql
let sql="call newgetadmin('"+name+"',@acc);"
3 前端使用传回来的result
let acc1=result[0];
let acc2=acc1[0];
this.ruleForm.account=acc2.acc;
下图为result的值