- 优化 undefined 情况

pull/1/head
sin 2019-03-04 11:34:08 +08:00
parent 192a1b8850
commit 171cf5b996
1 changed files with 3 additions and 1 deletions

View File

@ -108,7 +108,9 @@ export default function request(url, option) {
// 将登陆的 accessToken 放到 header // 将登陆的 accessToken 放到 header
const loginToken = getLoginToken(); const loginToken = getLoginToken();
if (loginToken && loginToken.accessToken) {
newOptions.headers.Authorization = loginToken.accessToken; newOptions.headers.Authorization = loginToken.accessToken;
}
const expirys = options.expirys && 60; const expirys = options.expirys && 60;
// options.expirys !== false, return the cache, // options.expirys !== false, return the cache,