mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-04 16:48:44 +08:00
add debug mode
This commit is contained in:
parent
b3b9ab2c44
commit
d88a004ed6
@ -35,9 +35,11 @@ export default class SettingsManager {
|
|||||||
await this.plugin.saveSettings();
|
await this.plugin.saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
debug(message:string) {
|
debug(message:any):any {
|
||||||
if(this.settings.debugMode) {
|
if(this.settings.debugMode) {
|
||||||
this.innerLogger.debug(message);
|
return this.innerLogger.debug(message);
|
||||||
|
}else {
|
||||||
|
return message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,9 @@ export default class UserComponent {
|
|||||||
headers: {'Cookie': cookie},
|
headers: {'Cookie': cookie},
|
||||||
throw: true
|
throw: true
|
||||||
};
|
};
|
||||||
return request(requestUrlParam)
|
this.settingsManager.debug('loadUserInfo:尝试获取用户信息:https://www.douban.com/mine/');
|
||||||
|
return request(requestUrlParam)
|
||||||
|
.then(response => this.settingsManager.settings.debugMode ? this.settingsManager.debug(response) : response)
|
||||||
.then(load)
|
.then(load)
|
||||||
.then(this.getUserInfo)
|
.then(this.getUserInfo)
|
||||||
.catch(e => log.error(i18nHelper.getMessage('130101').replace('{0}', e.toString()), e));
|
.catch(e => log.error(i18nHelper.getMessage('130101').replace('{0}', e.toString()), e));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user