发布:2023/11/5 10:05:31作者:管理员 来源:本站 浏览次数:638
var redis = require('redis'),
RDS_PORT = 6389, //端口号
RDS_HOST = '127.0.0.1', //服务器IP
RDS_PWD = '88888888888888', //密码
RDS_OPTS = {}, //设置项
rclient = redis.createClient(RDS_PORT,RDS_HOST,RDS_OPTS);
rclient.auth(RDS_PWD,function(){
console.log('redis通过认证');
});
//redis数据库
rclient.set('key','1');//赋值
rclient.expire('key',60);//60秒自动过期
© Copyright 2014 - 2024 柏港建站平台 ejk5.com. 渝ICP备16000791号-4