mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-11-10 17:04:33 +08:00
install-reg
This commit is contained in:
parent
abee873281
commit
43deb80313
6 changed files with 91 additions and 75 deletions
|
@ -339,6 +339,11 @@ public class LoginController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
@GetMapping("site-register")
|
||||
public void reg(HttpServletResponse response) throws IOException {
|
||||
response.sendRedirect("https://getrebuild.com/market/site-register?sn=" + License.SN());
|
||||
}
|
||||
|
||||
// --
|
||||
|
||||
/**
|
||||
|
|
|
@ -149,8 +149,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12">
|
||||
<div class="alert alert-danger alert-dismissible rbv-hide">
|
||||
<button class="close" type="button" data-dismiss="alert"><i class="zmdi zmdi-close"></i></button>
|
||||
<div class="alert alert-danger bg-market rbv-hide">
|
||||
<div class="icon"><i class="zmdi zmdi-thumb-up animated tada infinite"></i></div>
|
||||
<div class="message" style="line-height: 1.3">
|
||||
<a href="https://getrebuild.com/#pricing-plans" target="_blank" class="text-white text-bold text-underline">即刻升级! 获取更多增值功能与专业技术支持</a>
|
||||
|
|
|
@ -4314,3 +4314,7 @@ pre.unstyle {
|
|||
float: right;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.bg-market {
|
||||
background-image: linear-gradient(135deg, #2973d7 0%, #26acb9 100%);
|
||||
}
|
|
@ -66,6 +66,9 @@ class Setup extends React.Component {
|
|||
}
|
||||
this.setState({ installState: 10 })
|
||||
$.post('/setup/install-rebuild', JSON.stringify(data), (res) => {
|
||||
if (res.error_code === 0) {
|
||||
$.cookie('install-reg-30d', 'yes', { expires: 30 })
|
||||
}
|
||||
this.setState({ installState: res.error_code === 0 ? 11 : 12, installError: res.error_msg })
|
||||
})
|
||||
}
|
||||
|
|
76
src/main/resources/web/assets/js/login.js
Normal file
76
src/main/resources/web/assets/js/login.js
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
|
||||
|
||||
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
|
||||
See LICENSE and COMMERCIAL in the project root for license information.
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (top != self) {
|
||||
parent.location.reload()
|
||||
return
|
||||
}
|
||||
|
||||
$('.h5-mobile img').attr('src', `${rb.baseUrl}/commons/barcode/render-qr?t=${$encode($('.h5-mobile a').attr('href'))}`)
|
||||
|
||||
if ($.browser.mobile) {
|
||||
setTimeout(() => {
|
||||
$(`<div class="bg-info"><i class="icon zmdi zmdi-smartphone-iphone"></i><p>${$L('点击切换到手机版访问')}</p></div>`)
|
||||
.appendTo('.announcement-wrapper')
|
||||
.on('click', () => (location.href = $('.h5-mobile>a').attr('href')))
|
||||
}, 500)
|
||||
} else if ($.cookie('install-reg-30d') && rb.commercial < 1) {
|
||||
// $(
|
||||
// '<div class="alert alert-danger bg-market text-center p-3"><a href="site-register" target="_blank" class="text-white font-weight-bold link">限时! 完成信息注册可免费获得增值功能包</a></div>'
|
||||
// ).prependTo('.splash-container')
|
||||
}
|
||||
|
||||
$.get('/user/live-wallpaper', (res) => {
|
||||
if (res.error_code !== 0 || !res.data) return
|
||||
|
||||
const bgimg = new Image()
|
||||
bgimg.src = res.data
|
||||
bgimg.onload = function () {
|
||||
$('.rb-bgimg').animate({ opacity: 0 })
|
||||
setTimeout(() => {
|
||||
$('.rb-bgimg').css('background-image', `url(${res.data})`).animate({ opacity: 1 })
|
||||
}, 400)
|
||||
}
|
||||
})
|
||||
|
||||
$('.vcode-row img').on('click', function () {
|
||||
$(this).attr('src', `captcha?${$random()}`)
|
||||
})
|
||||
|
||||
$('#login-form').on('submit', function (e) {
|
||||
e.preventDefault()
|
||||
|
||||
const user = $val('#user'),
|
||||
passwd = $val('#passwd'),
|
||||
vcode = $val('.vcode-row input')
|
||||
|
||||
if (!user || !passwd) return RbHighbar.create($L('请输入用户名和密码'))
|
||||
if ($('.vcode-row img').length > 0 && !vcode) return RbHighbar.create($L('请输入验证码'))
|
||||
|
||||
const $btn = $('.login-submit button').button('loading')
|
||||
const url = `/user/user-login?user=${$encode(user)}&passwd=******&autoLogin=${$val('#autoLogin')}&vcode=${vcode || ''}`
|
||||
|
||||
$.post(url, passwd, (res) => {
|
||||
if (res.error_code === 0) {
|
||||
let nexturl = $decode($urlp('nexturl') || '../dashboard/home')
|
||||
if (res.data && res.data.passwdExpiredDays < 8) {
|
||||
nexturl = `${rb.baseUrl}/settings/passwd-expired?d=${res.data.passwdExpiredDays}`
|
||||
}
|
||||
location.replace(nexturl)
|
||||
} else if (res.error_msg === 'VCODE') {
|
||||
location.reload()
|
||||
} else {
|
||||
$('.vcode-row img').trigger('click')
|
||||
$('.vcode-row input').val('')
|
||||
RbHighbar.create(res.error_msg)
|
||||
$btn.button('reset')
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
|
@ -33,7 +33,7 @@
|
|||
background: url(../assets/img/bg.jpg) no-repeat 0 0;
|
||||
background-size: cover;
|
||||
opacity: 1;
|
||||
filter: blur(2px);
|
||||
filter: blur(1px);
|
||||
}
|
||||
.rb-bgimg::before {
|
||||
content: '';
|
||||
|
@ -199,77 +199,6 @@
|
|||
<div th:if="${pageFooter != null}" class="page-footer">[(${pageFooter})]</div>
|
||||
<th:block th:replace="~{/_include/footer}" />
|
||||
<script th:src="@{/assets/js/feeds/announcement.js}" type="text/babel"></script>
|
||||
<script type="text/babel">
|
||||
$(document).ready(function () {
|
||||
if (top != self) {
|
||||
parent.location.reload()
|
||||
return
|
||||
}
|
||||
|
||||
$('.h5-mobile img').attr('src', `${rb.baseUrl}/commons/barcode/render-qr?t=${$encode($('.h5-mobile a').attr('href'))}`)
|
||||
|
||||
if ($.browser.mobile) {
|
||||
setTimeout(function () {
|
||||
$(`<div class="bg-info"><i class="icon zmdi zmdi-smartphone-iphone"></i><p>${$L('点击切换到手机版访问')}</p></div>`)
|
||||
.appendTo('.announcement-wrapper')
|
||||
.on('click', () => (location.href = $('.h5-mobile>a').attr('href')))
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
$('.vcode-row img').on('click', function () {
|
||||
$(this).attr('src', 'captcha?' + $random())
|
||||
})
|
||||
|
||||
$('#login-form').on('submit', function (e) {
|
||||
e.preventDefault()
|
||||
const user = $val('#user'),
|
||||
passwd = $val('#passwd'),
|
||||
vcode = $val('.vcode-row input')
|
||||
if (!user || !passwd) {
|
||||
RbHighbar.create($L('请输入用户名和密码'))
|
||||
return
|
||||
}
|
||||
if ($('.vcode-row img').length > 0 && !vcode) {
|
||||
RbHighbar.create($L('请输入验证码'))
|
||||
return
|
||||
}
|
||||
|
||||
const $btn = $('.login-submit button').button('loading')
|
||||
let url = '/user/user-login?user=' + $encode(user) + '&passwd=******&autoLogin=' + $val('#autoLogin')
|
||||
if (!!vcode) url += '&vcode=' + vcode
|
||||
|
||||
$.post(url, passwd, function (res) {
|
||||
if (res.error_code === 0) {
|
||||
let nexturl = $decode($urlp('nexturl') || '../dashboard/home')
|
||||
if (res.data && res.data.passwdExpiredDays < 8) {
|
||||
nexturl = '../settings/passwd-expired?d=' + res.data.passwdExpiredDays
|
||||
}
|
||||
location.replace(nexturl)
|
||||
} else if (res.error_msg === 'VCODE') {
|
||||
location.reload()
|
||||
} else {
|
||||
$('.vcode-row img').trigger('click')
|
||||
$('.vcode-row input').val('')
|
||||
RbHighbar.create(res.error_msg)
|
||||
$btn.button('reset')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
$.get('/user/live-wallpaper', (res) => {
|
||||
if (res.error_code !== 0 || !res.data) return
|
||||
const bgimg = new Image()
|
||||
bgimg.src = res.data
|
||||
bgimg.onload = function () {
|
||||
$('.rb-bgimg').animate({ opacity: 0 })
|
||||
setTimeout(function () {
|
||||
$('.rb-bgimg')
|
||||
.css('background-image', 'url(' + res.data + ')')
|
||||
.animate({ opacity: 1 })
|
||||
}, 400)
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<script th:src="@{/assets/js/login.js}" type="text/babel"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue