umijs / umi-request

A request tool based on fetch.
2.21k stars 336 forks source link

can not get headers #297

Closed magickeyyy closed 2 years ago

magickeyyy commented 2 years ago
async login(data: { username: string; password: string }) {
        const info = await request('console-service/login', {
            method: 'POST',
            data,
            getResponse: true,
            parseResponse: false,
        }).catch(() => {});
        info?.headers.forEach((value: string, key: string) => {
            console.log(key, value);
        });
        console.log('', info?.headers.has('token'));
        return new AdminUser();
    }

就是拿不到token这个header配置

magickeyyy commented 2 years ago

服务端改配置Access-Control-Expose-Headers