Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么添加 withCredentials? #7

Closed
consilient-hengtian opened this issue Jun 19, 2017 · 1 comment
Closed

怎么添加 withCredentials? #7

consilient-hengtian opened this issue Jun 19, 2017 · 1 comment

Comments

@consilient-hengtian
Copy link

No description provided.

@greengerong
Copy link
Collaborator

greengerong commented Jun 20, 2017

可以选择在拦截器中添加 withCredentials,或者是class级别 @DefaultHeaders(headers: Object)、方法级别@Header(key: string)添加。

 @Cacheable({ pool: 'articles' })
 @GET('article')
 fetchArticles(@Query('pageIndex') pageIndex = 1,
            @Query('pageSize') pageSize = 10,
            @Header('withCredentials')  withCredentials: boolean,
            @Query('keyword') keyword?: string): Observable<SearchResult<Article>> {
       return null;
  }

或者:

@Injectable()
@DefaultHeaders({
       withCredentials: true
 })
 export class OnlineArticleService extends RebirthHttp implements IArticleService {

  }

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants