mirror of
https://github.com/stevenjoezhang/live2d-widget.git
synced 2024-11-25 22:31:30 +08:00
Use location.host
This commit is contained in:
parent
e89dde2466
commit
33a10c6d64
@ -69,7 +69,7 @@ function loadWidget(waifuPath, apiPath) {
|
|||||||
registerEventListener();
|
registerEventListener();
|
||||||
|
|
||||||
function welcomeMessage() {
|
function welcomeMessage() {
|
||||||
var SiteIndexUrl = location.port ? `${location.protocol}//${location.hostname}:${location.port}/` : `${location.protocol}//${location.hostname}/`, text; //自动获取主页
|
var SiteIndexUrl = `${location.protocol}//${location.host}/`, text; //自动获取主页
|
||||||
if (location.href == SiteIndexUrl) { //如果是主页
|
if (location.href == SiteIndexUrl) { //如果是主页
|
||||||
var now = new Date().getHours();
|
var now = new Date().getHours();
|
||||||
if (now > 5 && now <= 7) text = "早上好!一日之计在于晨,美好的一天就要开始了。";
|
if (now > 5 && now <= 7) text = "早上好!一日之计在于晨,美好的一天就要开始了。";
|
||||||
|
Loading…
Reference in New Issue
Block a user