This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
.form-box {
position: fixed;
top: 2em;
bottom: 0;
left: 0;
right: 0;
}
form {
position: fixed;
width: 21em;
top: 50%;
left: 50%;
margin-left: -10em;
margin-top: -16em;
}
form .header {
text-align: center;
font-size: 1em !important;
}
form p {
font-size: 0.8em;
margin-top: 0.3em;
margin-bottom: 0;
font-weight: normal;
padding: 0;
}
form .comment {
margin-top: 0.5em;
padding: 0.5em;
color: gray;
}
@media screen and (max-width: 512px) {
form {
width: 80%;
margin-left: -40%;
}
}
/*# sourceMappingURL=index.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACI,eAAA;EACA,QAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;;AAGJ;EACI,eAAA;EACA,WAAA;EACA,QAAA;EACA,SAAA;EACA,kBAAA;EACA,iBAAA;;AANJ,IAQC;EACC,kBAAA;EACA,yBAAA;;AAVF,IAaC;EACC,gBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,UAAA;;AAlBF,IAqBC;EACC,iBAAA;EACA,cAAA;EACA,WAAA;;AASD,mBALoC;EACjC;IACI,UAAA;IACA,iBAAA","file":"index.css"}

View File

@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
{$if eq .faviconFileId 0}
<link rel="shortcut icon" href="/images/favicon.png"/>
{$else}
<link rel="shortcut icon" href="/ui/image/{$ .faviconFileId}"/>
{$end}
<title>登录{$ htmlEncode .systemName}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
{$TEA.VUE}
{$TEA.SEMANTIC}
<script type="text/javascript" src="/js/md5.min.js"></script>
<script type="text/javascript" src="/js/utils.min.js"></script>
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
<script type="text/javascript" src="/js/components.js"></script>
</head>
<body style="background-image: url(/images/bg.jpg);width: 100% !important;height: 100% !important;background-size: cover !important;">
<div>
{$template "/menu"}
<div class="form-box">
<form method="post" class="ui form" data-tea-action="$" data-tea-before="submitBefore" data-tea-done="submitDone" data-tea-success="submitSuccess" autocomplete="off">
<csrf-token></csrf-token>
<input type="hidden" name="password" v-model="passwordMd5"/>
<input type="hidden" name="token" v-model="token"/>
<div class="ui segment stacked">
<div class="ui header">
登录{$ htmlEncode .systemName}
</div>
<div class="ui field">
<div class="ui left icon input">
<i class="ui user icon small"></i>
<input type="text" name="username" v-model="username" placeholder="请输入用户名" maxlength="200" ref="usernameRef" @input="changeUsername"/>
</div>
</div>
<div class="ui field">
<div class="ui left icon input">
<i class="ui lock icon small"></i>
<input type="password" v-model="password" placeholder="请输入密码" maxlength="200" @input="changePassword()" ref="passwordRef"/>
</div>
</div>
<div class="ui field" v-if="rememberLogin">
<a href="" @click.prevent="showMoreOptions()">更多选项 <i class="icon angle" :class="{down:!moreOptionsVisible, up:moreOptionsVisible}"></i> </a>
</div>
<div class="ui field" v-if="rememberLogin" v-show="moreOptionsVisible">
<div class="ui checkbox">
<input type="checkbox" name="remember" value="1" checked="checked"/>
<label>在这个电脑上记住登录14天</label>
</div>
</div>
<button class="ui button primary fluid" type="submit" v-if="!isSubmitting">登录</button>
<button class="ui button primary fluid disabled" type="submit" v-if="isSubmitting">登录中...</button>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,59 @@
Tea.context(function () {
this.username = ""
this.password = ""
this.passwordMd5 = ""
this.encodedFrom = window.encodeURIComponent(this.from)
if (this.isDemo) {
this.username = "admin"
this.password = "123456"
}
this.isSubmitting = false
this.$delay(function () {
this.$find("form input[name='username']").focus()
this.changePassword()
});
this.changeUsername = function () {
}
this.changePassword = function () {
this.passwordMd5 = md5(this.password.trim());
};
// 更多选项
this.moreOptionsVisible = false;
this.showMoreOptions = function () {
this.moreOptionsVisible = !this.moreOptionsVisible;
};
this.submitBefore = function () {
this.isSubmitting = true;
};
this.submitDone = function () {
this.isSubmitting = false;
};
this.submitSuccess = function (resp) {
// store information to local
localStorage.setItem("sid", resp.data.localSid)
localStorage.setItem("ip", resp.data.ip)
// redirect back
this.$delay(function () {
if (resp.data.requireOTP) {
window.location = "/index/otp?sid=" + resp.data.sid + "&remember=" + (resp.data.remember ? 1 : 0) + "&from=" + window.encodeURIComponent(this.from)
return
}
if (this.from.length == 0) {
window.location = "/dashboard";
} else {
window.location = this.from;
}
})
};
});

View File

@@ -0,0 +1,42 @@
.form-box {
position: fixed;
top: 2em;
bottom: 0;
left: 0;
right: 0;
}
form {
position: fixed;
width: 21em;
top: 50%;
left: 50%;
margin-left: -10em;
margin-top: -16em;
.header {
text-align: center;
font-size: 1em !important;
}
p {
font-size: 0.8em;
margin-top: 0.3em;
margin-bottom: 0;
font-weight: normal;
padding: 0;
}
.comment {
margin-top: 0.5em;
padding: 0.5em;
color: gray;
}
}
@media screen and (max-width: 512px) {
form {
width: 80%;
margin-left: -40%;
}
}

View File

@@ -0,0 +1,38 @@
.form-box {
position: fixed;
top: 2em;
bottom: 0;
left: 0;
right: 0;
}
form {
position: fixed;
width: 21em;
top: 50%;
left: 50%;
margin-left: -10em;
margin-top: -16em;
}
form .header {
text-align: center;
font-size: 1em !important;
}
form p {
font-size: 0.8em;
margin-top: 0.3em;
margin-bottom: 0;
font-weight: normal;
padding: 0;
}
form .comment {
margin-top: 0.5em;
padding: 0.5em;
color: gray;
}
@media screen and (max-width: 512px) {
form {
width: 80%;
margin-left: -40%;
}
}
/*# sourceMappingURL=initPassword.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["initPassword.less"],"names":[],"mappings":"AAAA;EACI,eAAA;EACA,QAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;;AAGJ;EACI,eAAA;EACA,WAAA;EACA,QAAA;EACA,SAAA;EACA,kBAAA;EACA,iBAAA;;AANJ,IAQC;EACC,kBAAA;EACA,yBAAA;;AAVF,IAaC;EACC,gBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,UAAA;;AAlBF,IAqBC;EACC,iBAAA;EACA,cAAA;EACA,WAAA;;AAIF,mBAAqC;EACjC;IACI,UAAA;IACA,iBAAA","file":"initPassword.css"}

View File

@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>初始化系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
{$TEA.VUE}
{$TEA.SEMANTIC}
<script type="text/javascript" src="/js/md5.min.js"></script>
<script type="text/javascript" src="/js/utils.min.js"></script>
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
<script type="text/javascript" src="/js/components.js"></script>
</head>
<body>
<div>
<div class="form-box">
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success" autocomplete="off">
<csrf-token></csrf-token>
<div class="ui segment stacked">
<div class="ui header">
设置管理员初始密码
<p class="comment">由于你是第一次登录,所以需要设置管理员用户名和密码。</p>
</div>
<div class="ui field">
<div class="ui left icon input">
<i class="ui user icon small"></i>
<input type="text" name="username" v-model="username" placeholder="请输入用户名" maxlength="200" />
</div>
</div>
<div class="ui field">
<div class="ui left icon input">
<i class="ui lock icon small"></i>
<input type="text" name="password" placeholder="请输入密码" maxlength="200" v-model="password"/>
</div>
</div>
<button class="ui button primary fluid" type="submit">保存用户名密码</button>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,7 @@
Tea.context(function () {
this.success = function () {
teaweb.success("用户名和密码保存成功,现在去登录", function () {
window.location = "/"
})
}
})

View File

@@ -0,0 +1,42 @@
.form-box {
position: fixed;
top: 2em;
bottom: 0;
left: 0;
right: 0;
}
form {
position: fixed;
width: 21em;
top: 50%;
left: 50%;
margin-left: -10em;
margin-top: -16em;
.header {
text-align: center;
font-size: 1em !important;
}
p {
font-size: 0.8em;
margin-top: 0.3em;
margin-bottom: 0;
font-weight: normal;
padding: 0;
}
.comment {
margin-top: 0.5em;
padding: 0.5em;
color: gray;
}
}
@media screen and (max-width: 512px) {
form {
width: 80%;
margin-left: -40%;
}
}

View File

@@ -0,0 +1,42 @@
.form-box {
position: fixed;
top: 2em;
bottom: 0;
left: 0;
right: 0;
}
form {
position: fixed;
width: 21em;
top: 50%;
left: 50%;
margin-left: -10em;
margin-top: -16em;
}
form .header {
text-align: center;
font-size: 1em !important;
}
form p {
font-size: 0.8em;
margin-top: 0.3em;
margin-bottom: 0;
font-weight: normal;
padding: 0;
}
form .comment {
margin-top: 0.5em;
padding: 0.5em;
color: gray;
}
form .cancel-login {
text-align: center;
padding-top: 1em;
}
@media screen and (max-width: 512px) {
form {
width: 80%;
margin-left: -40%;
}
}
/*# sourceMappingURL=otp.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["otp.less"],"names":[],"mappings":"AAAA;EACI,eAAA;EACA,QAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;;AAGJ;EACI,eAAA;EACA,WAAA;EACA,QAAA;EACA,SAAA;EACA,kBAAA;EACA,iBAAA;;AANJ,IAQC;EACC,kBAAA;EACA,yBAAA;;AAVF,IAaC;EACC,gBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,UAAA;;AAlBF,IAqBC;EACC,iBAAA;EACA,cAAA;EACA,WAAA;;AAxBF,IA2BC;EACC,kBAAA;EACA,gBAAA;;AAIF,mBAAqC;EACjC;IACI,UAAA;IACA,iBAAA","file":"otp.css"}

View File

@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
{$if eq .faviconFileId 0}
<link rel="shortcut icon" href="/images/favicon.png"/>
{$else}
<link rel="shortcut icon" href="/ui/image/{$ .faviconFileId}"/>
{$end}
<title>登录{$ htmlEncode .systemName} - 二次验证</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
{$TEA.VUE}
{$TEA.SEMANTIC}
<script type="text/javascript" src="/js/md5.min.js"></script>
<script type="text/javascript" src="/js/utils.min.js"></script>
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
<script type="text/javascript" src="/js/components.js"></script>
</head>
<body>
<div>
{$template "/menu"}
<div class="form-box">
<form method="post" class="ui form" data-tea-action="$" data-tea-before="submitBefore"
data-tea-done="submitDone" data-tea-success="submitSuccess" autocomplete="off">
<input type="hidden" name="sid" :value="sid"/>
<input type="hidden" name="remember" :value="remember ? 1 : 0"/>
<div class="ui segment stacked">
<div class="ui header">
登录{$ htmlEncode .systemName}
</div>
<div class="ui field">
为了保护你的账户安全需要进行OTP二次身份验证。
</div>
<div class="ui field">
<div class="ui left icon input">
<i class="ui barcode icon"></i>
<input type="text" name="otpCode" placeholder="请输入OTP动态密码" maxlength="6"/>
</div>
</div>
<button class="ui button primary fluid" type="submit" v-if="!isSubmitting">验证</button>
<button class="ui button primary fluid disabled" type="submit" v-if="isSubmitting">验证中...</button>
<div class="ui field cancel-login">
<a :href="'/?from=' + encodedFrom">&laquo; 取消登录</a>
</div>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,38 @@
Tea.context(function () {
this.isSubmitting = false
this.encodedFrom = window.encodeURIComponent(this.from)
this.$delay(function () {
this.$find("form input[name='otpCode']").focus()
});
// 更多选项
this.moreOptionsVisible = false;
this.showMoreOptions = function () {
this.moreOptionsVisible = !this.moreOptionsVisible;
};
this.submitBefore = function () {
this.isSubmitting = true;
};
this.submitDone = function () {
this.isSubmitting = false;
};
this.submitSuccess = function (resp) {
// store information to local
localStorage.setItem("sid", resp.data.localSid)
localStorage.setItem("ip", resp.data.ip)
// redirect back
this.$delay(function () {
if (this.from.length == 0) {
window.location = "/dashboard";
} else {
window.location = this.from;
}
})
};
});

View File

@@ -0,0 +1,47 @@
.form-box {
position: fixed;
top: 2em;
bottom: 0;
left: 0;
right: 0;
}
form {
position: fixed;
width: 21em;
top: 50%;
left: 50%;
margin-left: -10em;
margin-top: -16em;
.header {
text-align: center;
font-size: 1em !important;
}
p {
font-size: 0.8em;
margin-top: 0.3em;
margin-bottom: 0;
font-weight: normal;
padding: 0;
}
.comment {
margin-top: 0.5em;
padding: 0.5em;
color: gray;
}
.cancel-login {
text-align: center;
padding-top: 1em;
}
}
@media screen and (max-width: 512px) {
form {
width: 80%;
margin-left: -40%;
}
}