| | |
| | | <template> |
| | | <div class="login"> |
| | | <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form"> |
| | | <h3 class="title">RuoYi-Vue-Plus多租户管理系统</h3> |
| | | <el-form-item prop="tenantId" v-if="tenantEnabled"> |
| | | <el-select v-model="loginForm.tenantId" filterable placeholder="请选择/输入公司名称" style="width: 100%"> |
| | | <el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId"></el-option> |
| | | <template #prefix><svg-icon icon-class="company" class="el-input__icon input-icon" /></template> |
| | | </el-select> |
| | | </el-form-item> |
| | | <h3 class="title">跨网文件同步系统</h3> |
| | | <!-- <el-form-item prop="tenantId" v-if="tenantEnabled">--> |
| | | <!-- <el-select v-model="loginForm.tenantId" filterable placeholder="请选择/输入公司名称" style="width: 100%">--> |
| | | <!-- <el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId"></el-option>--> |
| | | <!-- <template #prefix><svg-icon icon-class="company" class="el-input__icon input-icon" /></template>--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item prop="username"> |
| | | <el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" placeholder="账号"> |
| | | <template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template> |
| | |
| | | </div> |
| | | </el-form-item> |
| | | <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> |
| | | <el-form-item style="float: right;"> |
| | | <el-button circle title="微信登录" @click="doSocialLogin('wechat')"> |
| | | <svg-icon icon-class="wechat" /> |
| | | </el-button> |
| | | <el-button circle title="MaxKey登录" @click="doSocialLogin('maxkey')"> |
| | | <svg-icon icon-class="maxkey" /> |
| | | </el-button> |
| | | <el-button circle title="Gitee登录" @click="doSocialLogin('gitee')"> |
| | | <svg-icon icon-class="gitee" /> |
| | | </el-button> |
| | | <el-button circle title="Github登录" @click="doSocialLogin('github')"> |
| | | <svg-icon icon-class="github" /> |
| | | </el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item style="float: right;">--> |
| | | <!-- <el-button circle title="微信登录" @click="doSocialLogin('wechat')">--> |
| | | <!-- <svg-icon icon-class="wechat" />--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button circle title="MaxKey登录" @click="doSocialLogin('maxkey')">--> |
| | | <!-- <svg-icon icon-class="maxkey" />--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button circle title="Gitee登录" @click="doSocialLogin('gitee')">--> |
| | | <!-- <svg-icon icon-class="gitee" />--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button circle title="Github登录" @click="doSocialLogin('github')">--> |
| | | <!-- <svg-icon icon-class="github" />--> |
| | | <!-- </el-button>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item style="width:100%;"> |
| | | <el-button :loading="loading" size="large" type="primary" style="width:100%;" @click.prevent="handleLogin"> |
| | | <span v-if="!loading">登 录</span> |
| | |
| | | </el-form> |
| | | <!-- 底部 --> |
| | | <div class="el-login-footer"> |
| | | <span>Copyright © 2018-2023 疯狂的狮子Li All Rights Reserved.</span> |
| | | <span>Copyright © 优创力.</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | tenantId: [{ required: true, trigger: "blur", message: "请输入您的租户编号" }], |
| | | username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }], |
| | | password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }], |
| | | code: [{ required: false, trigger: 'change', message: '请输入验证码' }] |
| | | code: [{ required: true, trigger: 'change', message: '请输入验证码' }] |
| | | }; |
| | | |
| | | const codeUrl = ref(''); |
| | |
| | | // 验证码开关 |
| | | const captchaEnabled = ref(true); |
| | | // 租户开关 |
| | | const tenantEnabled = ref(true); |
| | | const tenantEnabled = ref(false); |
| | | |
| | | |
| | | // 注册开关 |
| | |
| | | console.log(loginForm.value); |
| | | const [err] = await to(userStore.login(loginForm.value)); |
| | | if (!err) { |
| | | await router.push({ path: redirect.value || '/' }); |
| | | console.log(redirect.value); |
| | | // await router.push({ path: redirect.value || '/' }); |
| | | await router.push({ path: '/oss' || '/' }); |
| | | loading.value = false; |
| | | } else { |
| | | loading.value = false; |