|
|
@@ -1,81 +1,83 @@
|
|
|
<template>
|
|
|
- <el-form class="login-form"
|
|
|
- status-icon
|
|
|
- :rules="loginRules"
|
|
|
- ref="loginForm"
|
|
|
- :model="loginForm"
|
|
|
- label-width="0px">
|
|
|
- <el-form-item v-if="customize.logo">
|
|
|
- <el-image src="/img/customize/logo.png" draggable="false"></el-image>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <h1 style="margin: 0">欢迎回来</h1>
|
|
|
- <p style="width: 147px;height: 17px;font-size: 0.5rem;font-family: Source Han Sans SC;font-weight: bold;color: #646464;opacity: 0.7;">{{customize.tip}}</p>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="tenantMode" prop="tenantId">
|
|
|
- <p class="form-label">商编</p>
|
|
|
- <el-input size="small"
|
|
|
- @keyup.enter.native="handleLogin"
|
|
|
- v-model="loginForm.tenantId"
|
|
|
- auto-complete="off"
|
|
|
- :placeholder="$t('login.tenantId')">
|
|
|
-<!-- <i slot="prefix" class="icon-quanxian"/>-->
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="username">
|
|
|
- <p class="form-label">账号</p>
|
|
|
- <el-input size="small"
|
|
|
- @keyup.enter.native="handleLogin"
|
|
|
- v-model="loginForm.username"
|
|
|
- auto-complete="off"
|
|
|
- :placeholder="$t('login.username')">
|
|
|
-<!-- <i slot="prefix" class="icon-yonghu"/>-->
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="password">
|
|
|
- <p class="form-label">密码</p>
|
|
|
- <el-input size="small"
|
|
|
- @keyup.enter.native="handleLogin"
|
|
|
- :type="passwordType"
|
|
|
- v-model="loginForm.password"
|
|
|
- auto-complete="off"
|
|
|
- :placeholder="$t('login.password')">
|
|
|
- <i class="el-icon-view el-input__icon" slot="suffix" @click="showPassword"/>
|
|
|
-<!-- <i slot="prefix" class="icon-mima"/>-->
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="this.website.captchaMode" prop="code">
|
|
|
- <el-row :span="24">
|
|
|
- <el-col :span="16">
|
|
|
- <el-input size="small"
|
|
|
- @keyup.enter.native="handleLogin"
|
|
|
- v-model="loginForm.code"
|
|
|
- auto-complete="off"
|
|
|
- :placeholder="$t('login.code')">
|
|
|
- <i slot="prefix" class="icon-yanzhengma"/>
|
|
|
- </el-input>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <div class="login-code">
|
|
|
- <img :src="loginForm.image" class="login-code-img" @click="refreshCode"/>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary"
|
|
|
- size="small"
|
|
|
- @click.native.prevent="handleLogin"
|
|
|
- class="login-submit">立即登录
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
- <el-dialog title="用户信息选择"
|
|
|
- append-to-body
|
|
|
- :visible.sync="userBox"
|
|
|
- width="350px">
|
|
|
- <avue-form :option="userOption" v-model="userForm" @submit="submitLogin"/>
|
|
|
- </el-dialog>
|
|
|
- </el-form>
|
|
|
+ <div>
|
|
|
+ <el-form class="login-form"
|
|
|
+ status-icon
|
|
|
+ :rules="loginRules"
|
|
|
+ ref="loginForm"
|
|
|
+ :model="loginForm"
|
|
|
+ label-width="0px">
|
|
|
+ <el-form-item>
|
|
|
+ <el-image src="/img/customize/logo.png" draggable="false" v-if="customize.logo"></el-image>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <h1 style="margin: 0">欢迎回来</h1>
|
|
|
+ <p style="width: 147px;height: 17px;font-size: 0.5rem;font-family: Source Han Sans SC;font-weight: bold;color: #646464;opacity: 0.7;">{{customize.tip}}</p>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="tenantMode" prop="tenantId">
|
|
|
+ <p class="form-label">商编</p>
|
|
|
+ <el-input size="small"
|
|
|
+ @keyup.enter.native="handleLogin"
|
|
|
+ v-model="loginForm.tenantId"
|
|
|
+ auto-complete="off"
|
|
|
+ :placeholder="$t('login.tenantId')">
|
|
|
+ <!-- <i slot="prefix" class="icon-quanxian"/>-->
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="username">
|
|
|
+ <p class="form-label">账号</p>
|
|
|
+ <el-input size="small"
|
|
|
+ @keyup.enter.native="handleLogin"
|
|
|
+ v-model="loginForm.username"
|
|
|
+ auto-complete="off"
|
|
|
+ :placeholder="$t('login.username')">
|
|
|
+ <!-- <i slot="prefix" class="icon-yonghu"/>-->
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="password">
|
|
|
+ <p class="form-label">密码</p>
|
|
|
+ <el-input size="small"
|
|
|
+ @keyup.enter.native="handleLogin"
|
|
|
+ :type="passwordType"
|
|
|
+ v-model="loginForm.password"
|
|
|
+ auto-complete="off"
|
|
|
+ :placeholder="$t('login.password')">
|
|
|
+ <i class="el-icon-view el-input__icon" slot="suffix" @click="showPassword"/>
|
|
|
+ <!-- <i slot="prefix" class="icon-mima"/>-->
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="this.website.captchaMode" prop="code">
|
|
|
+ <el-row :span="24">
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-input size="small"
|
|
|
+ @keyup.enter.native="handleLogin"
|
|
|
+ v-model="loginForm.code"
|
|
|
+ auto-complete="off"
|
|
|
+ :placeholder="$t('login.code')">
|
|
|
+ <i slot="prefix" class="icon-yanzhengma"/>
|
|
|
+ </el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <div class="login-code">
|
|
|
+ <img :src="loginForm.image" class="login-code-img" @click="refreshCode"/>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary"
|
|
|
+ size="small"
|
|
|
+ @click.native.prevent="handleLogin"
|
|
|
+ class="login-submit">立即登录
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-dialog title="用户信息选择"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="userBox"
|
|
|
+ width="350px">
|
|
|
+ <avue-form :option="userOption" v-model="userForm" @submit="submitLogin"/>
|
|
|
+ </el-dialog>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -89,7 +91,7 @@
|
|
|
data() {
|
|
|
return {
|
|
|
customize:{
|
|
|
- logo:false,
|
|
|
+ logo: true,
|
|
|
tip:"",
|
|
|
},
|
|
|
logo: false,
|
|
|
@@ -177,20 +179,7 @@
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- let tanentType = this.$route.query.tanentType;
|
|
|
- if(tanentType!==undefined){
|
|
|
- tanentType = tanentType.toLocaleLowerCase();
|
|
|
- }
|
|
|
- if(tanentType==="mall"){
|
|
|
- this.customize.logo = true;
|
|
|
- this.customize.tip = "商户更旺场更高效";
|
|
|
- }else if(tanentType==="agent"){
|
|
|
- this.customize.logo = false;
|
|
|
- this.customize.tip = "消费更实惠更便捷";
|
|
|
- }else{
|
|
|
- this.customize.logo = true;
|
|
|
- this.customize.tip = "全面对接数字时代";
|
|
|
- }
|
|
|
+ this.initLoginSytle();
|
|
|
this.getTenant();
|
|
|
this.refreshCode();
|
|
|
},
|
|
|
@@ -221,6 +210,22 @@
|
|
|
},
|
|
|
props: [],
|
|
|
methods: {
|
|
|
+ initLoginSytle(){
|
|
|
+ let tanentType = getTopUrl();
|
|
|
+ if(tanentType!==undefined){
|
|
|
+ tanentType = tanentType.toLocaleLowerCase();
|
|
|
+ }
|
|
|
+ if(tanentType==="https://mall.ldt.com"){
|
|
|
+ this.customize.logo = true;
|
|
|
+ this.customize.tip = "商户更旺场更高效";
|
|
|
+ }else if(tanentType==="https://agent.ldt.com"){
|
|
|
+ this.customize.logo = false;
|
|
|
+ this.customize.tip = "消费更实惠更便捷";
|
|
|
+ }else{
|
|
|
+ this.customize.logo = true;
|
|
|
+ this.customize.tip = "全面对接数字时代";
|
|
|
+ }
|
|
|
+ },
|
|
|
refreshCode() {
|
|
|
if (this.website.captchaMode) {
|
|
|
getCaptcha().then(res => {
|
|
|
@@ -283,7 +288,7 @@
|
|
|
if (data.success && data.data.tenantId) {
|
|
|
this.tenantMode = false;
|
|
|
this.loginForm.tenantId = data.data.tenantId;
|
|
|
- this.$parent.$refs.login.style.backgroundImage = `url(${data.data.backgroundUrl})`;
|
|
|
+ // this.$parent.$refs.login.style.backgroundImage = `url(${data.data.backgroundUrl})`;
|
|
|
}
|
|
|
})
|
|
|
}
|