mirror of
https://github.com/chillzhuang/Saber.git
synced 2024-11-25 11:59:27 +08:00
🎉 增加多租户开关
This commit is contained in:
parent
307fb464ed
commit
f843875db4
@ -3,9 +3,10 @@
|
||||
*/
|
||||
export default {
|
||||
title: "saber",
|
||||
indexTitle: 'Saber Admin',
|
||||
tenantMode: true, // 是否开启租户模式
|
||||
logo: "S",
|
||||
key: 'saber',//配置主键,目前用于存储
|
||||
indexTitle: 'Saber Admin',
|
||||
lockPage: '/lock',
|
||||
tokenTime: 6000,
|
||||
//http的status默认放行不才用统一处理的,
|
||||
|
@ -5,7 +5,7 @@
|
||||
ref="loginForm"
|
||||
:model="loginForm"
|
||||
label-width="0">
|
||||
<el-form-item prop="tenantCode">
|
||||
<el-form-item v-if="tenantMode" prop="tenantCode">
|
||||
<el-input size="small"
|
||||
@keyup.enter.native="handleLogin"
|
||||
v-model="loginForm.tenantCode"
|
||||
@ -50,10 +50,12 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import website from '@/config/website';
|
||||
export default {
|
||||
name: "userlogin",
|
||||
data() {
|
||||
return {
|
||||
tenantMode: website.tenantMode,
|
||||
loginForm: {
|
||||
tenantCode: "000000",
|
||||
username: "admin",
|
||||
|
@ -44,6 +44,7 @@
|
||||
getDeptTree
|
||||
} from "@/api/system/dept";
|
||||
import {mapGetters} from "vuex";
|
||||
import website from '@/config/website';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -76,9 +77,11 @@
|
||||
{
|
||||
label: "租户编号",
|
||||
prop: "tenantCode",
|
||||
search: true,
|
||||
search: website.tenantMode,
|
||||
hide: !website.tenantMode,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: website.tenantMode,
|
||||
rules: [{
|
||||
required: true,
|
||||
message: "请输入租户编号",
|
||||
|
@ -67,6 +67,7 @@ import {
|
||||
getRoleTree
|
||||
} from "@/api/system/role";
|
||||
import { mapGetters } from "vuex";
|
||||
import website from '@/config/website';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -92,6 +93,8 @@ export default {
|
||||
index: true,
|
||||
selection: true,
|
||||
viewBtn: true,
|
||||
dialogWidth: 300,
|
||||
dialogHeight: 400,
|
||||
column: [
|
||||
{
|
||||
label: "角色名称",
|
||||
@ -109,9 +112,10 @@ export default {
|
||||
{
|
||||
label: "租户编号",
|
||||
prop: "tenantCode",
|
||||
search: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: website.tenantMode,
|
||||
hide: !website.tenantMode,
|
||||
span: 24,
|
||||
rules: [{
|
||||
required: true,
|
||||
@ -119,6 +123,27 @@ export default {
|
||||
trigger: "blur"
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: "所属租户",
|
||||
prop: "tenantCode",
|
||||
type: "tree",
|
||||
dicUrl: "/api/blade-system/tenant/select",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: website.tenantMode,
|
||||
span: 24,
|
||||
props: {
|
||||
label: "tenantName",
|
||||
value: "tenantCode"
|
||||
},
|
||||
hide: !website.tenantMode,
|
||||
search: website.tenantMode,
|
||||
rules: [{
|
||||
required: true,
|
||||
message: "请输入所属租户",
|
||||
trigger: "click"
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: "角色别名",
|
||||
prop: "roleAlias",
|
||||
|
@ -54,6 +54,7 @@
|
||||
import {getDeptTree} from "@/api/system/dept";
|
||||
import {getRoleTree} from "@/api/system/role";
|
||||
import {mapGetters} from "vuex";
|
||||
import website from '@/config/website';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -102,11 +103,13 @@
|
||||
required: true,
|
||||
message: "请输入登录账号",
|
||||
trigger: "blur"
|
||||
}]
|
||||
}],
|
||||
span: website.tenantMode ? 12 : 24,
|
||||
},
|
||||
{
|
||||
label: "租户编号",
|
||||
prop: "tenantCode",
|
||||
hide: !website.tenantMode,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
@ -120,7 +123,11 @@
|
||||
label: "tenantName",
|
||||
value: "tenantCode"
|
||||
},
|
||||
search: true,
|
||||
hide: !website.tenantMode,
|
||||
addDisplay: website.tenantMode,
|
||||
editDisplay: website.tenantMode,
|
||||
viewDisplay: website.tenantMode,
|
||||
search: website.tenantMode,
|
||||
rules: [{
|
||||
required: true,
|
||||
message: "请输入所属租户",
|
||||
@ -274,7 +281,7 @@
|
||||
ids.push(ele.id);
|
||||
});
|
||||
return ids.join(",");
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
rowSave(row, loading) {
|
||||
|
Loading…
Reference in New Issue
Block a user