yolo
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
<!-- logo -->
|
||||
<div class="logo">
|
||||
<div class="center-justify" style="height: 80px; width: 300px;">
|
||||
<img style="margin-right: 20px;" src="@/assets/logo.png">
|
||||
<img src="@/assets/logotext.png">
|
||||
<!-- <img style="margin-right: 20px;height: 100%;" src="@/assets/logo.png"> -->
|
||||
<img style="height: 100%;" src="@/assets/logotext.png">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,11 @@
|
||||
|
||||
<div class="from-input">
|
||||
<el-form label-position="left" label-width="100px" :model="formData">
|
||||
|
||||
<div class="from-input-item1">
|
||||
<img src="@/assets/username.png" alt="">
|
||||
<el-input style="height: 25px;" v-model="formData.tenantName" placeholder="租户名称"
|
||||
clearable @keyup.enter="onSubmit" />
|
||||
</div>
|
||||
<div class="from-input-item1">
|
||||
<img src="@/assets/username.png" alt="">
|
||||
<el-input style="height: 25px;" v-model="formData.userId" placeholder="账号" clearable
|
||||
@@ -70,7 +74,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { login } from '@/api/account';
|
||||
import { login, getIdByName } from '@/api/account';
|
||||
import { getToken, setToken, setUser, setUserPass, getUserPass } from '@/utils/storage';
|
||||
import { ElLoading } from 'element-plus';
|
||||
import { usePythonBridge } from '@/utils/pythonBridge'
|
||||
@@ -91,6 +95,7 @@ onMounted(() => {
|
||||
const router = useRouter();
|
||||
|
||||
const formData = ref({
|
||||
tenantName: getUserPass() == null ? '' : getUserPass().tenantName,
|
||||
userId: getUserPass() == null ? '' : getUserPass().userId,
|
||||
password: getUserPass() == null ? '' : getUserPass().password,
|
||||
});
|
||||
@@ -104,29 +109,24 @@ const onSubmit = () => {
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
});
|
||||
setUserPass(formData.value);
|
||||
login({
|
||||
userId: formData.value.userId,
|
||||
password: formData.value.password,
|
||||
source: 'app'
|
||||
}).then((res) => {
|
||||
loading.close();
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
if (res.data.activeYn == 'Y') {
|
||||
setToken(res.data.currcode);
|
||||
setUser(res.data);
|
||||
router.push('/nav');
|
||||
} else {
|
||||
alert('账号未启用');
|
||||
}
|
||||
getIdByName(formData.value.tenantName).then((tenantId) => {
|
||||
console.log(tenantId)
|
||||
login({
|
||||
tenantId: Number(tenantId),
|
||||
username: formData.value.userId,
|
||||
password: formData.value.password,
|
||||
}).then((res) => {
|
||||
loading.close();
|
||||
console.log(res)
|
||||
setToken(res.tokenValue);
|
||||
setUser(res);
|
||||
router.push('/nav');
|
||||
}).catch((err) => {
|
||||
loading.close();
|
||||
});
|
||||
})
|
||||
|
||||
} else {
|
||||
alert(res.mes);
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
loading.close();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -207,8 +207,8 @@ const onSubmit = () => {
|
||||
|
||||
.from {
|
||||
width: 420px;
|
||||
height: 320px;
|
||||
color: #107A4E;
|
||||
// height: 320px;
|
||||
color: @bg-color;
|
||||
background-color: #ffffff44;
|
||||
border-radius: 20px;
|
||||
border: 1px solid #fff;
|
||||
@@ -219,7 +219,7 @@ const onSubmit = () => {
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #107A4E;
|
||||
color: @bg-color;
|
||||
line-height: 37px;
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ const onSubmit = () => {
|
||||
padding: 8px 0;
|
||||
|
||||
.from-input-item-title {
|
||||
color: #107A4E;
|
||||
color: @bg-color;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
width: 80px;
|
||||
@@ -257,7 +257,7 @@ const onSubmit = () => {
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
color: #107A4E;
|
||||
color: @bg-color;
|
||||
line-height: 37px;
|
||||
}
|
||||
}
|
||||
@@ -266,7 +266,7 @@ const onSubmit = () => {
|
||||
display: flex;
|
||||
width: 359px;
|
||||
height: 50px;
|
||||
background: rgba(147, 174, 158, 0.37);
|
||||
background: @bg-color-light-light;
|
||||
border-radius: 24px;
|
||||
border: 1px solid #FFFFFF;
|
||||
padding: 12px 25px 13px 25px;
|
||||
@@ -309,7 +309,7 @@ const onSubmit = () => {
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
::v-deep(.el-input__wrapper) {
|
||||
background-color: rgba(255, 0, 0, 0);
|
||||
box-shadow: none;
|
||||
@@ -317,11 +317,11 @@ const onSubmit = () => {
|
||||
}
|
||||
|
||||
::v-deep(.el-input__inner) {
|
||||
color: #107A4E;
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
|
||||
::v-deep(.el-input__inner::placeholder) {
|
||||
color: #107A4E;
|
||||
color: @bg-color;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user