ElementUI solving session lost when using cross-domain framework el-upload upload problem

Solution one:
1, when used elementUI cross-domain framework el-upload upload, back-end get less than a cookie, a backend interface display is not logged in, still do not take effect after the addition of a with-credentials = "true"

Front-end will report the above error, solution: * No change to the rear end of the httpServletRequest.getHeader ( "Origin")

Solution two:
1, the index.js file in the config directory open, modify settings proxyTable property:

Taking into account this path may need to modify this target, so the package needs to be packaged up separately, and here I built a targetUrl.js, on the static folder

var targetUrl = 'http://192.168.70.70:8088/sc-MDC';

module.exports = {
  targetUrl
}

Introduced index.js file in the config directory

const targetUrl = require('../static/targetUrl')

2, at the interface file upload tune, modify the interface address, the domain name will be replaced before the api

Guess you like

Origin www.cnblogs.com/fangnianqin/p/11193848.html