Commit 0fa34874 authored by 小费同学阿's avatar 小费同学阿 💬

mc角色判断登录跳转

parent 430057e8
<template> <template>
<view class="normal-login-container"> <view class="normal-login-container">
<ya-navbar title="DHEC QMS" :left-icon="null" :bg-style="'#fff'" :title-style="'color: #343744;font-weight: bold;font-size: 40rpx;'" /> <ya-navbar title="DHEC QMS" :left-icon="null" :bg-style="'#fff'"
:title-style="'color: #343744;font-weight: bold;font-size: 40rpx;'"
/>
<!-- 中间大图标 --> <!-- 中间大图标 -->
<view class="big-icon"> <view class="big-icon">
<image <image
class="image" class="image"
mode="widthFix" mode="widthFix"
:src="defaultLogo" :src="defaultLogo"
/> />
</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"/>
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" /> <input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30">
</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"/>
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" /> <input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20">
</view> </view>
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled"> <view v-if="captchaEnabled" class="input-item flex align-center" style="width: 60%;margin: 0px;">
<view class="iconfont icon-code icon"></view> <view class="iconfont icon-code icon"/>
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" /> <input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4">
<view class="login-code"> <view class="login-code">
<image :src="codeUrl" @click="getCode" class="login-code-img"></image> <image :src="codeUrl" class="login-code-img" @click="getCode"/>
</view> </view>
</view> </view>
</view> </view>
...@@ -34,7 +36,7 @@ ...@@ -34,7 +36,7 @@
</button> </button>
</view> </view>
<view class="loading"> <view class="loading">
<u-loading-icon :show="loading" size="30" /> <u-loading-icon :show="loading" size="30"/>
</view> </view>
</view> </view>
</template> </template>
...@@ -76,7 +78,7 @@ export default { ...@@ -76,7 +78,7 @@ export default {
}, },
onLoad() { onLoad() {
console.log('微信登陆页面') console.log('微信登陆页面')
/*this.getWxCode() /* this.getWxCode()
this.$store.commit('SET_SHOW_CONFIRM', true) this.$store.commit('SET_SHOW_CONFIRM', true)
this.$store.commit('SET_LOGOUT_BTN', false) this.$store.commit('SET_LOGOUT_BTN', false)
setInterval(() => { setInterval(() => {
...@@ -205,7 +207,7 @@ export default { ...@@ -205,7 +207,7 @@ export default {
getCode() { getCode() {
getCodeImg().then(res => { getCodeImg().then(res => {
this.loginForm.uuid = res.uuid this.loginForm.uuid = res.uuid
/*this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled /* this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) { if (this.captchaEnabled) {
this.codeUrl = 'data:image/gif;base64,' + res.img this.codeUrl = 'data:image/gif;base64,' + res.img
this.loginForm.uuid = res.uuid this.loginForm.uuid = res.uuid
...@@ -240,7 +242,13 @@ export default { ...@@ -240,7 +242,13 @@ export default {
loginSuccess(result) { loginSuccess(result) {
// 设置用户信息 // 设置用户信息
this.$store.dispatch('GetInfo').then(res => { this.$store.dispatch('GetInfo').then(res => {
this.$tab.reLaunch('/pages/index') if (res.data.user.deptName && res.data.user.deptName === '机械加工科') {
// 如果是MC就跳转消息页面
this.$tab.reLaunch('/pages/message/index')
} else {
// 其他情况跳转首页
this.$tab.reLaunch('/pages/index')
}
}) })
} }
} }
...@@ -254,7 +262,7 @@ page { ...@@ -254,7 +262,7 @@ page {
.normal-login-container { .normal-login-container {
// 背景切图撑开 // 背景切图撑开
background: linear-gradient( 240deg, #B9E5FB 0%, #E8E2FD 46%, #95AEF5 100%); background: linear-gradient(240deg, #B9E5FB 0%, #E8E2FD 46%, #95AEF5 100%);
background-size: 100% auto; background-size: 100% auto;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top; background-position: top;
...@@ -326,7 +334,7 @@ page { ...@@ -326,7 +334,7 @@ page {
} }
//协议--《百邦宠物隐私政策和用户协议》 //协议--《百邦宠物隐私政策和用户协议》
/deep/ .text-private, .line-blue, .lines-blue { ::v-deep .text-private, .line-blue, .lines-blue {
font-size: 30rpx; font-size: 30rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN; font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500; font-weight: 500;
...@@ -336,7 +344,7 @@ page { ...@@ -336,7 +344,7 @@ page {
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
} }
/deep/ .text-private-down { ::v-deep .text-private-down {
margin-top: 20rpx; margin-top: 20rpx;
margin-left: 28rpx; margin-left: 28rpx;
...@@ -359,8 +367,8 @@ page { ...@@ -359,8 +367,8 @@ page {
.image { .image {
border-radius: 20rpx; border-radius: 20rpx;
width: 176rpx; width: 176rpx;
height: 176rpx; height: 176rpx;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment