Article From:https://segmentfault.com/q/1010000011110310
Question:

I need to get the complete URL in express to make the authorization callback.
The technology used by the front desk is: angular1+ui-router.
The full URL of the current page is http://www.aaa.com/wechat#! /list
expressThe URL obtained in it is: http://www.aaa.com/wechat
The method is:

var currentPage = 'http://' + req.headers.host + req.originalUrl; // Get the current request path

I looked at it as if the server could not get the value of hash. The value of.Hash is for browsers.
expressCan you get a complete URL or what packages can be obtained?

Answer 0:

Using html5Mode directly, the URL behind hash will not be able to get through the request header at the server side.
If you don’t use html5Mode, it’s on the front endlocation.hashThe value is sent to the back end.

Link of this Article: Express gets angular complete URL

Leave a Reply

Your email address will not be published. Required fields are marked *