rename all base.xxx to basend-xxx

This commit is contained in:
陆柯 2022-06-04 10:51:45 +08:00
parent ab4dfb2db4
commit c1acfe53fb
3 changed files with 10 additions and 10 deletions

View File

@ -1 +1 @@
# base.websocket.server web服务端套接口 # basend-websocket-server web 服务端套接口

View File

@ -1,5 +1,5 @@
const ws = require('ws') const ws = require('ws')
const webtoken = require('base.webtoken') const webtoken = require('basend-webtoken')
const my = { const my = {
wssServer: undefined, wssServer: undefined,
@ -30,7 +30,7 @@ module.exports = {
} }
if (dataObj.skevent === 'SOCKET_OWNER') { if (dataObj.skevent === 'SOCKET_OWNER') {
dataObj._passtokenSource = webtoken.verifyToken(dataObj._passtoken) // todo: 为防止前端欺骗应当用和login里类似的方法来检查来检查 dataObj._passtokenSource = webtoken.verifyToken(dataObj._passtoken) // todo: 为防止前端欺骗应当用和login里类似的方法来检查来检查
if (typeof(dataObj._passtokenSource?.uuid)==='string') { if (typeof dataObj._passtokenSource?.uuid === 'string') {
my.socketPool[dataObj._passtokenSource.uuid] = socket my.socketPool[dataObj._passtokenSource.uuid] = socket
console.log('收到Login 成功的消息绑定socket', Object.keys(my.socketPool)) console.log('收到Login 成功的消息绑定socket', Object.keys(my.socketPool))
} }

View File

@ -1,10 +1,10 @@
{ {
"name": "base.websocket.server", "name": "basend-websocket-server",
"version": "0.1.0", "version": "0.1.0",
"main": "basesocket.js", "main": "basesocket.js",
"private": true, "private": true,
"dependencies": { "dependencies": {
"base.webtoken": "git+https://git.faronear.org/npm/base.webtoken", "basend-webtoken": "git+https://git.faronear.org/npm/basend-webtoken",
"ws": "^7.2.1" "ws": "^7.2.1"
}, },
"devDependencies": {}, "devDependencies": {},