437 lines
19 KiB
Smarty
437 lines
19 KiB
Smarty
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="robots" content="noindex, nofollow">
|
|
<title>统一认证中心 - 找回密码</title>
|
|
<style>
|
|
:root {
|
|
--primary: #3973ff;
|
|
--primary-dark: #2560a9;
|
|
--text: #1f2b48;
|
|
--text-sub: #5b6780;
|
|
--muted: #8a94ad;
|
|
--border: #e3e9f5;
|
|
--radius: 12px;
|
|
}
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
html, body { height: 100%; }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
|
color: var(--text);
|
|
background: linear-gradient(120deg, #eef4ff 0%, #f7fbff 55%, #eaf3ff 100%);
|
|
min-height: 100vh;
|
|
display: flex; align-items: center; justify-content: center;
|
|
padding: 32px 20px;
|
|
position: relative; overflow-x: hidden;
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
.glow { position: fixed; border-radius: 50%; filter: blur(60px); pointer-events: none; z-index: 0; }
|
|
.glow-1 { width: 380px; height: 380px; top: -120px; left: -100px; background: rgba(82, 168, 255, 0.28); }
|
|
.glow-2 { width: 320px; height: 320px; bottom: -120px; right: -80px; background: rgba(57, 115, 255, 0.20); }
|
|
.auth-card {
|
|
position: relative; z-index: 1;
|
|
display: flex;
|
|
width: 100%; max-width: 940px; min-height: 560px;
|
|
background: #fff; border-radius: 22px;
|
|
box-shadow: 0 18px 50px 0 rgba(37, 96, 169, 0.14), 0 2px 6px 0 rgba(31, 43, 72, 0.04);
|
|
overflow: hidden;
|
|
}
|
|
.auth-side {
|
|
width: 340px; flex: 0 0 340px;
|
|
padding: 44px 34px 28px;
|
|
background: linear-gradient(160deg, #1b3b8f 0%, #2f6fe4 52%, #52a8ff 100%);
|
|
color: #fff;
|
|
display: flex; flex-direction: column;
|
|
position: relative; overflow: hidden;
|
|
}
|
|
.auth-side::before {
|
|
content: ''; position: absolute; width: 260px; height: 260px;
|
|
top: -90px; right: -110px; border-radius: 50%; background: rgba(255, 255, 255, 0.10);
|
|
}
|
|
.auth-side::after {
|
|
content: ''; position: absolute; width: 190px; height: 190px;
|
|
bottom: -70px; left: -60px; border-radius: 50%; background: rgba(255, 255, 255, 0.08);
|
|
}
|
|
.brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
|
|
.brand-logo {
|
|
width: 40px; height: 40px; border-radius: 11px;
|
|
background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.30);
|
|
display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
|
|
}
|
|
.brand-logo svg { width: 22px; height: 22px; }
|
|
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
|
|
.side-title { margin-top: 44px; font-size: 26px; font-weight: 600; line-height: 1.45; position: relative; z-index: 1; }
|
|
.side-desc {
|
|
margin-top: 12px; font-size: 13.5px; line-height: 1.9;
|
|
color: rgba(255, 255, 255, 0.76); position: relative; z-index: 1;
|
|
}
|
|
.side-illus { margin: auto 0; padding: 22px 0; position: relative; z-index: 1; }
|
|
.side-illus svg { width: 100%; height: auto; display: block; }
|
|
.side-foot {
|
|
position: relative; z-index: 1;
|
|
padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.16);
|
|
font-size: 12px; color: rgba(255, 255, 255, 0.62);
|
|
display: flex; align-items: center; gap: 6px;
|
|
}
|
|
.side-foot svg { width: 13px; height: 13px; }
|
|
.auth-main {
|
|
flex: 1; min-width: 0;
|
|
padding: 52px 56px 40px;
|
|
display: flex; flex-direction: column; justify-content: center;
|
|
}
|
|
.panel-head { margin-bottom: 26px; }
|
|
.panel-title { font-size: 26px; font-weight: 600; letter-spacing: .5px; }
|
|
.panel-sub { margin-top: 9px; font-size: 13.5px; color: var(--text-sub); line-height: 1.7; }
|
|
.error {
|
|
display: none; align-items: flex-start; gap: 9px;
|
|
background: #fff2f0; border: 1px solid #ffd4cf; color: #cf1322;
|
|
padding: 11px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6;
|
|
margin-bottom: 18px; animation: shake .32s ease;
|
|
}
|
|
.error.show { display: flex; }
|
|
.error svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }
|
|
@keyframes shake {
|
|
0%, 100% { transform: translateX(0); }
|
|
25% { transform: translateX(-4px); }
|
|
75% { transform: translateX(4px); }
|
|
}
|
|
.field { margin-bottom: 16px; }
|
|
.field-label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-sub); margin-bottom: 8px; font-weight: 500; }
|
|
.input-wrap { position: relative; }
|
|
.input-icon {
|
|
position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
|
|
width: 18px; height: 18px; color: #a7b1c7; pointer-events: none; transition: color .2s;
|
|
}
|
|
.input-wrap input {
|
|
width: 100%; height: 46px;
|
|
padding: 0 44px 0 42px;
|
|
font-size: 14px; color: var(--text);
|
|
border: 1px solid var(--border); border-radius: var(--radius);
|
|
background: #fbfcff; outline: none;
|
|
transition: border-color .2s, box-shadow .2s, background .2s;
|
|
}
|
|
.input-wrap input::placeholder { color: #adb6c9; }
|
|
.input-wrap input:focus {
|
|
border-color: var(--primary); background: #fff;
|
|
box-shadow: 0 0 0 4px rgba(57, 115, 255, 0.12);
|
|
}
|
|
.eye-btn {
|
|
position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
|
|
width: 32px; height: 32px; border: none; background: transparent; border-radius: 8px;
|
|
color: #a7b1c7; cursor: pointer;
|
|
display: flex; align-items: center; justify-content: center;
|
|
transition: color .2s, background .2s;
|
|
}
|
|
.eye-btn:hover { color: var(--primary); background: #f0f5ff; }
|
|
.eye-btn svg { width: 18px; height: 18px; }
|
|
.code-btn {
|
|
position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
|
|
height: 32px; padding: 0 14px;
|
|
border: none; border-radius: 8px; cursor: pointer;
|
|
background: var(--primary); color: #fff; font-size: 12.5px;
|
|
transition: opacity .2s, background .2s;
|
|
}
|
|
.code-btn:hover:not(:disabled) { background: var(--primary-dark); }
|
|
.code-btn:disabled { background: #c3cdf0; cursor: not-allowed; }
|
|
.link { color: var(--primary); text-decoration: none; cursor: pointer; transition: color .2s; }
|
|
.link:hover { color: var(--primary-dark); text-decoration: underline; }
|
|
.btn {
|
|
width: 100%; height: 46px; border: none; border-radius: var(--radius);
|
|
cursor: pointer;
|
|
background: linear-gradient(135deg, #3973ff 0%, #52a8ff 100%);
|
|
color: #fff; font-size: 15.5px; font-weight: 500; letter-spacing: 2px;
|
|
display: flex; align-items: center; justify-content: center; gap: 8px;
|
|
box-shadow: 0 8px 20px rgba(57, 115, 255, 0.28);
|
|
transition: transform .15s, box-shadow .2s, opacity .2s;
|
|
margin-top: 6px;
|
|
}
|
|
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(57, 115, 255, 0.34); }
|
|
.btn:disabled { opacity: .72; cursor: not-allowed; box-shadow: none; }
|
|
.spinner {
|
|
display: none; width: 16px; height: 16px;
|
|
border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff;
|
|
border-radius: 50%; animation: spin .7s linear infinite;
|
|
}
|
|
.btn.is-loading .spinner { display: block; }
|
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
.back { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text-sub); }
|
|
.foot-tip {
|
|
margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--border);
|
|
font-size: 12px; color: var(--muted);
|
|
display: flex; align-items: center; gap: 6px;
|
|
}
|
|
.foot-tip svg { width: 13px; height: 13px; flex: 0 0 auto; }
|
|
@media (max-width: 900px) {
|
|
body { padding: 20px 14px; align-items: flex-start; }
|
|
.auth-card { max-width: 520px; min-height: 0; flex-direction: column; }
|
|
.auth-side { width: 100%; flex: none; padding: 30px 26px 24px; }
|
|
.side-title { margin-top: 26px; font-size: 21px; }
|
|
.side-illus { display: none; }
|
|
.auth-main { padding: 34px 26px 30px; }
|
|
.panel-title { font-size: 22px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="glow glow-1"></div>
|
|
<div class="glow glow-2"></div>
|
|
|
|
<div class="auth-card">
|
|
<aside class="auth-side">
|
|
<div class="brand">
|
|
<span class="brand-logo">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M12 3l7 3v6c0 4.2-2.9 7.6-7 9-4.1-1.4-7-4.8-7-9V6l7-3z"/>
|
|
<path d="M9.2 12.2l2 2 3.6-4"/>
|
|
</svg>
|
|
</span>
|
|
<span class="brand-name">温新云统一认证中心</span>
|
|
</div>
|
|
|
|
<div class="side-title">找回登录密码</div>
|
|
<div class="side-desc">
|
|
通过注册手机号验证身份后即可重置密码;<br>
|
|
统一认证下密码只有一份,<br>
|
|
重置后您在所有企业的登录密码同步更新。
|
|
</div>
|
|
|
|
<div class="side-illus">
|
|
<svg viewBox="0 0 260 170" fill="none">
|
|
<ellipse cx="130" cy="150" rx="98" ry="11" fill="rgba(255,255,255,.13)"/>
|
|
<rect x="76" y="30" width="108" height="76" rx="12" fill="rgba(255,255,255,.14)" stroke="rgba(255,255,255,.4)" stroke-width="1.6"/>
|
|
<path d="M104 62v-8a26 26 0 0152 0v8" stroke="rgba(255,255,255,.7)" stroke-width="4.5" stroke-linecap="round"/>
|
|
<rect x="98" y="62" width="64" height="34" rx="8" fill="rgba(255,255,255,.3)"/>
|
|
<circle cx="130" cy="79" r="5" fill="rgba(255,255,255,.85)"/>
|
|
<path d="M130 82v7" stroke="rgba(255,255,255,.85)" stroke-width="3.5" stroke-linecap="round"/>
|
|
</svg>
|
|
</div>
|
|
|
|
<div class="side-foot">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
<rect x="4" y="11" width="16" height="10" rx="2"/>
|
|
<path d="M8 11V8a4 4 0 018 0v3"/>
|
|
</svg>
|
|
<span>© 2026 Yunzer · 连接已加密</span>
|
|
</div>
|
|
</aside>
|
|
|
|
<main class="auth-main">
|
|
<div class="panel-head">
|
|
<h1 class="panel-title">找回密码</h1>
|
|
<p class="panel-sub">请输入注册手机号,通过短信验证后设置新密码</p>
|
|
</div>
|
|
|
|
<div class="error" id="error">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
<circle cx="12" cy="12" r="9"/><path d="M12 8v5M12 16h.01"/>
|
|
</svg>
|
|
<span id="errorText"></span>
|
|
</div>
|
|
|
|
<form id="resetForm" onsubmit="return submitReset(event)">
|
|
<div class="field">
|
|
<label class="field-label" for="phone">注册手机号</label>
|
|
<div class="input-wrap">
|
|
<input id="phone" type="tel" placeholder="请输入注册时使用的手机号" maxlength="11" autofocus>
|
|
<svg class="input-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="7" y="2" width="10" height="20" rx="2.5"/><path d="M11 18.5h2"/>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label class="field-label" for="code">短信验证码</label>
|
|
<div class="input-wrap">
|
|
<input id="code" type="text" placeholder="请输入验证码" maxlength="6" style="padding-right:110px">
|
|
<svg class="input-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M3 8l9 6 9-6"/><rect x="3" y="5" width="18" height="14" rx="2.5"/>
|
|
</svg>
|
|
<button class="code-btn" type="button" id="codeBtn" onclick="sendCode()">获取验证码</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label class="field-label" for="password">新密码</label>
|
|
<div class="input-wrap">
|
|
<input id="password" type="password" placeholder="至少 6 位" autocomplete="new-password">
|
|
<svg class="input-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V8a4 4 0 018 0v3"/>
|
|
</svg>
|
|
<button class="eye-btn" type="button" onclick="togglePassword('password', this)" title="显示密码" aria-label="显示密码">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M2 12s3.6-6 10-6 10 6 10 6-3.6 6-10 6-10-6-10-6z"/><circle cx="12" cy="12" r="3"/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label class="field-label" for="confirm">确认新密码</label>
|
|
<div class="input-wrap">
|
|
<input id="confirm" type="password" placeholder="请再次输入新密码" autocomplete="new-password">
|
|
<svg class="input-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V8a4 4 0 018 0v3"/>
|
|
</svg>
|
|
<button class="eye-btn" type="button" onclick="togglePassword('confirm', this)" title="显示密码" aria-label="显示密码">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M2 12s3.6-6 10-6 10 6 10 6-3.6 6-10 6-10-6-10-6z"/><circle cx="12" cy="12" r="3"/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<button class="btn" id="submitBtn" type="submit">
|
|
<span class="spinner"></span>
|
|
<span id="btnLabel">重置密码</span>
|
|
</button>
|
|
</form>
|
|
|
|
<div class="back">想起密码了?<a class="link" id="backLogin" href="/auth/login">返回登录</a></div>
|
|
|
|
<div class="foot-tip">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M12 3l7 3v6c0 4.2-2.9 7.6-7 9-4.1-1.4-7-4.8-7-9V6l7-3z"/>
|
|
</svg>
|
|
<span>如手机号已停用,请联系企业管理员协助处理</span>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<script>
|
|
var CLIENT_ID = "{{.ClientID}}";
|
|
var REDIRECT = "{{.Redirect}}";
|
|
|
|
(function initBackLink() {
|
|
var params = new URLSearchParams();
|
|
if (CLIENT_ID) params.set('client_id', CLIENT_ID);
|
|
if (REDIRECT) params.set('redirect', REDIRECT);
|
|
var qs = params.toString();
|
|
document.getElementById('backLogin').href = '/auth/login' + (qs ? '?' + qs : '');
|
|
})();
|
|
|
|
function showError(msg) {
|
|
var box = document.getElementById('error');
|
|
document.getElementById('errorText').textContent = msg;
|
|
box.classList.remove('show');
|
|
void box.offsetWidth;
|
|
box.classList.add('show');
|
|
}
|
|
|
|
function hideError() {
|
|
var box = document.getElementById('error');
|
|
if (box) box.classList.remove('show');
|
|
}
|
|
|
|
function togglePassword(id, btn) {
|
|
var input = document.getElementById(id);
|
|
var show = input.type === 'password';
|
|
input.type = show ? 'text' : 'password';
|
|
btn.title = show ? '隐藏密码' : '显示密码';
|
|
}
|
|
|
|
var codeTimer = null;
|
|
function setCodeBtnCountdown(sec) {
|
|
var btn = document.getElementById('codeBtn');
|
|
if (codeTimer) { clearInterval(codeTimer); codeTimer = null; }
|
|
btn.disabled = true;
|
|
var left = sec;
|
|
btn.textContent = left + 's 后重发';
|
|
codeTimer = setInterval(function () {
|
|
left--;
|
|
if (left <= 0) {
|
|
clearInterval(codeTimer); codeTimer = null;
|
|
btn.disabled = false;
|
|
btn.textContent = '重新获取';
|
|
} else {
|
|
btn.textContent = left + 's 后重发';
|
|
}
|
|
}, 1000);
|
|
}
|
|
|
|
function sendCode() {
|
|
hideError();
|
|
var phone = document.getElementById('phone').value.trim();
|
|
if (!/^1[3-9]\d{9}$/.test(phone)) { showError('请输入正确的手机号'); return; }
|
|
|
|
var btn = document.getElementById('codeBtn');
|
|
btn.disabled = true;
|
|
btn.textContent = '发送中...';
|
|
|
|
fetch('/auth/forgot/send-code', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({ phone: phone })
|
|
})
|
|
.then(function (r) { return r.json(); })
|
|
.then(function (res) {
|
|
if (res.code !== 200) {
|
|
showError(res.msg || '验证码发送失败');
|
|
btn.disabled = false;
|
|
btn.textContent = '重新获取';
|
|
return;
|
|
}
|
|
setCodeBtnCountdown(60);
|
|
})
|
|
.catch(function () {
|
|
showError('网络异常,请稍后重试');
|
|
btn.disabled = false;
|
|
btn.textContent = '重新获取';
|
|
});
|
|
}
|
|
|
|
function submitReset(e) {
|
|
e.preventDefault();
|
|
hideError();
|
|
|
|
var phone = document.getElementById('phone').value.trim();
|
|
var code = document.getElementById('code').value.trim();
|
|
var password = document.getElementById('password').value;
|
|
var confirm = document.getElementById('confirm').value;
|
|
|
|
if (!/^1[3-9]\d{9}$/.test(phone)) { showError('请输入正确的手机号'); return false; }
|
|
if (!code) { showError('请输入短信验证码'); return false; }
|
|
if (password.length < 6) { showError('密码长度不能少于 6 位'); return false; }
|
|
if (password !== confirm) { showError('两次输入的密码不一致'); return false; }
|
|
|
|
var btn = document.getElementById('submitBtn');
|
|
btn.disabled = true;
|
|
btn.classList.add('is-loading');
|
|
document.getElementById('btnLabel').textContent = '提交中...';
|
|
|
|
fetch('/auth/forgot/reset', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
phone: phone,
|
|
code: code,
|
|
password: password,
|
|
confirm: confirm,
|
|
client_id: CLIENT_ID,
|
|
redirect: REDIRECT
|
|
})
|
|
})
|
|
.then(function (r) { return r.json(); })
|
|
.then(function (res) {
|
|
if (res.code !== 200) {
|
|
showError(res.msg || '密码重置失败');
|
|
btn.disabled = false;
|
|
btn.classList.remove('is-loading');
|
|
document.getElementById('btnLabel').textContent = '重置密码';
|
|
return;
|
|
}
|
|
window.location.href = res.redirect || ('/auth/login?client_id=' + encodeURIComponent(CLIENT_ID));
|
|
})
|
|
.catch(function () {
|
|
showError('网络异常,请稍后重试');
|
|
btn.disabled = false;
|
|
btn.classList.remove('is-loading');
|
|
document.getElementById('btnLabel').textContent = '重置密码';
|
|
});
|
|
return false;
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|