This commit is contained in:
qishibo 2019-01-14 08:45:52 +08:00
parent bdd733774b
commit 7afcda574f
2 changed files with 34 additions and 53 deletions

View File

@ -19,18 +19,8 @@
<button id="sub-btn">submit</button>
</body>
<!-- <script type="text/javascript" src="index.js"></script> -->
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
// alert(999)
// $(function () {
// alert('innnn');
// $('#sub-btn').click(function () {
// alert(111)
// })
// })
@ -49,11 +39,15 @@
// });
// return;
this.redis[operation](key, callback);
this.redis[operation + 'Async'](key).then(callback);
},
getRedis: function(host, port, auth) {
var redis = require("redis");
const redis = require('redis');
const bluebird = require('bluebird');
bluebird.promisifyAll(redis);
var client = redis.createClient(port, host);
client.on("error", function (err) {
@ -71,35 +65,16 @@
var key = $('#key').val();
var operation = $('#operation').val();
that.exec(operation, key, '', (err, reply) => {
that.exec(operation, key, '', (reply) => {
$('#result').val(reply);
});
})
});
}
};
qii404.init();
// function getData(key)
// {
// var redis = require("redis"),
// client = redis.createClient(6379, '10.20.1.133');
// client.on("error", function (err) {
// return err;
// });
// client.get(key, function(err, reply) {
// // reply is null when the key is missing
// document.getElementById('value').value = reply;
// });
// // client.quit();
// }
// getData('name');
</script>
</html>

View File

@ -1,22 +1,28 @@
{
"name":"node_redis",
"main":"index.html",
"window":{
"id": "noderedsi",
"title":"noderedis",
"toolbar":true,
"frame":true,
"position":"center",
"always-on-top":true,
"width":1100,
"height":728,
"icon": "/home/qii/MinimalistNote/64.ico",
"as_desktop": true,
"show_in_taskbar": true
},
"domain": "nodejsapp",
"version": "1.0",
"dependencies": {},
"nodejs": true,
"bg-script": "bg.js"
"name": "node_redis",
"main": "index.html",
"window": {
"id": "noderedsi",
"title": "noderedis",
"toolbar": false,
"frame": true,
"position": "center",
"always-on-top": true,
"width": 1100,
"height": 728,
"icon": "/home/qii/MinimalistNote/64.ico",
"as_desktop": true,
"show_in_taskbar": true
},
"domain": "nodejsapp",
"version": "1.0",
"nodejs": true,
"bg-script": "bg.js",
"contributors": [
{
"name": "qii404",
"email": "qii404@126.com",
"web": "https://qii404.me"
}
]
}