第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

在另一個(gè)節(jié)點(diǎn)js服務(wù)器之前添加登錄節(jié)點(diǎn)服務(wù)器

在另一個(gè)節(jié)點(diǎn)js服務(wù)器之前添加登錄節(jié)點(diǎn)服務(wù)器

慕虎7371278 2023-10-20 15:11:43
我已經(jīng)使用節(jié)點(diǎn)服務(wù)器(ejs 引擎)在端口 3000 上偵聽創(chuàng)建了一個(gè)登錄模塊。使用該模塊成功登錄后,我想將其重定向到在端口 2011 上偵聽的另一個(gè)節(jié)點(diǎn)服務(wù)器(使用 jade 引擎制作)。重定向無(wú)法正常工作。登錄模塊的工作原理是,它在實(shí)時(shí)網(wǎng)站上發(fā)出帶有用戶名和密碼的 axios post 請(qǐng)求,并獲得成功代碼作為返回。無(wú)需注冊(cè),因?yàn)樯矸蒡?yàn)證是由該實(shí)時(shí)網(wǎng)站完成的。兩臺(tái)服務(wù)器(3000 和 2011)都工作正常,但重定向不起作用我可以使用“l(fā)ocalhost:3000/welcome”域在同一服務(wù)器上路由其他節(jié)點(diǎn)應(yīng)用程序(2011)嗎?'use strict'const express=require("express");const app=express();const path=require("path");const port=process.env.PORT || 3000const pubdir=path.join(__dirname,"/public");const bodyParser = require('body-parser')const axios=require("axios");// const axiosCookieJarSupport = require('axios-cookiejar-support').default;// const tough = require('tough-cookie');// const https = require('https');// const Cookie=require("request-cookies").Cookie;// const http=require("http");// axiosCookieJarSupport(axios);// const request= require("request");var urlencodedParser = bodyParser.urlencoded({ extended: false })const offlineroute=require("./router")app.set("view engine", "ejs");app.use(express.static(pubdir))app.get("/",(req,res)=>{    res.render("index");})const url uat="It's a valid url working fine"const url_uat_auth="Another url working fine"app.post("/login",urlencodedParser,(req,resp)=>{const data = {    username:req.body.user_name,    password:req.body.user_pass,    captcha:"121212",    deviceID: null,}const apiData={    action: "ACCESSTOKEN",    username: data.username,    password: data.password,       }
查看完整描述

1 回答

?
三國(guó)紛爭(zhēng)

TA貢獻(xiàn)1804條經(jīng)驗(yàn) 獲得超7個(gè)贊

嘗試添加完整的協(xié)議和端口:

resp.redirect("http://localhost:2011");


查看完整回答
反對(duì) 回復(fù) 2023-10-20
  • 1 回答
  • 0 關(guān)注
  • 152 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)