- 优化 undefined 情况

This commit is contained in:
sin 2019-03-04 11:34:08 +08:00
parent 192a1b8850
commit 171cf5b996

View File

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