未验证 提交 2302eabc 编写于 作者: O O-ll-O 提交者: GitHub

Fix: Update localtime.ts (#352)

if  bankend services info is Empty ,browser have a error :res.data.data.getTimeInfo.timezone undefined
Co-authored-by: wu-sheng's avatar吴晟 Wu Sheng <wu.sheng@foxmail.com>
上级 28b7ea74
......@@ -37,8 +37,9 @@ export const queryOAPTimeInfo = async () => {
let utc = window.localStorage.getItem('utc');
if (!utc) {
const res: AxiosResponse = await graph.query('queryOAPTimeInfo').params({});
if (!res.data) {
if (!res.data || !res.data.data || !res.data.data.getTimeInfo || !res.data.data.getTimeInfo.timezone) {
setTimezoneOffset();
return;
}
utc = res.data.data.getTimeInfo.timezone / 100 + '';
window.localStorage.setItem('utc', utc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册