修复白屏问题

main
sunshine 2 years ago
parent 1d80b171d6
commit 3516636669

@ -100,7 +100,7 @@ import {showConfirm} from "@/utils/common";
import tab from "@/plugins/tab"; import tab from "@/plugins/tab";
import modal from "@/plugins/modal"; import modal from "@/plugins/modal";
import {getById, getDetailByReportId, update} from "@/api/mes/report"; import {getById, getDetailByReportId, update} from "@/api/mes/report";
const userStore = useUserStore()
export default { export default {
components: {}, components: {},
data() { data() {
@ -108,8 +108,8 @@ export default {
// //
customFormData: { customFormData: {
id: undefined, id: undefined,
name: userStore.name, name: this.getUserInfo.name,
userId: userStore.userId, userId: this.getUserInfo.userId,
orgId: undefined, orgId: undefined,
orgType: undefined, orgType: undefined,
reportTime: undefined, reportTime: undefined,
@ -172,6 +172,9 @@ export default {
this.$refs.customForm.setRules(this.customRules) this.$refs.customForm.setRules(this.customRules)
}, },
methods: { methods: {
getUserInfo() {
return useUserStore()
},
processTypes() { processTypes() {
return processTypes return processTypes
}, },

@ -93,14 +93,14 @@
<script> <script>
import useUserStore from "@/store/modules/user"; import useUserStore from "@/store/modules/user";
import {processTypes, groupTypes} from "@/api/system/dict/data"; import { processTypes, groupTypes } from "@/api/system/dict/data";
import {getOrgList, getProductList, createReport, getPlanProductList} from "@/api/mes/organization" import { getOrgList, createReport, getPlanProductList} from "@/api/mes/organization"
import {getCurrentDate, timestampToTime} from "@/utils/dateUtil" import { getCurrentDate, timestampToTime } from "@/utils/dateUtil"
import {showConfirm} from "@/utils/common"; import { showConfirm } from "@/utils/common";
import tab from "@/plugins/tab"; import tab from "@/plugins/tab";
import modal from "@/plugins/modal"; import modal from "@/plugins/modal";
import {getById, getDetailByReportId, update} from "@/api/mes/report"; import { getById, getDetailByReportId, update } from "@/api/mes/report";
const userStore = useUserStore()
export default { export default {
components: {}, components: {},
data() { data() {
@ -108,8 +108,8 @@ export default {
// //
customFormData: { customFormData: {
id: undefined, id: undefined,
name: userStore.name, name: this.getUserInfo.name,
userId: userStore.userId, userId: this.getUserInfo.userId,
orgId: undefined, orgId: undefined,
orgType: undefined, orgType: undefined,
reportTime: undefined, reportTime: undefined,
@ -172,6 +172,9 @@ export default {
this.$refs.customForm.setRules(this.customRules) this.$refs.customForm.setRules(this.customRules)
}, },
methods: { methods: {
getUserInfo() {
return useUserStore()
},
processTypes() { processTypes() {
return processTypes return processTypes
}, },

@ -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 {

@ -196,13 +196,12 @@ function handleBuilding() {
height: 100%; height: 100%;
.header-section { .header-section {
margin: 10rpx; margin: 10rpx 0;
padding: 40rpx 10rpx 80rpx 0; padding: 40rpx 10rpx 80rpx 0;
box-sizing: border-box; box-sizing: border-box;
background-image: url('src/static/images/icon/background.png'); background-image: url('@/static/images/icon/background.png');
background-position: center center; background-position: center center;
background-size: 100% 100%; background-size: 100% 100%;
border-radius: 24rpx;
overflow: hidden; overflow: hidden;
color: #fff; color: #fff;
@ -232,6 +231,7 @@ function handleBuilding() {
.content-section { .content-section {
position: relative; position: relative;
top: -50px; top: -50px;
margin: 10rpx;
.mine-actions { .mine-actions {
margin: 15px 15px; margin: 15px 15px;

Loading…
Cancel
Save