mirror of
https://github.com/caojiezi2003/live2d-widget.git
synced 2024-11-10 04:49:47 +00:00
Use location.host
This commit is contained in:
parent
e89dde2466
commit
33a10c6d64
@ -69,7 +69,7 @@ function loadWidget(waifuPath, apiPath) {
|
||||
registerEventListener();
|
||||
|
||||
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) { //如果是主页
|
||||
var now = new Date().getHours();
|
||||
if (now > 5 && now <= 7) text = "早上好!一日之计在于晨,美好的一天就要开始了。";
|
||||
|
Loading…
Reference in New Issue
Block a user