mirror of
https://github.com/tl-open-source/tl-rtc-file.git
synced 2025-09-26 19:41:16 +08:00
feat: token check env
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "10.4.9",
|
||||
"version": "10.5.0",
|
||||
"socket": {
|
||||
"port": "请到 tlrtcfile.env 中进行配置",
|
||||
"host": "请到 tlrtcfile.env 中进行配置"
|
||||
@@ -20,7 +20,11 @@
|
||||
},
|
||||
"login": {
|
||||
"appId" : "请到 tlrtcfile.env 中进行配置",
|
||||
"appSecret" : "请到 tlrtcfile.env 中进行配置"
|
||||
"appSecret" : "请到 tlrtcfile.env 中进行配置",
|
||||
"token" : {
|
||||
"url" : "请到 tlrtcfile.env 中进行配置",
|
||||
"key" : "请到 tlrtcfile.env 中进行配置"
|
||||
}
|
||||
},
|
||||
"manage": {
|
||||
"room": "请到 tlrtcfile.env 中进行配置",
|
||||
|
@@ -269,7 +269,7 @@ async function getLoginInfo(req, res){
|
||||
let token = req.query.token || "";
|
||||
let key = req.query.key || "";
|
||||
|
||||
if(!token || token.length < 16 || key !== 'iamtsm-socket'){
|
||||
if(!token || token.length < 16 || key !== conf.login.token.key){
|
||||
res.json({ code: 403 });
|
||||
return;
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ async function token(io, socket, tables, dbClient, data){
|
||||
|
||||
request({
|
||||
method: "POST",
|
||||
url: `https://im.iamtsm.cn/api/login/info`,
|
||||
url: `${cfg.login.token.url}/api/login/info`,
|
||||
json: true,
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
|
@@ -94,3 +94,7 @@ tl_rtc_file_notify_qiwei_error=
|
||||
tl_rtc_file_login_appId=
|
||||
## appSecret
|
||||
tl_rtc_file_login_appSecret=
|
||||
## token url
|
||||
tl_rtc_file_login_token_url=http://127.0.0.1:9092
|
||||
## token api key
|
||||
tl_rtc_file_login_token_key=tlrtcfile
|
Reference in New Issue
Block a user