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,45 @@
.form-box {
position: fixed;
top: 2.5em;
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 .register-box {
text-align: center;
margin-top: 1em;
}
@media screen and (max-width: 512px) {
form {
width: 80%;
margin-left: -40%;
}
}
.disabled {
color: #ccc !important;
}
/*# sourceMappingURL=index.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACI,eAAA;EACA,UAAA;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,eAAA;;AAIF,mBAAqC;EACjC;IACI,UAAA;IACA,iBAAA;;;AAIR;EACC,WAAA","file":"index.css"}

View File

@@ -0,0 +1,71 @@
<!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?v=1.0.0"></script>
{$if not (eq .themeBackgroundColor "")}
<style>
.button.primary {
background: #{$.themeBackgroundColor} !important;
}
</style>
{$end}
</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="usernamePlaceholder" 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-show="showOTP">
<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 v-if="canRegister" class="register-box">
<a href="/register">注册新用户<span v-if="!canResetPassword">&nbsp; &raquo;</span></a><span v-if="canResetPassword"> &nbsp; <span class="disabled">|</span> &nbsp; <a href="/account/reset">找回密码</a></span>
</div>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,63 @@
Tea.context(function () {
this.username = "";
this.password = "";
this.passwordMd5 = "";
this.encodedFrom = window.encodeURIComponent(this.from);
this.showOTP = false
this.isSubmitting = false
this.$delay(function () {
this.$find("form input[name='username']").focus();
this.changePassword();
})
this.usernamePlaceholder = "请输入用户名"
var loginMethods = []
if (this.emailCanLogin) {
loginMethods.push("邮箱")
}
if (this.mobileCanLogin) {
loginMethods.push("手机号码")
}
if (loginMethods.length > 0) {
this.usernamePlaceholder += "/" + loginMethods.join("/")
}
this.changeUsername = function () {
this.$post("/checkOTP")
.params({
username: this.username
})
.success(function (resp) {
this.showOTP = resp.data.requireOTP
})
}
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 () {
if (this.from.length == 0) {
window.location = "/dashboard";
} else {
window.location = this.from;
}
}
})

View File

@@ -0,0 +1,51 @@
.form-box {
position: fixed;
top: 2.5em;
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;
}
.register-box {
text-align: center;
margin-top: 1em;
}
}
@media screen and (max-width: 512px) {
form {
width: 80%;
margin-left: -40%;
}
}
.disabled {
color: #ccc !important;
}