From a637cdb04ab7e0954196ad0d8e7cc24ae22ee93a Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 10 三月 2026 13:22:22 +0800
Subject: [PATCH] #
---
src/main/webapp/views/login.html | 881 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 492 insertions(+), 389 deletions(-)
diff --git a/src/main/webapp/views/login.html b/src/main/webapp/views/login.html
index 640e406..01e5ad2 100644
--- a/src/main/webapp/views/login.html
+++ b/src/main/webapp/views/login.html
@@ -1,421 +1,524 @@
<!DOCTYPE html>
-<html lang="en">
+<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>绯荤粺鐧诲綍</title>
- <link rel="stylesheet" href="../static/layui/css/layui.css" media="all">
- <link rel="icon" type="image/x-icon" href="../static/images/wcs_logo.png" />
+ <meta name="renderer" content="webkit">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="icon" type="image/x-icon" href="../static/images/wcs_logo.png">
+ <link rel="stylesheet" href="../static/vue/element/element.css">
<link rel="stylesheet" href="../static/css/animate.min.css">
- <script type="text/javascript" src="../static/layui/layui.js"></script>
- <script type="text/javascript" src="../static/js/common.js?v=20260309_i18n_fix1"></script>
<style>
- html{
- height: 100%;
- }
- body.login-bg {
- color: #777;
- height: 100%;
- /*background-image: linear-gradient(to right, #ff9569 0%, #e92758 100%);*/
- /*background-image: linear-gradient(-90deg, #a2e7f3 0%, #98baee 100%);*/
- background-image: url("../static/images/login.png");
- /*background: -webkit-linear-gradient(red, blue); !* Safari 5.1 - 6.0 *!;*/
- /*background-image: url("../static/image/login_bg.jpg");*/
- /*background-repeat: no-repeat;*/
- /*background-size: cover;*/
- /*background-position: top center;*/
+ [v-cloak] {
+ display: none;
}
- #login-wrapper {
- box-sizing:border-box;
- background: #fff;
- position: absolute;
- top: 45%;
- left: 50%;
- margin-top: -210px;
- margin-left: -220px;
- width: 400px;
- min-height: 380px;
- padding: 50px;
- text-align: center;
- border-radius: 5px;
- box-shadow: 0px 0px 10px rgb(168, 165, 165);
- transform-origin: 50% 50%;
- /*animation: loading 1s 0s forwards;*/
- transform: rotateX(0deg);
+ html,
+ body {
+ min-height: 100%;
+ margin: 0;
+ font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}
- #login-wrapper h2 {
- color: rgba(64,158,255,0.9);
- font-size: 26px;
- font-weight: bold;
- margin-bottom: 30px;
+ body {
+ background:
+ radial-gradient(900px 420px at 12% 14%, rgba(92, 176, 255, 0.20), transparent 60%),
+ radial-gradient(760px 360px at 86% 18%, rgba(54, 208, 177, 0.18), transparent 58%),
+ linear-gradient(135deg, rgba(6, 26, 58, 0.84), rgba(7, 38, 73, 0.64)),
+ url("../static/images/login.png") center center / cover no-repeat;
+ color: #243447;
}
- .layadmin-user-login-body .layui-form-item {
- margin-bottom: 20px;
+ .login-shell {
+ min-height: 100vh;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 36px 16px;
+ box-sizing: border-box;
position: relative;
}
- .layadmin-user-login-body .layui-form-item .layui-input {
- height: 42px;
- padding-left: 40px;
- font-size: 16px;
- border: 1px solid #c8cccf;
- color: inherit;
- }
- .login-submit {
- margin-top: 30px;
- }
- .layadmin-user-login-icon {
+
+ .login-shell::before {
+ content: "";
position: absolute;
- left: 1px;
- top: 1px;
- width: 38px;
- line-height: 40px;
- text-align: center;
- color: #B2B2B2;
- font-size: 18px;
+ inset: 0;
+ background:
+ linear-gradient(120deg, rgba(6, 18, 38, 0.40), transparent 42%),
+ linear-gradient(300deg, rgba(16, 66, 98, 0.30), transparent 38%);
+ pointer-events: none;
}
- .layui-btn-normal {
- background-color: rgba(64,158,255,0.9);
- font-size: 20px;
- border-radius: 4px;
- height: 52px;
+
+ .login-layout {
+ width: min(1180px, 100%);
+ display: grid;
+ grid-template-columns: minmax(0, 1.1fr) minmax(360px, 430px);
+ gap: 28px;
+ align-items: stretch;
+ position: relative;
+ z-index: 1;
}
- .login-lang {
+
+ .lang-switch {
position: fixed;
- top: 20px;
+ top: 18px;
right: 24px;
- z-index: 2;
+ z-index: 3;
}
- .login-lang select {
- min-width: 140px;
+
+ .lang-switch select {
+ min-width: 144px;
height: 34px;
- padding: 0 10px;
- border: 1px solid #d6dbe6;
- border-radius: 17px;
- background: rgba(255, 255, 255, 0.92);
+ padding: 0 12px;
+ border: 1px solid rgba(214, 219, 230, 0.94);
+ border-radius: 18px;
+ background: rgba(255, 255, 255, 0.94);
color: #3b4a5a;
outline: none;
}
+
+ .hero-panel {
+ min-height: 620px;
+ border-radius: 30px;
+ padding: 42px 40px 36px;
+ box-sizing: border-box;
+ color: #eef5ff;
+ position: relative;
+ overflow: hidden;
+ background:
+ radial-gradient(520px 280px at 18% 12%, rgba(116, 193, 255, 0.30), transparent 64%),
+ radial-gradient(480px 260px at 92% 88%, rgba(58, 214, 182, 0.26), transparent 60%),
+ linear-gradient(155deg, rgba(13, 39, 73, 0.88), rgba(12, 76, 104, 0.62));
+ border: 1px solid rgba(200, 225, 255, 0.18);
+ box-shadow: 0 32px 70px rgba(6, 17, 36, 0.32);
+ }
+
+ .hero-panel::before,
+ .hero-panel::after {
+ content: "";
+ position: absolute;
+ border-radius: 999px;
+ background: rgba(255, 255, 255, 0.07);
+ }
+
+ .hero-panel::before {
+ width: 420px;
+ height: 420px;
+ top: -220px;
+ right: -140px;
+ }
+
+ .hero-panel::after {
+ width: 260px;
+ height: 260px;
+ left: -80px;
+ bottom: -120px;
+ }
+
+ .brand-chip {
+ display: inline-flex;
+ align-items: center;
+ gap: 10px;
+ padding: 8px 14px;
+ border-radius: 999px;
+ background: rgba(255, 255, 255, 0.10);
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ font-size: 12px;
+ letter-spacing: 0.12em;
+ text-transform: uppercase;
+ }
+
+ .brand-chip::before {
+ content: "";
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: #7ff6d6;
+ box-shadow: 0 0 0 6px rgba(127, 246, 214, 0.12);
+ }
+
+ .hero-title {
+ margin: 24px 0 14px;
+ font-size: 44px;
+ line-height: 1.08;
+ font-weight: 700;
+ letter-spacing: -0.02em;
+ }
+
+ .hero-subtitle {
+ max-width: 560px;
+ color: rgba(236, 245, 255, 0.82);
+ line-height: 1.8;
+ font-size: 15px;
+ }
+
+ .hero-metrics {
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 14px;
+ margin-top: 34px;
+ }
+
+ .metric-card {
+ padding: 18px 18px 16px;
+ border-radius: 20px;
+ background: rgba(255, 255, 255, 0.08);
+ border: 1px solid rgba(255, 255, 255, 0.10);
+ backdrop-filter: blur(8px);
+ }
+
+ .metric-value {
+ font-size: 28px;
+ font-weight: 700;
+ line-height: 1.1;
+ margin-bottom: 8px;
+ }
+
+ .metric-label {
+ color: rgba(236, 245, 255, 0.70);
+ font-size: 13px;
+ }
+
+ .hero-footer {
+ position: absolute;
+ left: 40px;
+ right: 40px;
+ bottom: 30px;
+ display: flex;
+ justify-content: space-between;
+ gap: 16px;
+ font-size: 12px;
+ color: rgba(236, 245, 255, 0.60);
+ }
+
+ .login-card {
+ width: 100%;
+ min-height: 620px;
+ border-radius: 30px;
+ background: rgba(255, 255, 255, 0.92);
+ border: 1px solid rgba(219, 227, 238, 0.96);
+ box-shadow: 0 28px 60px rgba(8, 28, 61, 0.18);
+ overflow: hidden;
+ backdrop-filter: blur(16px);
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ }
+
+ .login-head {
+ padding: 36px 38px 20px;
+ }
+
+ .login-title {
+ margin: 0;
+ font-size: 32px;
+ font-weight: 700;
+ color: #17324f;
+ cursor: pointer;
+ user-select: none;
+ }
+
+ .login-subtitle {
+ margin-top: 10px;
+ color: #6d7f90;
+ font-size: 14px;
+ line-height: 1.6;
+ }
+
+ .login-body {
+ padding: 0 38px 38px;
+ }
+
+ .login-form .el-form-item {
+ margin-bottom: 20px;
+ }
+
+ .login-form .el-input__inner,
+ .login-form .el-button {
+ height: 48px;
+ line-height: 48px;
+ }
+
+ .login-form .el-input__prefix {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #91a0b2;
+ }
+
+ .login-form .el-input__inner {
+ border-radius: 16px;
+ border-color: rgba(214, 223, 235, 0.94);
+ background: rgba(248, 251, 255, 0.84);
+ padding-left: 44px;
+ }
+
+ .login-form .el-input__inner:focus {
+ background: #fff;
+ border-color: #4a8df0;
+ }
+
+ .login-submit {
+ width: 100%;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 16px;
+ font-weight: 600;
+ border-radius: 16px;
+ margin-top: 6px;
+ box-shadow: 0 14px 24px rgba(46, 115, 223, 0.28);
+ }
+
+ .tools-dialog .el-dialog,
+ .text-dialog .el-dialog,
+ .upload-dialog .el-dialog {
+ border-radius: 20px;
+ overflow: hidden;
+ }
+
+ .tools-dialog .el-dialog__header,
+ .text-dialog .el-dialog__header,
+ .upload-dialog .el-dialog__header {
+ padding: 18px 20px 12px;
+ border-bottom: 1px solid rgba(222, 230, 239, 0.92);
+ background: #f8fbff;
+ }
+
+ .tools-dialog .el-dialog__title,
+ .text-dialog .el-dialog__title,
+ .upload-dialog .el-dialog__title {
+ font-weight: 700;
+ color: #243447;
+ }
+
+ .tools-dialog .el-dialog__body,
+ .text-dialog .el-dialog__body,
+ .upload-dialog .el-dialog__body {
+ padding: 18px 20px 20px;
+ }
+
+ .tool-group + .tool-group {
+ margin-top: 18px;
+ padding-top: 18px;
+ border-top: 1px solid rgba(235, 240, 246, 0.95);
+ }
+
+ .tool-title {
+ font-weight: 700;
+ color: #43576b;
+ margin-bottom: 10px;
+ }
+
+ .tool-desc {
+ margin-top: 8px;
+ font-size: 12px;
+ color: #8c9aac;
+ line-height: 1.6;
+ }
+
+ .tool-actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 10px;
+ }
+
+ .tool-actions .el-button {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .dialog-text-label {
+ font-weight: 700;
+ color: #43576b;
+ margin-bottom: 8px;
+ }
+
+ .dialog-text-tip {
+ margin-bottom: 10px;
+ color: #8c9aac;
+ font-size: 12px;
+ line-height: 1.6;
+ }
+
+ .text-footer,
+ .upload-footer {
+ display: flex;
+ justify-content: flex-end;
+ gap: 10px;
+ margin-top: 14px;
+ }
+
+ .text-footer .el-button,
+ .upload-footer .el-button {
+ min-width: 96px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ @media (max-width: 640px) {
+ .login-shell {
+ padding-top: 72px;
+ }
+
+ .lang-switch {
+ right: 12px;
+ top: 12px;
+ }
+
+ .login-head,
+ .login-body {
+ padding-left: 20px;
+ padding-right: 20px;
+ }
+
+ .login-title {
+ font-size: 26px;
+ }
+ }
+
+ @media (max-width: 980px) {
+ .login-layout {
+ grid-template-columns: 1fr;
+ max-width: 430px;
+ }
+
+ .hero-panel {
+ min-height: auto;
+ padding: 28px 24px 78px;
+ }
+
+ .hero-title {
+ font-size: 32px;
+ }
+
+ .hero-metrics {
+ grid-template-columns: 1fr;
+ }
+
+ .hero-footer {
+ left: 24px;
+ right: 24px;
+ bottom: 22px;
+ flex-direction: column;
+ }
+
+ .login-card {
+ min-height: auto;
+ }
+ }
</style>
</head>
-<body class="login-bg animsition">
+<body>
+<div id="app" class="login-shell" v-cloak>
+ <div class="lang-switch">
+ <select v-model="currentLocale" aria-label="Language" @change="handleLocaleChange">
+ <option v-for="item in localeOptions" :key="item.tag" :value="item.tag">{{ item.label }}</option>
+ </select>
+ </div>
-<div class="login-lang">
- <select id="lang-switch" aria-label="Language"></select>
-</div>
-<div id="login-wrapper" class="animate__animated animate__bounceInDown">
- <header>
- <h2 id="login-title" data-i18n-key="login.title" style="cursor: pointer; user-select: none;">WCS绯荤粺V3.0</h2>
- </header>
- <div class="layui-form layadmin-user-login-body">
- <div class="layui-form-item">
- <label class="layui-icon layui-icon-cellphone layadmin-user-login-icon"></label>
- <input id="mobile" class="layui-input" type="text" name="mobile" lay-verify="mobile" data-i18n-placeholder-key="login.username" placeholder="璐﹀彿">
- </div>
- <div class="layui-form-item">
- <label class="layui-icon layui-icon-password layadmin-user-login-icon"></label>
- <input id="password" class="layui-input" type="password" name="password" lay-verify="password" data-i18n-placeholder-key="login.password" placeholder="瀵嗙爜">
- </div>
- </div>
- <div class="layui-form-item login-submit">
- <button id="login-button" data-i18n-key="login.submit" class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit="" lay-filter="login">鐧�     褰�</button>
- </div>
-</div>
-<div id="system-tools-panel" style="display: none; padding: 20px;">
- <div style="margin-bottom: 18px;">
- <div data-i18n-key="login.tools.recommended" style="margin-bottom: 10px; color: #666; font-weight: 600;">鎺ㄨ崘鎿嶄綔</div>
- <div style="display: flex; flex-wrap: wrap; gap: 12px;">
- <button data-i18n-key="login.tools.requestCode" class="layui-btn layui-btn-normal layui-btn-sm" id="btn-request-code">鑾峰彇璇锋眰鐮�</button>
- <button data-i18n-key="login.tools.activate" class="layui-btn layui-btn-normal layui-btn-sm" id="btn-activate">涓�閿縺娲�</button>
- </div>
- <div data-i18n-key="login.tools.recommendedDesc" style="margin-top: 8px; color: #999; font-size: 12px;">浼樺厛浣跨敤鈥滆幏鍙栬姹傜爜鈥濆拰鈥滀竴閿縺娲烩�濆畬鎴愯鍙瘉鐢宠涓庢縺娲汇��</div>
- </div>
- <div>
- <div data-i18n-key="login.tools.others" style="margin-bottom: 10px; color: #666; font-weight: 600;">鍏朵粬宸ュ叿</div>
- <div style="display: flex; flex-wrap: wrap; gap: 12px;">
- <button data-i18n-key="login.tools.projectName" class="layui-btn layui-btn-primary layui-btn-sm" id="btn-project-name">鑾峰彇椤圭洰鍚嶇О</button>
- <button data-i18n-key="login.tools.serverInfo" class="layui-btn layui-btn-primary layui-btn-sm" id="btn-server-info">鑾峰彇绯荤粺閰嶇疆</button>
- <button data-i18n-key="login.tools.uploadLicense" class="layui-btn layui-btn-primary layui-btn-sm" id="btn-upload-license">褰曞叆璁稿彲璇�</button>
- </div>
- </div>
-</div>
+ <div class="login-layout">
+ <section class="hero-panel animate__animated animate__fadeInLeft">
+ <div class="brand-chip">Zoneyung WCS</div>
+ <div class="hero-title">WCS绯荤粺璁╄澶囪皟搴︺�佷换鍔℃墽琛屼笌鐜板満鐩戞帶淇濇寔鍦ㄥ悓涓�濂椾笟鍔¢摼璺腑銆�</div>
+ <div class="hero-subtitle">
+ Warehouse Control System 闈㈠悜鑷姩鍖栫珛浣撲粨搴撶幇鍦烘墽琛屽眰锛屽洿缁曞爢鍨涙満銆丷GV銆佽緭閫佺珯鍙般�佷换鍔℃寚浠ゃ��
+ 搴撲綅鐘舵�佸拰鏃ュ織杩借釜杩涜缁熶竴璋冨害涓庡彲瑙嗗寲绠$悊锛屽府鍔╀粨鍌ㄧ郴缁熷疄鐜扮ǔ瀹氥�佸彲杩芥函銆佸彲鑱斿姩鐨勪綔涓氭帶鍒躲��
+ 娴欐睙涓壃绔嬪簱鎶�鏈湁闄愬叕鍙搁暱鏈熶笓娉ㄤ簬鑷姩鍖栫珛浣撲粨搴撲笌鏅鸿兘鐗╂祦绯荤粺寤鸿锛岃鐩栨柟妗堣璁°�佽蒋浠舵帶鍒躲��
+ 璁惧闆嗘垚涓庨」鐩疄鏂戒氦浠樸��
+ </div>
+ <div class="hero-metrics">
+ <div class="metric-card">
+ <div class="metric-value">璋冨害</div>
+ <div class="metric-label">缁熶竴缂栨帓鐜板満鎵ц浠诲姟</div>
+ </div>
+ <div class="metric-card">
+ <div class="metric-value">杩芥函</div>
+ <div class="metric-label">浣滀笟銆佽澶囥�佹棩蹇楀叏閾捐矾鐣欑棔</div>
+ </div>
+ <div class="metric-card">
+ <div class="metric-value">闆嗘垚</div>
+ <div class="metric-label">瀵规帴WMS銆佽澶囦笌涓氬姟瑙勫垯</div>
+ </div>
+ </div>
+ <div class="hero-footer">
+ <span>娴欐睙涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�</span>
+ <span>鑷姩鍖栫珛浣撲粨搴撲笌鏅鸿兘鐗╂祦绯荤粺瑙e喅鏂规</span>
+ </div>
+ </section>
+ <section class="login-card animate__animated animate__fadeInUp">
+ <div class="login-head">
+ <h1 class="login-title" @click="handleTitleClick">{{ text('login.title', 'WCS绯荤粺V3.0') }}</h1>
+ <div class="login-subtitle">璇疯緭鍏ヨ处鍙峰拰瀵嗙爜杩涘叆绯荤粺銆�</div>
+ </div>
+ <div class="login-body">
+ <el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" @submit.native.prevent>
+ <el-form-item prop="mobile">
+ <el-input v-model.trim="loginForm.mobile" :placeholder="text('login.username', '璐﹀彿')" clearable @keyup.enter.native="handleLogin">
+ <i slot="prefix" class="el-input__icon el-icon-user"></i>
+ </el-input>
+ </el-form-item>
+ <el-form-item prop="password">
+ <el-input v-model="loginForm.password" type="password" show-password :placeholder="text('login.password', '瀵嗙爜')" @keyup.enter.native="handleLogin">
+ <i slot="prefix" class="el-input__icon el-icon-lock"></i>
+ </el-input>
+ </el-form-item>
+ <el-button class="login-submit" type="primary" :loading="loginLoading" @click="handleLogin">
+ {{ text('login.submit', '鐧诲綍') }}
+ </el-button>
+ </el-form>
+ </div>
+ </section>
+ </div>
+
+ <el-dialog class="tools-dialog" title="绯荤粺宸ュ叿" :visible.sync="toolsDialogVisible" width="560px" :close-on-click-modal="true" append-to-body>
+ <div class="tool-group">
+ <div class="tool-title">{{ text('login.tools.recommended', '鎺ㄨ崘鎿嶄綔') }}</div>
+ <div class="tool-actions">
+ <el-button type="primary" size="small" @click="requestCode">{{ text('login.tools.requestCode', '鑾峰彇璇锋眰鐮�') }}</el-button>
+ <el-button type="primary" size="small" plain @click="activateLicense">{{ text('login.tools.activate', '涓�閿縺娲�') }}</el-button>
+ </div>
+ <div class="tool-desc">{{ text('login.tools.recommendedDesc', '浼樺厛浣跨敤鈥滆幏鍙栬姹傜爜鈥濆拰鈥滀竴閿縺娲烩�濆畬鎴愯鍙瘉鐢宠涓庢縺娲汇��') }}</div>
+ </div>
+ <div class="tool-group">
+ <div class="tool-title">{{ text('login.tools.others', '鍏朵粬宸ュ叿') }}</div>
+ <div class="tool-actions">
+ <el-button size="small" @click="getProjectName">{{ text('login.tools.projectName', '鑾峰彇椤圭洰鍚嶇О') }}</el-button>
+ <el-button size="small" @click="getServerInfo">{{ text('login.tools.serverInfo', '鑾峰彇绯荤粺閰嶇疆') }}</el-button>
+ <el-button size="small" @click="uploadDialogVisible = true">{{ text('login.tools.uploadLicense', '褰曞叆璁稿彲璇�') }}</el-button>
+ </div>
+ </div>
+ </el-dialog>
+
+ <el-dialog class="text-dialog" :title="textDialog.title" :visible.sync="textDialogVisible" width="720px" append-to-body>
+ <div class="dialog-text-label">{{ textDialog.label }}</div>
+ <div v-if="textDialog.tip" class="dialog-text-tip">{{ textDialog.tip }}</div>
+ <el-input v-model="textDialog.text" type="textarea" :rows="10" readonly></el-input>
+ <div class="text-footer">
+ <el-button @click="textDialogVisible = false">鍏抽棴</el-button>
+ <el-button type="primary" @click="copyText">{{ text('copy', '澶嶅埗') }}</el-button>
+ </div>
+ </el-dialog>
+
+ <el-dialog class="upload-dialog" title="褰曞叆璁稿彲璇�" :visible.sync="uploadDialogVisible" width="760px" append-to-body>
+ <div class="dialog-text-label">璁稿彲璇� Base64</div>
+ <div class="dialog-text-tip">灏嗚鍙瘉鏈嶅姟绔繑鍥炵殑 license 瀛楁瀹屾暣绮樿创鍒拌繖閲屻��</div>
+ <el-input v-model.trim="licenseBase64" type="textarea" :rows="10"></el-input>
+ <div class="upload-footer">
+ <el-button @click="uploadDialogVisible = false">鍙栨秷</el-button>
+ <el-button type="primary" @click="submitLicense">鎻愪氦</el-button>
+ </div>
+ </el-dialog>
+</div>
</body>
<script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../static/js/tools/md5.js"></script>
-<script type="text/javascript">
-
- layui.use(['form','layer'],function () {
- var form = layui.form,
- layer = layui.layer,
- $ = layui.jquery;
-
- function initLanguageSwitch() {
- WCS_I18N.onReady(function (i18n) {
- var select = document.getElementById('lang-switch');
- var options = i18n.getLocaleOptions();
- var current = i18n.getLocale();
- var html = '';
- var i;
- for (i = 0; i < options.length; i++) {
- html += '<option value="' + options[i].tag + '"' + (options[i].tag === current ? ' selected' : '') + '>' + options[i].label + '</option>';
- }
- select.innerHTML = html;
- select.onchange = function () {
- i18n.setLocale(this.value);
- };
- document.title = i18n.t('login.title');
- });
- }
-
- initLanguageSwitch();
-
- // 杩炵画鐐瑰嚮涓夋鏍囬鏄剧ず闅愯棌鍔熻兘
- var titleClickCount = 0;
- var titleClickTimer = null;
- $('#login-title').click(function() {
- titleClickCount++;
- if (titleClickTimer) {
- clearTimeout(titleClickTimer);
- }
- if (titleClickCount >= 3) {
- titleClickCount = 0;
- openSystemToolsDialog();
- } else {
- titleClickTimer = setTimeout(function() {
- titleClickCount = 0;
- }, 500);
- }
- });
-
- function openSystemToolsDialog() {
- layer.open({
- type: 1,
- title: '绯荤粺宸ュ叿',
- area: ['560px', '300px'],
- shadeClose: true,
- content: $('#system-tools-panel'),
- end: function () {
- $('#system-tools-panel').hide();
- }
- });
- }
-
- function fallbackCopy(text) {
- try {
- var textarea = document.createElement('textarea');
- textarea.value = text;
- textarea.style.position = 'fixed';
- textarea.style.opacity = '0';
- document.body.appendChild(textarea);
- textarea.select();
- document.execCommand('copy');
- document.body.removeChild(textarea);
- layer.msg('宸插鍒跺埌鍓创鏉�');
- } catch (err) {
- layer.msg('澶嶅埗澶辫触');
- }
- }
-
- function openTextDialog(title, label, text, tip) {
- var html = ''
- + '<div style="padding:15px 20px 5px 20px;">'
- + '<div style="font-weight:600;margin-bottom:8px;">' + label + '</div>'
- + (tip ? '<div style="color:#999;margin-bottom:8px;">' + tip + '</div>' : '')
- + '<textarea id="dialog-text" readonly style="width:100%;min-height:220px;background:#f7f7f7;border:1px solid #e6e6e6;border-radius:6px;padding:12px;line-height:1.6;resize:none;">'
- + text
- + '</textarea>'
- + '<div class="layui-btn-container" style="text-align:right;margin-top:10px;">'
- + '<button class="layui-btn layui-btn-primary" id="copy-dialog-text">澶嶅埗</button>'
- + '</div>'
- + '</div>';
- layer.open({
- type: 1,
- title: title,
- area: ['720px','460px'],
- shadeClose: true,
- content: html,
- success: function (layero) {
- layero.find('#copy-dialog-text').on('click', function () {
- var value = layero.find('#dialog-text').val();
- if (navigator.clipboard && navigator.clipboard.writeText) {
- navigator.clipboard.writeText(value).then(function () {
- layer.msg('宸插鍒跺埌鍓创鏉�');
- }).catch(function () {
- fallbackCopy(value);
- });
- } else {
- fallbackCopy(value);
- }
- });
- }
- });
- }
-
- // 鑾峰彇璇锋眰鐮�
- $('#btn-request-code').click(function() {
- $.ajax({
- url: baseUrl + "/license/getRequestCode",
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- openTextDialog('鑾峰彇璇锋眰鐮�', '璇锋眰鐮�', res.msg || '', '璇锋眰鐮佷腑宸插寘鍚」鐩悕绉帮紝鐩存帴鍙戠粰璁稿彲璇佹湇鍔$鍗冲彲銆�');
- } else {
- layer.msg(res.msg || '鑾峰彇璇锋眰鐮佸け璐�');
- }
- },
- error: function () {
- layer.msg('鑾峰彇璇锋眰鐮佸け璐�');
- }
- });
- return false;
- });
-
- // 鑾峰彇绯荤粺閰嶇疆
- $('#btn-server-info').click(function() {
- $.ajax({
- url: baseUrl + "/license/getServerInfos",
- method: 'GET',
- success: function (res) {
- var pretty = '';
- try {
- pretty = JSON.stringify(res, null, 2);
- } catch (e) {
- pretty = res;
- }
- openTextDialog('鑾峰彇绯荤粺閰嶇疆', '绯荤粺閰嶇疆淇℃伅', pretty, '鑰侀」鐩粛鍙户缁娇鐢ㄨ繖浠界‖浠朵俊鎭� JSON 鐢宠璁稿彲璇併��');
- },
- error: function () {
- layer.msg('鑾峰彇绯荤粺閰嶇疆淇℃伅澶辫触');
- }
- });
- return false;
- });
-
- // 褰曞叆璁稿彲璇�
- $('#btn-upload-license').click(function () {
- layer.open({
- type: 1,
- title: '褰曞叆璁稿彲璇�',
- area: ['760px', '420px'],
- shadeClose: true,
- content: ''
- + '<div style="padding:15px 20px 5px 20px;">'
- + '<div style="font-weight:600;margin-bottom:8px;">璁稿彲璇� Base64</div>'
- + '<div style="color:#999;margin-bottom:8px;">灏嗚鍙瘉鏈嶅姟绔繑鍥炵殑 license 瀛楁瀹屾暣绮樿创鍒拌繖閲屻��</div>'
- + '<textarea id="license-base64-input" style="width:100%;min-height:240px;background:#fff;border:1px solid #e6e6e6;border-radius:6px;padding:12px;line-height:1.6;resize:none;"></textarea>'
- + '</div>',
- btn: ['鎻愪氦', '鍙栨秷'],
- yes: function (index, layero) {
- var license = $.trim(layero.find('#license-base64-input').val());
- if (!license) {
- layer.msg('璁稿彲璇佸唴瀹逛笉鑳戒负绌�');
- return;
- }
- $.ajax({
- url: baseUrl + '/license/updateLicense',
- method: 'POST',
- contentType: 'application/json;charset=UTF-8',
- data: JSON.stringify({license: license}),
- success: function (res) {
- if (res.code === 200) {
- layer.close(index);
- layer.msg('璁稿彲璇佹洿鏂版垚鍔�');
- } else {
- layer.msg(res.msg || '璁稿彲璇佹洿鏂板け璐�');
- }
- },
- error: function () {
- layer.msg('璁稿彲璇佸綍鍏ュけ璐�');
- }
- });
- }
- });
- return false;
- });
-
- // 涓�閿縺娲�
- $('#btn-activate').click(function() {
- layer.confirm('纭畾鎵ц涓�閿縺娲诲悧', function(index){
- layer.close(index);
- $.ajax({
- url: baseUrl + "/license/activate",
- method: 'POST',
- success: function (res) {
- if (res.code === 200){
- layer.msg('婵�娲绘垚鍔�');
- } else {
- layer.msg(res.msg)
- }
- },
- error: function () {
- layer.msg('婵�娲诲け璐�');
- }
- });
- });
- return false;
- });
-
- // 鑾峰彇椤圭洰鍚嶇О
- $('#btn-project-name').click(function() {
- $.ajax({
- url: baseUrl + "/license/getProjectName",
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- layer.alert(res.msg);
- } else {
- layer.msg(res.msg)
- }
- },
- error: function () {
- layer.msg('鑾峰彇椤圭洰鍚嶇О澶辫触');
- }
- });
- return false;
- });
-
- form.on('submit(login)', function (data) {
- var mobile = $("#mobile").val();
- if (mobile === "") {
- layer.msg("璇疯緭鍏ヨ处鍙�", {offset: '150px'});
- return;
- }
- var password = $("#password").val();
- if (password === "") {
- layer.msg("璇疯緭鍏ュ瘑鐮�", {offset: '150px'});
- return;
- }
-
- var user = {
- mobile: mobile,
- password: hex_md5(password)
- };
- $.ajax({
- url: baseUrl+"/login.action",
- data: user,
- method: 'POST',
- success: function (res) {
- if (res.code === 200){
- localStorage.setItem("token", res.data.token);
- localStorage.setItem("username", res.data.username);
- window.location.href = "index.html";
- } else {
- layer.msg(res.msg, {offset: '150px'});
- }
- }
- });
- return false;
- });
-
- $('body').keydown(function () {
- if (event.keyCode === 13) {
- $("#login-button").click();
- }
- });
-
- });
-</script>
-<script type></script>
+<script type="text/javascript" src="../static/js/common.js?v=20260309_i18n_fix1"></script>
+<script type="text/javascript" src="../static/vue/js/vue.min.js"></script>
+<script type="text/javascript" src="../static/vue/element/element.js"></script>
+<script type="text/javascript" src="../static/js/login/login.js?v=20260310_login_vue"></script>
</html>
--
Gitblit v1.9.1