登录页面

This commit is contained in:
zhang zhuo 2025-06-04 09:26:12 +08:00
parent 477eb6bbe8
commit a474d7a8b2
15 changed files with 367 additions and 456 deletions

View File

@ -1,5 +1,5 @@
<template>
<el-config-provider :locale="locale" :size="config.size" :zIndex="config.zIndex" :button="config.button">
<el-config-provider :locale="locale2" :size="config.size" :zIndex="config.zIndex" :button="config.button">
<router-view></router-view>
</el-config-provider>
</template>
@ -7,6 +7,7 @@
<script setup>
import {useI18n} from 'vue-i18n'
import {computed} from 'vue'
const {locale, messages} = useI18n()
const config = {
size: "default",
@ -16,9 +17,13 @@ const config = {
}
}
const locale = computed(() => {
const {locale, messages} = useI18n()
const locale2 = computed(() => {
return messages.value[locale.value]
})
console.log('%c SAAS %c 里派提供技术支持', 'background:#4caf50;color:#fff;border-radius:3px;', '')
</script>
<style lang="scss">
@use '@/style/style.scss';
</style>

View File

@ -6,5 +6,8 @@ export default {
},
menu: async function (data = {}) {
return await http.get("v1/menu", data)
}
},
captcha: async function(data = {}){
return await http.get("v1/captcha", data);
},
}

View File

@ -2,5 +2,34 @@ export default {
system: {
webTitleDev: 'Property Management System (Testing)',
webTitle: 'Property Management System',
},
login: {
slogan: 'SpringCloud Alibaba Microservices Architecture',
describe: 'The community group',
signInTitle: 'Sign in',
accountLogin: 'Account sign in',
rememberMe: 'Remember me',
forgetPassword: 'Forget password',
signIn: 'Sign in',
signInOther: 'Sign in with',
userPlaceholder: 'user / phone / email',
userError: 'Please input a user name',
PWPlaceholder: 'Please input a password',
codePlaceholder: 'Please input a code',
PWError: 'Please input a password',
codeError: 'Please input a code',
wechatLoginTitle: 'QR code sign in',
wechatLoginMsg: 'Please use wechat to scan and log in | Auto scan after 3 seconds of simulation',
wechatLoginResult: 'Scanned | Please click authorize login in the device',
backLogin: 'Return to Login'
},
user: {
dynamic: 'Dynamic',
info: 'User Info',
settings: 'Settings',
nightmode: 'night mode',
nightmode_msg: 'Suitable for low light environment,The current night mode is beta',
language: 'language',
language_msg: 'Translation in progress,Temporarily translated the text of this view',
}
}

View File

@ -2,5 +2,34 @@ export default {
system: {
webTitleDev: '物业管理系统(测试)',
webTitle: '物业管理系统',
},
login: {
slogan: 'SpringCloud Alibaba 微服务架构',
describe: '便民服务',
signInTitle: '用户登录',
accountLogin: '账号登录',
rememberMe: '记住密码',
forgetPassword: '忘记密码',
signIn: '登录',
signInOther: '其他登录方式',
userPlaceholder: '用户名 / 手机 / 邮箱',
userError: '请输入用户名',
PWPlaceholder: '请输入密码',
codePlaceholder: '请输入验证码',
PWError: '请输入密码',
codeError: '请输入验证码',
wechatLoginTitle: '二维码登录',
wechatLoginMsg: '请使用微信扫一扫登录 | 模拟3秒后自动扫描',
wechatLoginResult: '已扫描 | 请点击授权登录',
backLogin: '返回登录'
},
user: {
dynamic: '近期动态',
info: '个人信息',
settings: '设置',
nightmode: '黑夜模式',
nightmode_msg: '适合光线较弱的环境当前黑暗模式为beta版本',
language: '语言',
language_msg: '翻译进行中,暂翻译了本视图的文本',
}
}

View File

@ -1,19 +1,8 @@
import config from "./config"
import api from './api'
import tools from './utils/tools'
import http from "./utils/request"
import * as elIcons from '@element-plus/icons-vue'
import {App} from "vue";
export default {
install(app: App) {
//挂载全局对象
app.config.globalProperties.$CONFIG = config;
app.config.globalProperties.$TOOLS = tools;
app.config.globalProperties.$HTTP = http;
app.config.globalProperties.$API = api;
//统一注册el-icon图标
for (let icon in elIcons) {
app.component(`ElIcon${icon}`, elIcons[icon])

View File

@ -1,4 +1,4 @@
@import '~element-plus/theme-chalk/src/dark/css-vars.scss';
@use 'element-plus/theme-chalk/src/dark/css-vars.scss';
html.dark {
//变量

View File

@ -1,5 +1,5 @@
@import 'app.scss';
@import 'fix.scss';
@import 'pages.scss';
@import 'media.scss';
@import 'dark.scss';
@use 'app.scss';
@use 'fix.scss';
@use 'pages.scss';
@use 'media.scss';
@use 'dark.scss';

View File

@ -24,12 +24,12 @@ axios.interceptors.request.use((config) => {
//响应拦截
axios.interceptors.response.use((response) => {
let res = response.data
if (res.code == 0) {
if (res.code == 200) {
return Promise.resolve(res)
} else if (res.code == 1) { // 操作失败拦截
} else if (res.code == 400) { // 操作失败拦截
ElNotification.error({title: '操作失败', message: res.msg});
return Promise.reject(res)
} else if (res.code == 2) { // 权限不足拦截
} else if (res.code == 500) { // 权限不足拦截
ElNotification.error({title: '权限不足', message: res.msg});
return Promise.reject(res)
} else { // 登录失效拦截

View File

@ -47,6 +47,12 @@ const tools = {
} catch (err) {
return [null, err]
}
},
crypto: {
//MD5加密
MD5(data){
return CryptoJS.MD5(data).toString()
},
}
}

View File

@ -1,35 +0,0 @@
<template>
<el-container>
<el-header style="height:50px;">
<div class="common-header-left">
<div class="common-header-logo">
<img :alt="$CONFIG.APP_NAME" src="img/logo.png">
<label>{{$CONFIG.APP_NAME}}</label>
</div>
<div class="common-header-title">{{title}}</div>
</div>
<div class="common-header-right">
<router-link to="/login">{{$t('login.back_login')}}</router-link>
</div>
</el-header>
<el-main>
<div class="common-container">
<h2 class="common-title">{{title}}</h2>
<div class="common-main el-card">
<slot></slot>
</div>
</div>
</el-main>
</el-container>
</template>
<script>
export default {
props: {
title: { type: String, default: "" }
}
}
</script>
<style>
</style>

View File

@ -1,130 +0,0 @@
<template>
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
<el-form-item prop="user">
<el-input v-model="form.username" prefix-icon="el-icon-user" clearable :placeholder="$t('login.userPlaceholder')"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="form.password" prefix-icon="el-icon-lock" clearable show-password :placeholder="$t('login.PWPlaceholder')"></el-input>
</el-form-item>
<el-form-item prop="veryCode">
<el-input v-model="form.code" prefix-icon="el-icon-iphone" clearable :placeholder="$t('login.codePlaceholder')">
<template #append>
<el-image :src="verImage" @click="getCode" style="padding: 1px;"/>
</template>
</el-input>
</el-form-item>
<el-form-item style="margin-bottom: 10px;">
<el-col :span="12">
<el-checkbox :label="$t('login.rememberMe')" v-model="form.autologin"></el-checkbox>
</el-col>
<el-col :span="12" class="login-forgot">
<router-link to="/reset_password">{{ $t('login.forgetPassword') }}</router-link>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" style="width: 100%;" :loading="islogin" round @click="login">{{ $t('login.signIn') }}</el-button>
</el-form-item>
</el-form>
</template>
<script lang="ts" setup>
</script>
<script>
export default {
data() {
return {
form: {
username: "",
password: "",
code: "",
uuid: "",
autologin: false
},
verImage: '',
rules: {
username: [
{required: true, message: this.$t('login.userError'), trigger: 'blur'}
],
password: [
{required: true, message: this.$t('login.PWError'), trigger: 'blur'}
],
code: [
{required: true, message: this.$t('login.codeError'), trigger: 'blur'}
]
},
islogin: false,
}
},
mounted() {
this.getCode()
this.rememberMe()
},
methods: {
rememberMe() {
const data = this.$TOOLS.data.get("ACCOUNT")
if (data) {
this.form.username = data.username
this.form.password = data.password
this.form.autologin = true
}
},
async getCode() {
// const res = await this.$API.auth.verify();
// this.form.uuid = res.data.uuid
// this.verImage = res.data.image
this.form.code = "";
},
async login(){
//
const validate = await this.$refs.loginForm.validate().catch(() => {});
if(!validate){ return false }
this.islogin = true
const data = {
username: this.form.username,
password: this.$TOOL.crypto.MD5(this.form.password),
uuid: this.form.uuid,
code: this.form.code
};
//
const [res, err] = await this.$TOOLS.go(this.$API.auth.token(data))
this.islogin = false
if (err) {
await this.getCode();
return false;
}
this.$TOOL.data.set("TOKEN", res.data.token, res.data.expireIn)
//
if (this.form.autologin) {
this.$TOOL.data.set("ACCOUNT", {
username: this.form.username,
password: this.form.password
})
}
//
await this.getInfo()
//
// await this.getMenu()
},
async getInfo() {
const [res, err] = await this.$TOOLS.go(this.$API.auth.getAccountInfo())
if (err) {
return false
}
this.$TOOL.data.set("USER_INFO", res.data)
//
this.$router.replace({path: '/'})
this.$message.success("Login Success 登录成功")
}
}
}
</script>
<style scoped>
:deep(.el-input-group__append, .el-input-group__prepend) {
padding: 0;
}
</style>

View File

@ -1,151 +0,0 @@
<template>
<sc-dialog v-model="showWechatLogin" title="扫码登录" :width="400" destroy-on-close :showFullscreen="false" @closed="$emit('closed')">
<div class="qrCodeLogin">
<sc-qr-code class="qrCode" :text="wechatLoginCode" :size="200"></sc-qr-code>
<p class="msg">{{wechatLoginMsg}}</p>
<div class="qrCodeLogin-result" v-if="isWechatLoginResult">
<el-result v-if="loading" icon="success" :sub-title="wechatLoginMsg"></el-result>
<el-result v-else icon="error" :sub-title="wechatLoginMsg">
<template #extra>
<el-button type="primary" link @click="reGetCode()">重新获取</el-button>
</template>
</el-result>
</div>
</div>
</sc-dialog>
</template>
<script>
export default {
name: "wechatLogin",
data() {
return {
showWechatLogin: false,
wechatLoginCode: "",
isWechatLoginResult: false,
wechatLoginMsg: "",
t1: null,
loading: true
}
},
unmounted() {
this.clearTimer()
},
methods: {
open() {
this.getLogin()
this.showWechatLogin = true;
return this
},
reGetCode() {
this.isWechatLoginResult = false
this.wechatLoginCode = ""
this.wechatLoginMsg = ""
this.loading = true
this.getLogin()
},
async getLogin() {
if (!this.wechatLoginCode) {
await this.getCode()
}
const that = this;
that.t1 = setInterval(async ()=>{
const res = await that.$API.auth.getQrCode({qrcode: this.wechatLoginCode});
that.wechatLoginMsg = res.msg
if (res.data.state == 1) { //
that.isWechatLoginResult = true
that.loading = true
}else if(res.data.state == 2) { //
that.isWechatLoginResult = true
that.loading = true
that.clearTimer()
//
this.$TOOL.data.set("TOKEN", res.data.token, res.data.expireIn)
//
await this.getInfo()
//
await this.getMenu()
}else if(res.data.state == 3) { //
that.clearTimer()
that.isWechatLoginResult = true
that.loading = false
}else {
that.isWechatLoginResult = false
that.loading = true
}
},1000)
},
clearTimer() {
clearInterval(this.t1)
this.t1 = null
},
async getCode() {
const res = await this.$API.auth.qrcode();
this.wechatLoginCode = res.data.qrcode
this.wechatLoginMsg = res.msg
},
async getInfo() {
const [res, err] = await this.$TOOL.go(this.$API.auth.getAccountInfo())
if (err) {
return false
}
this.$TOOL.data.set("USER_INFO", res.data)
},
async getMenu() {
const [res, err] = await this.$TOOL.go(this.$API.auth.getMenuInfo())
if (err) {
return false
}
if(res.data.menus.length===0){
this.islogin = false
this.$alert("当前用户无任何菜单权限,请联系系统管理员", "无权限访问", {
type: 'error',
center: true
})
return false
}
this.$TOOLS.data.set("MENU", this.makeMenu(res.data.menus, 0))
this.$TOOL.data.set("PERMISSIONS", res.data.buttons)
this.$TOOL.data.set("ROLE", res.data.roles)
//
this.$router.replace({
path: '/'
})
this.$message.success("Login Success 登录成功")
},
makeMenu(menus, parent_id = 0) {
const arr = [];
for (let item of menus) {
if(item.parent_id === parent_id){
//
const tmp = {
name: item['name'],
path: '/' + item['path'],
component: item['path'],
meta: {
'title': item['title'],
'icon': item['icon'],
'hidden': item['hidden'],
'type': 'menu'
}
};
const children = this.makeMenu(menus, item.menu_id);
if (children.length > 0) {
tmp['children'] = children
}
arr.push(tmp)
}
}
return arr
}
}
}
</script>
<style lang="scss" scoped>
.qrCodeLogin {text-align: center;position: relative;padding: 20px 0;}
.qrCodeLogin img.qrCode {background: #fff;padding:20px;border-radius:10px;}
.qrCodeLogin p.msg {margin-top: 15px;}
.qrCodeLogin .qrCodeLogin-result {position: absolute;top:0;left:0;right: 0;bottom: 0;text-align: center;background: var(--el-bg-color);}
</style>

View File

@ -4,14 +4,26 @@
</div>
<div class="login_main">
<div class="login_config">
<el-button :icon="config.dark?'el-icon-sunny':'el-icon-moon'" circle type="info" @click="configDark"></el-button>
<el-button :icon="config.dark?'el-icon-sunny':'el-icon-moon'" circle type="info"
@click="configDark"></el-button>
<el-dropdown trigger="click" placement="bottom-end" @command="configLang">
<el-button circle>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512"><path d="M478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362L368 281.65L401.17 362z" fill="currentColor"></path><path d="M267.84 342.92a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z" fill="currentColor"></path></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet"
viewBox="0 0 512 512">
<path
d="M478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362L368 281.65L401.17 362z"
fill="currentColor"></path>
<path
d="M267.84 342.92a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z"
fill="currentColor"></path>
</svg>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item v-for="item in lang" :key="item.value" :command="item" :class="{'selected':config.lang==item.value}">{{item.name}}</el-dropdown-item>
<el-dropdown-item v-for="item in lang" :key="item.value" :command="item"
:class="{'selected':config.lang==item.value}">{{ item.name }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@ -19,40 +31,64 @@
<div class="login-form">
<div class="login-header">
<div class="logo">
<img :alt="$CONFIG.APP_NAME" src="./images/logo.png">
<label>{{$CONFIG.APP_NAME}}</label>
<img :alt="sysConfig.APP_NAME" :src="'./images/logo.png'">
<label>{{ sysConfig.APP_NAME }}</label>
</div>
</div>
<password-form></password-form>
<template v-if="$CONFIG.MY_SHOW_LOGIN_OAUTH">
<el-divider>{{ $t('login.signInOther') }}</el-divider>
<div class="login-oauth">
<el-button type="success" icon="sc-icon-wechat" circle @click="wechatLogin"></el-button>
</div>
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
<el-form-item prop="user">
<el-input v-model="form.username" prefix-icon="el-icon-user" clearable
:placeholder="t('login.userPlaceholder')"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="form.password" prefix-icon="el-icon-lock" clearable show-password
:placeholder="t('login.PWPlaceholder')"></el-input>
</el-form-item>
<el-form-item prop="veryCode">
<el-input v-model="form.code" prefix-icon="el-icon-iphone" clearable
:placeholder="t('login.codePlaceholder')">
<template #append>
<el-image :src="verImage" @click="getCode" style="padding: 1px;"/>
</template>
</el-input>
</el-form-item>
<el-form-item style="margin-bottom: 10px;">
<el-col :span="12">
<el-checkbox :label="t('login.rememberMe')" v-model="form.autologin"></el-checkbox>
</el-col>
<!-- <el-col :span="12" class="login-forgot">-->
<!-- <router-link to="/reset_password">{{ t('login.forgetPassword') }}</router-link>-->
<!-- </el-col>-->
</el-form-item>
<el-form-item>
<el-button type="primary" style="width: 100%;" :loading="isLogin" round @click="login">
{{ t('login.signIn') }}
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
<wechat-dialog v-if="showWechatLogin" ref="wechatDialog" @closed="showWechatLogin=false"/>
</template>
<script>
import passwordForm from './components/passwordForm'
import wechatDialog from './components/wechatLogin'
<script setup name="Login">
import {getCurrentInstance, ref, onMounted, watch} from 'vue'
import {useI18n} from 'vue-i18n'
import {useRouter} from 'vue-router';
import tools from "@/utils/tools.js";
import sysConfig from "@/config/index.js";
import api from "@/api/index.js";
export default {
name: "login",
components: {
passwordForm,
wechatDialog
},
data() {
return {
config: {
lang: this.$TOOLS.data.get('APP_LANG') || this.$CONFIG.LANG,
dark: this.$TOOLS.data.get('APP_DARK') || false
},
lang: [
const {proxy} = getCurrentInstance();
const {t, locale} = useI18n()
const router = useRouter();
let config = ref({
lang: tools.data.get('APP_LANG') || sysConfig.LANG,
dark: tools.data.get('APP_DARK') || false
})
const lang = ref([
{
name: '简体中文',
value: 'zh-cn',
@ -61,85 +97,218 @@
name: 'English',
value: 'en',
}
])
let form = ref({
username: "",
password: "",
code: "",
uuid: "",
autologin: false
})
let verImage = ref("")
const rules = ref({
username: [
{required: true, message: t('login.userError'), trigger: 'blur'}
],
showWechatLogin: false
}
},
watch:{
'config.dark'(val){
if(val){
password: [
{required: true, message: t('login.PWError'), trigger: 'blur'}
],
code: [
{required: true, message: t('login.codeError'), trigger: 'blur'}
]
})
let isLogin = ref(false);
// mounted
onMounted(() => {
getCode()
rememberMe()
})
watch(() => config.value.dark, (val) => {
if (val) {
document.documentElement.classList.add("dark")
this.$TOOLS.data.set("APP_DARK", val)
}else{
tools.data.set("APP_DARK", val)
} else {
document.documentElement.classList.remove("dark")
this.$TOOLS.data.remove("APP_DARK")
tools.data.remove("APP_DARK")
}
},
'config.lang'(val){
this.$i18n.locale = val
this.$TOOLS.data.set("APP_LANG", val)
})
watch(() => config.value.lang, (val) => {
locale.value = val
tools.data.set("APP_LANG", val)
})
function rememberMe() {
const data = tools.data.get("ACCOUNT")
if (data) {
form.value.username = data.username
form.value.password = data.password
form.value.autologin = true
}
},
methods: {
configDark(){
this.config.dark = this.config.dark ? false : true
},
configLang(command){
this.config.lang = command.value
},
wechatLogin(){
this.showWechatLogin = true
this.$nextTick(() => {
this.$refs.wechatDialog.open()
}
async function getCode() {
const res = await api.auth.captcha();
form.value.uuid = res.data.uuid
verImage.value = res.data.image
form.value.code = "";
}
async function login() {
//
const validate = await proxy.$refs.loginForm.validate().catch(() => {
});
if (!validate) {
return false
}
isLogin.value = true
const data = {
username: form.value.username,
password: tools.crypto.MD5(form.value.password),
uuid: form.value.uuid,
code: form.value.code
};
//
const [res, err] = await tools.go(api.auth.login(data))
isLogin.value = false
if (err) {
await getCode();
return false;
}
tools.data.set("TOKEN", res.data.token, res.data.expireIn)
//
if (form.value.autologin) {
tools.data.set("ACCOUNT", {
username: form.value.username,
password: form.value.password
})
}
//
await getInfo()
}
async function getInfo() {
const [res, err] = await tools.go(api.auth.getAccountInfo())
if (err) {
return false
}
}
tools.data.set("USER_INFO", res.data)
//
router.replace({path: '/'})
proxy.$message.success("Login Success 登录成功")
}
function configDark() {
config.value.dark = !config.value.dark
}
function configLang(command) {
config.value.lang = command.value
}
</script>
<style scoped>
.login_bg {width: 100%;height: 100%;background: #fff;display: flex;}
.login_adv {width: 33.3333%;background-color: #555;background-size: cover;background-repeat: no-repeat;position: relative;}
.login_adv__title {color: #fff;padding: 40px;position: absolute;top:0px;left:0px;right: 0px;z-index: 2;}
.login_adv__title h2 {font-size: 40px;}
.login_adv__title h4 {font-size: 18px;margin-top: 10px;font-weight: normal;}
.login_adv__title p {font-size: 14px;margin-top:10px;line-height: 1.8;color: rgba(255,255,255,0.6);}
.login_adv__title div {margin-top: 10px;display: flex;align-items: center;}
.login_adv__title div span {margin-right: 15px;}
.login_adv__title div i {font-size: 40px;}
.login_adv__title div i.add {font-size: 20px;color: rgba(255,255,255,0.6);}
.login_adv__bottom {position: absolute;left:0px;right: 0px;bottom: 0px;color: #fff;padding: 40px;z-index: 3;}
.login_adv__mask {position: absolute;top:0px;left:0px;right: 0px;bottom: 0px;z-index: 1;}
.login_bg {
width: 100%;
height: 100%;
background: #fff;
display: flex;
}
.login_main {flex: 1;overflow: auto;display:flex;}
.login-form {width: 400px;margin: auto;padding:20px 0;}
.login-header {margin-bottom: 40px;}
.login-header .logo {display: flex;align-items: center;}
.login-header .logo img {width: 40px;height: 40px;vertical-align: bottom;margin-right: 10px;}
.login-header .logo label {font-size: 26px;font-weight: bold;}
.login-oauth {display: flex;justify-content:space-around;}
.login-form .el-divider {margin-top:40px;}
.login_adv {
width: 33.3333%;
background-color: #555;
background-size: cover;
background-repeat: no-repeat;
position: relative;
}
.login-form {}
.login-form:deep(.el-tabs) .el-tabs__header {margin-bottom: 25px;}
.login-form:deep(.el-tabs) .el-tabs__header .el-tabs__item {font-size: 14px;}
.login_main {
flex: 1;
overflow: auto;
display: flex;
}
.login-form:deep(.login-forgot) {text-align: right;}
.login-form:deep(.login-forgot) a {color: var(--el-color-primary);}
.login-form:deep(.login-forgot) a:hover {color: var(--el-color-primary-light-3);}
.login-form {
width: 400px;
margin: auto;
padding: 20px 0;
}
.login_config {position: absolute;top:20px;right: 20px;}
.login-header {
margin-bottom: 40px;
}
.login-form:deep(.login-msg-yzm) {display: flex;width: 100%;}
.login-form:deep(.login-msg-yzm) .el-button {margin-left: 10px;--el-button-size:42px;}
.login-header .logo {
display: flex;
align-items: center;
}
@media (max-width: 1200px){
.login-form {width: 340px;}
.login-header .logo img {
width: 40px;
height: 40px;
vertical-align: bottom;
margin-right: 10px;
}
.login-header .logo label {
font-size: 26px;
font-weight: bold;
}
.login-form:deep(.login-forgot) {
text-align: right;
}
.login-form:deep(.login-forgot) a {
color: var(--el-color-primary);
}
.login-form:deep(.login-forgot) a:hover {
color: var(--el-color-primary-light-3);
}
.login_config {
position: absolute;
top: 20px;
right: 20px;
}
.login-form:deep(.login-msg-yzm) {
display: flex;
width: 100%;
}
@media (max-width: 1200px) {
.login-form {
width: 340px;
}
@media (max-width: 1000px){
.login_main {display: block;}
.login_main .login_config {position: static;padding:20px 20px 0 20px;text-align: right;}
.login-form {width:100%;padding:20px 40px;}
.login_adv {display: none;}
}
@media (max-width: 1000px) {
.login_main {
display: block;
}
.login_main .login_config {
position: static;
padding: 20px 20px 0 20px;
text-align: right;
}
.login-form {
width: 100%;
padding: 20px 40px;
}
.login_adv {
display: none;
}
}
:deep(.el-input-group__append, .el-input-group__prepend) {
padding: 0;
}
</style>

5
vite-env.d.ts vendored
View File

@ -1,5 +1,6 @@
// 如果使用 Vite 4+ 推荐官方类型
interface ImportMeta {
readonly env: ImportMetaEnv
readonly glob: (
pattern: string,
options?: { eager?: boolean; import?: string, query?: string }
@ -11,10 +12,6 @@ interface ImportMetaEnv {
readonly VITE_APP_TITLE: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>

View File

@ -24,10 +24,10 @@ export default defineConfig(({mode, command}) => {
host: true,
// open: true,
proxy: {
'/api': {
target: 'https://mock.apipost.net/mock/2a749651c864000/',
'/dev-api': {
target: 'https://dev.api.leapy.cn/merchant/',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api/, '')
rewrite: (p) => p.replace(/^\/dev-api/, '')
}
}
},