|
|
|
@ -1,38 +1,24 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<view class="normal-login-container">
|
|
|
|
<view class="normal-login-container">
|
|
|
|
<u-sticky
|
|
|
|
|
|
|
|
class="sticky"
|
|
|
|
|
|
|
|
:custom-nav-height="0"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<u-navbar
|
|
|
|
|
|
|
|
title="登录"
|
|
|
|
|
|
|
|
bg-color="transparent"
|
|
|
|
|
|
|
|
:title-style="{ fontWeight: 'bold' }"
|
|
|
|
|
|
|
|
:auto-back="false"
|
|
|
|
|
|
|
|
left-icon=""
|
|
|
|
|
|
|
|
safe-area-inset-top
|
|
|
|
|
|
|
|
placeholder
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</u-sticky>
|
|
|
|
|
|
|
|
<view class="logo-content align-center justify-center flex">
|
|
|
|
<view class="logo-content align-center justify-center flex">
|
|
|
|
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
|
|
|
|
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix" data="">
|
|
|
|
</image>
|
|
|
|
</image>
|
|
|
|
<text class="title">生产运营管理系统</text>
|
|
|
|
<text class="title">生产运营管理系统</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="login-form-content">
|
|
|
|
<view class="login-form-content">
|
|
|
|
<view class="input-item flex align-center">
|
|
|
|
<view class="input-item flex align-center">
|
|
|
|
<view class="iconfont icon-user icon"></view>
|
|
|
|
<view class="iconfont icon-user icon"></view>
|
|
|
|
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
|
|
|
|
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" icon="" label="" max="" tip="" validator=""/>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="input-item flex align-center">
|
|
|
|
<view class="input-item flex align-center">
|
|
|
|
<view class="iconfont icon-password icon"></view>
|
|
|
|
<view class="iconfont icon-password icon"></view>
|
|
|
|
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
|
|
|
|
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" icon="" label="" max="" tip="" validator=""/>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view v-if="captchaEnabled" class="input-item flex align-center" style="width: 60%;margin: 0px;">
|
|
|
|
<view v-if="captchaEnabled" class="input-item flex align-center" style="width: 60%;margin: 0;">
|
|
|
|
<view class="iconfont icon-code icon"></view>
|
|
|
|
<view class="iconfont icon-code icon"></view>
|
|
|
|
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
|
|
|
|
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" icon="" label="" max="" tip="" validator=""/>
|
|
|
|
<view class="login-code">
|
|
|
|
<view class="login-code">
|
|
|
|
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
|
|
|
|
<image :src="codeUrl" @click="getCode" class="login-code-img" data=""></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="action-btn">
|
|
|
|
<view class="action-btn">
|
|
|
|
@ -53,9 +39,7 @@ import { getCodeImg } from '@/api/login'
|
|
|
|
import { ref } from "vue";
|
|
|
|
import { ref } from "vue";
|
|
|
|
import config from '@/config.js'
|
|
|
|
import config from '@/config.js'
|
|
|
|
import useUserStore from '@/store/modules/user'
|
|
|
|
import useUserStore from '@/store/modules/user'
|
|
|
|
import { getWxCode } from '@/utils/geek';
|
|
|
|
|
|
|
|
import { wxLogin } from '@/api/oauth';
|
|
|
|
|
|
|
|
import { setToken } from '@/utils/auth';
|
|
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
const userStore = useUserStore()
|
|
|
|
const codeUrl = ref("");
|
|
|
|
const codeUrl = ref("");
|
|
|
|
const captchaEnabled = ref(false); // 是否开启验证码
|
|
|
|
const captchaEnabled = ref(false); // 是否开启验证码
|
|
|
|
@ -91,9 +75,9 @@ async function handleLogin() {
|
|
|
|
modal.msgError("请输入验证码")
|
|
|
|
modal.msgError("请输入验证码")
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
modal.loading("登录中,请耐心等待...")
|
|
|
|
modal.loading("登录中,请耐心等待...")
|
|
|
|
pwdLogin()
|
|
|
|
await pwdLogin()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// 密码登录
|
|
|
|
// 密码登录
|
|
|
|
async function pwdLogin() {
|
|
|
|
async function pwdLogin() {
|
|
|
|
userStore.login(loginForm.value).then(() => {
|
|
|
|
userStore.login(loginForm.value).then(() => {
|
|
|
|
@ -105,7 +89,7 @@ async function pwdLogin() {
|
|
|
|
getCode()
|
|
|
|
getCode()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function loginSuccess(result) {
|
|
|
|
function loginSuccess(result) {
|
|
|
|
// 设置用户信息
|
|
|
|
// 设置用户信息
|
|
|
|
@ -115,33 +99,20 @@ function loginSuccess(result) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
page {
|
|
|
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.sticky {
|
|
|
|
|
|
|
|
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%);
|
|
|
|
|
|
|
|
backdrop-filter: blur(27.18px);
|
|
|
|
|
|
|
|
box-shadow: 0 1px 1px 0 rgba(0, 72, 145, 0.1),
|
|
|
|
|
|
|
|
0 0.5px 0 0 rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.normal-login-container {
|
|
|
|
.normal-login-container {
|
|
|
|
width: 100%;
|
|
|
|
height: 100vh;
|
|
|
|
min-height: 100vh;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
overflow: hidden;
|
|
|
|
background-image: url(@/static/images/login/background.svg);
|
|
|
|
background-image: url(@/static/images/login/background.svg);
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: cover;
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.logo-content {
|
|
|
|
.logo-content {
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
font-size: 21px;
|
|
|
|
font-size: 21px;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
padding-top: 15%;
|
|
|
|
padding-top: 50%;
|
|
|
|
|
|
|
|
|
|
|
|
image {
|
|
|
|
image {
|
|
|
|
border-radius: 4px;
|
|
|
|
border-radius: 4px;
|
|
|
|
@ -154,8 +125,7 @@ page {
|
|
|
|
|
|
|
|
|
|
|
|
.login-form-content {
|
|
|
|
.login-form-content {
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
margin: 20px auto;
|
|
|
|
margin: 15% auto 20px;
|
|
|
|
margin-top: 15%;
|
|
|
|
|
|
|
|
width: 80%;
|
|
|
|
width: 80%;
|
|
|
|
|
|
|
|
|
|
|
|
.input-item {
|
|
|
|
.input-item {
|
|
|
|
|