|
|
|
@ -4,32 +4,51 @@
|
|
|
|
|
<div class="contain-topbg flex flex-center flex-c flex-c-center">
|
|
|
|
|
<img class="logo-img" src="@/assets/logo.png" alt="" />
|
|
|
|
|
<div class="logo-text">链友融财务数字一体化信息系统</div>
|
|
|
|
|
<div class="logo-text logo-text-new"> OA办公,每一天都高效</div>
|
|
|
|
|
<div class="logo-text logo-text-new">OA办公,每一天都高效</div>
|
|
|
|
|
<div class="round"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width: 90%;z-index: 10;">
|
|
|
|
|
<div style="width: 90%; z-index: 10">
|
|
|
|
|
<div class="login-form">
|
|
|
|
|
<div style="border-bottom: 1px solid #ddd; padding-bottom: 0.3rem;">
|
|
|
|
|
<div style="border-bottom: 1px solid #ddd; padding-bottom: 0.3rem">
|
|
|
|
|
<div class="userName">企业:</div>
|
|
|
|
|
<input v-model="loginForm.tenantName" placeholder="请输入企业名称" />
|
|
|
|
|
<input
|
|
|
|
|
v-model="loginForm.tenantName"
|
|
|
|
|
placeholder="请输入企业名称"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="border-bottom: 1px solid #ddd; padding-bottom: 0.3rem;">
|
|
|
|
|
<div style="border-bottom: 1px solid #ddd; padding-bottom: 0.3rem">
|
|
|
|
|
<div class="userName">账号:</div>
|
|
|
|
|
<input v-model="loginForm.username" placeholder="请输入用户名" />
|
|
|
|
|
</div>
|
|
|
|
|
<div style="border-bottom: 1px solid #ddd; padding-bottom: 0.3rem;">
|
|
|
|
|
<div style="border-bottom: 1px solid #ddd; padding-bottom: 0.3rem">
|
|
|
|
|
<div class="password">密码:</div>
|
|
|
|
|
<input v-model="loginForm.password" type="password" placeholder="请输入密码" />
|
|
|
|
|
<input
|
|
|
|
|
v-model="loginForm.password"
|
|
|
|
|
type="password"
|
|
|
|
|
placeholder="请输入密码"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="whiteSpace"></div>
|
|
|
|
|
<div class="btn-box">
|
|
|
|
|
<van-button type="info" style="width: 100%" @click="handleLogin" loading-text="登录中...">登录</van-button>
|
|
|
|
|
<van-button
|
|
|
|
|
type="info"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
@click="handleLogin"
|
|
|
|
|
loading-text="登录中..."
|
|
|
|
|
>登录</van-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btn-box rember-box">
|
|
|
|
|
<van-checkbox v-model="isRemeber" @change="handleCheck" shape="square">记住密码</van-checkbox>
|
|
|
|
|
<van-checkbox v-model="isRemeber" @change="handleCheck" shape="square"
|
|
|
|
|
>记住密码</van-checkbox
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 企业微信登录 -->
|
|
|
|
|
<van-button type="primary" @click="handleWxLogin"
|
|
|
|
|
>企业微信登录</van-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 图形验证码 -->
|
|
|
|
|
<!-- <Verify ref="verify" :captcha-type="'blockPuzzle'" :img-size="{width:'10rem',height:'5rem'}" @success="handleLogin" /> -->
|
|
|
|
@ -38,23 +57,22 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { mapGetters, mapActions } from 'vuex'
|
|
|
|
|
import { getCaptchaEnable, getTenantEnable } from "@/utils/ruoyi";
|
|
|
|
|
import { getTenantIdByName } from "@/api/system/tenant";
|
|
|
|
|
import {
|
|
|
|
|
setTenantId
|
|
|
|
|
} from "@/utils/auth";
|
|
|
|
|
import { getCaptchaEnable, getTenantEnable } from '@/utils/ruoyi'
|
|
|
|
|
import { getTenantIdByName } from '@/api/system/tenant'
|
|
|
|
|
import { Wxlogin } from '@/api/login'
|
|
|
|
|
import { setTenantId } from '@/utils/auth'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
loginForm: {
|
|
|
|
|
loginType: "",
|
|
|
|
|
username: "", // admin
|
|
|
|
|
password: "", // admin123
|
|
|
|
|
captchaVerification: "",
|
|
|
|
|
mobile: "",
|
|
|
|
|
mobileCode: "",
|
|
|
|
|
loginType: '',
|
|
|
|
|
username: '', // admin
|
|
|
|
|
password: '', // admin123
|
|
|
|
|
captchaVerification: '',
|
|
|
|
|
mobile: '',
|
|
|
|
|
mobileCode: '',
|
|
|
|
|
rememberMe: false,
|
|
|
|
|
tenantName: "", // 芋道源码
|
|
|
|
|
tenantName: '', // 芋道源码
|
|
|
|
|
},
|
|
|
|
|
systemInfo: {},
|
|
|
|
|
checked: false,
|
|
|
|
@ -67,7 +85,7 @@ export default {
|
|
|
|
|
// Verify
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapGetters(['devSystemList', 'devUserList'])
|
|
|
|
|
...mapGetters(['devSystemList', 'devUserList']),
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
// 租户开关
|
|
|
|
@ -85,13 +103,21 @@ export default {
|
|
|
|
|
// this.captchaEnable = getCaptchaEnable();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleWxLogin() {
|
|
|
|
|
Wxlogin({ type: 30, redirectUri: '/home' }).then((res) => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
window.location.href = res.data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleSetLoginInfo() {
|
|
|
|
|
if (this.isRemeber) {
|
|
|
|
|
const { tenantName, username, password } = JSON.parse(window.localStorage.getItem('loginInfo') || {})
|
|
|
|
|
const { tenantName, username, password } = JSON.parse(
|
|
|
|
|
window.localStorage.getItem('loginInfo') || {}
|
|
|
|
|
)
|
|
|
|
|
this.loginForm = {
|
|
|
|
|
tenantName,
|
|
|
|
|
username,
|
|
|
|
|
password
|
|
|
|
|
password,
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
window.localStorage.removeItem('loginInfo')
|
|
|
|
@ -99,18 +125,21 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
handleSetTenantId() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
getTenantIdByName(this.loginForm.tenantName).then(res => { // 设置租户
|
|
|
|
|
const tenantId = res.data.id;
|
|
|
|
|
window.localStorage.setItem('cn', res.data.name)
|
|
|
|
|
if (tenantId && tenantId >= 0) {
|
|
|
|
|
setTenantId(tenantId)
|
|
|
|
|
resolve()
|
|
|
|
|
} else {
|
|
|
|
|
getTenantIdByName(this.loginForm.tenantName)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
// 设置租户
|
|
|
|
|
const tenantId = res.data.id
|
|
|
|
|
window.localStorage.setItem('cn', res.data.name)
|
|
|
|
|
if (tenantId && tenantId >= 0) {
|
|
|
|
|
setTenantId(tenantId)
|
|
|
|
|
resolve()
|
|
|
|
|
} else {
|
|
|
|
|
reject()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
reject()
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
reject()
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleCheck(val) {
|
|
|
|
@ -141,29 +170,33 @@ export default {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.$loading(true)
|
|
|
|
|
this.handleSetTenantId().then(() => {
|
|
|
|
|
this.developLogin({
|
|
|
|
|
vm: this,
|
|
|
|
|
username: this.loginForm.username,
|
|
|
|
|
password: this.loginForm.password,
|
|
|
|
|
}).then(() => {
|
|
|
|
|
// 判断是否记住密码
|
|
|
|
|
if (this.isRemeber) {
|
|
|
|
|
let obj = {
|
|
|
|
|
tenantName: this.loginForm.tenantName,
|
|
|
|
|
username: this.loginForm.username,
|
|
|
|
|
password: this.loginForm.password,
|
|
|
|
|
}
|
|
|
|
|
window.localStorage.setItem('loginInfo', JSON.stringify(obj))
|
|
|
|
|
}
|
|
|
|
|
this.$router.replace('/home')
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.handleSetTenantId()
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.developLogin({
|
|
|
|
|
vm: this,
|
|
|
|
|
username: this.loginForm.username,
|
|
|
|
|
password: this.loginForm.password,
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
// 判断是否记住密码
|
|
|
|
|
if (this.isRemeber) {
|
|
|
|
|
let obj = {
|
|
|
|
|
tenantName: this.loginForm.tenantName,
|
|
|
|
|
username: this.loginForm.username,
|
|
|
|
|
password: this.loginForm.password,
|
|
|
|
|
}
|
|
|
|
|
window.localStorage.setItem('loginInfo', JSON.stringify(obj))
|
|
|
|
|
}
|
|
|
|
|
this.$router.replace('/home')
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$loading(false)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$fm('企业信息错误!')
|
|
|
|
|
this.$loading(false)
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$fm('企业信息错误!')
|
|
|
|
|
this.$loading(false)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleSystem(val) {
|
|
|
|
|
this.systemInfo = val
|
|
|
|
@ -174,8 +207,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
handleDevUser(val) {
|
|
|
|
|
this.loginForm.devUserTitle = val.title
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|