Commit b2cf9a08 authored by 郭志伟's avatar 郭志伟

feat(tenant): 组件根据tenantId过滤

parent 85f2a80f
...@@ -4,6 +4,7 @@ import { omitBy } from 'lodash'; ...@@ -4,6 +4,7 @@ import { omitBy } from 'lodash';
type GetWhere = { type GetWhere = {
id?: number | unknown; id?: number | unknown;
tenantId?: number | unknown; tenantId?: number | unknown;
enable: number;
}; };
export default class TenantAuthController extends Controller { export default class TenantAuthController extends Controller {
...@@ -25,9 +26,15 @@ export default class TenantAuthController extends Controller { ...@@ -25,9 +26,15 @@ export default class TenantAuthController extends Controller {
} }
public async get(ctx: Context) { public async get(ctx: Context) {
const where: GetWhere = {}; const where: GetWhere = {
enable: 1,
};
if (ctx.headers['qg-tenant-id']) where.tenantId = ctx.headers['qg-tenant-id']; if (ctx.headers['qg-tenant-id']) where.tenantId = ctx.headers['qg-tenant-id'];
if (ctx.query.id) where.tenantId = ctx.query.id; if (ctx.query.id) where.id = ctx.query.id;
if (!where.tenantId && !where.id) {
ctx.body = ctx.helper.ok({});
return;
}
try { try {
const result = await ctx.model.TenantAuth.findOne({ where }); const result = await ctx.model.TenantAuth.findOne({ where });
ctx.body = ctx.helper.ok(result); ctx.body = ctx.helper.ok(result);
......
...@@ -30,6 +30,7 @@ export default class DynamicComponent extends Vue { ...@@ -30,6 +30,7 @@ export default class DynamicComponent extends Vue {
pre[cur.name] = { ...cur, children}; pre[cur.name] = { ...cur, children};
return pre; return pre;
}, {}); }, {});
this.onHideFinanceTabChange(this.hideFinanceTab);
} else { } else {
this.eleConfig = chunk(newVal, 2); this.eleConfig = chunk(newVal, 2);
} }
......
...@@ -160,7 +160,6 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) { ...@@ -160,7 +160,6 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
onAuthStateChange(val) { onAuthStateChange(val) {
const options = val ? ['购物车', '自定义'] : ['购物车', '分享', '自定义']; const options = val ? ['购物车', '自定义'] : ['购物车', '分享', '自定义'];
this.$set(this.floatSchema[1].formControl[0], 'options', options); this.$set(this.floatSchema[1].formControl[0], 'options', options);
console.log(this.floatSchema[1].formControl[0].options);
} }
@Watch('pageData', { immediate: true, deep: true }) @Watch('pageData', { immediate: true, deep: true })
......
...@@ -1501,9 +1501,9 @@ ...@@ -1501,9 +1501,9 @@
} }
}, },
"@qg/citrus-ui": { "@qg/citrus-ui": {
"version": "0.3.15", "version": "0.3.17",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.15.tgz", "resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.17.tgz",
"integrity": "sha512-r2+TQNexoWy3Gl7egv5cmkA79lyIkWeVLJJt9wQcKzlBXo0vS9HHL/4jHVZJCJpi8ilDavtrjuouQN/aevekmg==", "integrity": "sha512-4sF/iTs5ea6PTqObR2dC+IjCAHuJ1qq2W17WOb5UDpbMQywcReK78xxaMiglOyLYB7h1fiHPttsB/SPbF+0rFA==",
"requires": { "requires": {
"@better-scroll/core": "^2.1.1", "@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.23.9", "@qg/cherry-ui": "^2.23.9",
......
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