This commit is contained in:
lightings 2023-05-15 12:57:21 +08:00
parent c24617788d
commit 58e6c9ecf2
3 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,7 @@
var logger = require("pomelo-logger").getLogger(__filename);
const userDao = require("../../../dao/userDao");
const Code = require("shared/code");
const got = require("got");
module.exports = function (app) {
return new Handler(app);
@ -57,6 +58,13 @@ Handler.prototype.entry = function (msg, session, next) {
async function bindUser() {
const user = await userDao.getUserInfo(msg.uid);
console.log(`-------bind ${session.id} : ${uid}`);
// const {data} = await got.get('http://www.baidu.com', {
// json: {
// hello: 'world'
// }
// }).json();
session.bind(uid, () => {
session.set("uid", uid);
session.set("userInfo", user);

View File

@ -8,7 +8,7 @@
"name": "r2",
"version": "0.0.1",
"dependencies": {
"axios": "^1.3.4",
"axios": "^1.4.0",
"got": "^12.6.0",
"mysql2": "^3.2.0",
"pomelo": "../pomelo",

View File

@ -10,7 +10,7 @@
"doc": "apidoc -i . -o /var/www/r2 -f app/servers"
},
"dependencies": {
"axios": "^1.3.4",
"axios": "^1.4.0",
"got": "^12.6.0",
"mysql2": "^3.2.0",
"pomelo": "../pomelo",