Skip to content

为什么我用了 没有覆盖cors的配置呀 #2

@dirtypool96

Description

@dirtypool96

exports.cors = {
enable: true,
package: 'egg-cors',
};

exports.origin = {
enable: true,
package: 'egg-origin',
};


config.origin = {
whiteList: [ 'http://admin.dirtypool.top', 'http://blog.dirtypool.top' ],
};

config.security = {
csrf: {
enable: false,
},
domainWhiteList: ['*'],
};

config.cors = {
// 跨域带Cookie Origin不能为*
origin: [],
credentials: true, // 允许Cookie跨域
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions