From 928588368c26a1c307ab4d50bd4613f956e66722 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sun, 29 Dec 2019 14:41:16 +0800 Subject: [PATCH] Code style update --- demo/demo2.html | 4 ++-- waifu-tips.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demo/demo2.html b/demo/demo2.html index e8b0d3a..0d84afb 100755 --- a/demo/demo2.html +++ b/demo/demo2.html @@ -186,7 +186,7 @@ $(function() { fetch(`${apiPath}/rand_textures/?id=${modelId}-${modelTexturesId}`) .then(response => response.json()) .then(result => { - loadModel(modelId, result.textures["id"]); + loadModel(modelId, result.textures.id); setTimeout(function() { state = 2; $("#cover").css("bottom", "80%"); @@ -200,7 +200,7 @@ $(function() { fetch(`${apiPath}/switch/?id=${modelId}`) .then(response => response.json()) .then(result => { - loadModel(result.model["id"]); + loadModel(result.model.id); }); } diff --git a/waifu-tips.js b/waifu-tips.js index 3070831..5f2a9a7 100755 --- a/waifu-tips.js +++ b/waifu-tips.js @@ -202,9 +202,9 @@ function loadWidget(waifuPath, apiPath) { fetch(`${apiPath}/rand_textures/?id=${modelId}-${modelTexturesId}`) .then(response => response.json()) .then(result => { - if (result.textures["id"] == 1 && (modelTexturesId == 1 || modelTexturesId == 0)) showMessage("我还没有其他衣服呢!", 4000, 10); + if (result.textures.id == 1 && (modelTexturesId == 1 || modelTexturesId == 0)) showMessage("我还没有其他衣服呢!", 4000, 10); else showMessage("我的新衣服好看嘛?", 4000, 10); - loadModel(modelId, result.textures["id"]); + loadModel(modelId, result.textures.id); }); } @@ -213,8 +213,8 @@ function loadWidget(waifuPath, apiPath) { fetch(`${apiPath}/switch/?id=${modelId}`) .then(response => response.json()) .then(result => { - loadModel(result.model["id"]); - showMessage(result.model["message"], 4000, 10); + loadModel(result.model.id); + showMessage(result.model.message, 4000, 10); }); } }