Skip to content

Commit

Permalink
新建用户时允许选择租户
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Nov 2, 2023
1 parent c380c2e commit 205f2d5
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 7 deletions.
Binary file modified nop-auth/model/nop-auth.orm.xlsx
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,8 @@
</entity>
<entity className="io.nop.auth.dao.entity.NopAuthTenant" createTimeProp="createTime" createrProp="createdBy"
deleteFlagProp="delFlag" displayName="租户" name="io.nop.auth.dao.entity.NopAuthTenant"
registerShortName="true" tableName="nop_auth_tenant" updateTimeProp="updateTime" updaterProp="updatedBy"
useLogicalDelete="true" versionProp="version" i18n-en:displayName="Tenant">
registerShortName="true" tableName="nop_auth_tenant" tagSet="dict" updateTimeProp="updateTime"
updaterProp="updatedBy" useLogicalDelete="true" versionProp="version" i18n-en:displayName="Tenant">
<columns>
<column code="TENANT_ID" displayName="主键" mandatory="true" name="tenantId" precision="32" primary="true"
propId="1" stdDataType="string" stdSqlType="VARCHAR" tagSet="seq"
Expand Down
1 change: 1 addition & 0 deletions nop-auth/nop-auth-meta/_templates/_NopAuthUser.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"delFlag": 0,
"version": 0,
"tenantId": "",
"tenantId_label": "",
"createdBy": "",
"createTime": "2000-01-01 14:00:00",
"updatedBy": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ prop:
delFlag: Deleted
version: Version
tenantId: Tenant ID
tenantId_label: null
createdBy: Created By
createTime: Create Time
updatedBy: Updated By
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ prop:
substitutionMappings: 代理人映射
telephone: 座机
tenantId: 租户ID
tenantId_label: 租户ID
updateTime: 修改时间
updatedBy: 修改人
userId: 用户ID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" xmlns:i18n-en="i18n-en" xmlns:ext="ext"
xmlns:xpl="xpl" ext:model="orm" xmlns:c="c" xmlns:graphql="graphql" xmlns:meta-gen="meta-gen" xmlns:biz="biz"
displayName="租户" i18n-en:displayName="Tenant" xmlns:ui="ui">
displayName="租户" i18n-en:displayName="Tenant" tagSet="dict" xmlns:ui="ui">

<entityName>io.nop.auth.dao.entity.NopAuthTenant</entityName>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<prop name="userName" allowFilterOp="eq,contains" xui:defaultFilterOp="contains"/>

<prop name="password" displayName="密码" readable="false" insertable="true" updatable="false">
<schema type="String" domain="password" maxLength="20" />
<schema type="String" domain="password" maxLength="20"/>
</prop>

<prop name="tenantId">
<schema dict="obj/NopAuthTenant"/>
</prop>
</props>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.nop.auth.service.NopAuthConstants;
import io.nop.biz.crud.CrudBizModel;
import io.nop.biz.crud.EntityData;
import io.nop.commons.util.StringHelper;
import io.nop.core.context.IServiceContext;
import io.nop.dao.DaoConstants;
import jakarta.inject.Inject;
Expand Down Expand Up @@ -65,9 +66,9 @@ protected void defaultPrepareSave(EntityData<NopAuthUser> entityData, IServiceCo
user.setUserId(userIdGenerator.generateUserId(user));
user.setOpenId(userIdGenerator.generateUserOpenId(user));

if (user.getTenantId() == null) {
if (StringHelper.isEmpty(user.getTenantId())) {
String tenantId = ContextProvider.currentTenantId();
if (tenantId == null)
if (StringHelper.isEmpty(tenantId))
tenantId = DaoConstants.DEFAULT_TENANT_ID;
user.setTenantId(tenantId);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:extends="_gen/_NopAuthUser.view.xml" x:schema="/nop/schema/xui/xview.xdef" xmlns:x="/nop/schema/xdsl.xdef">
<view x:extends="_gen/_NopAuthUser.view.xml" x:schema="/nop/schema/xui/xview.xdef"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:feature="feature">

<grids>
<grid id="list"/>
Expand All @@ -25,6 +26,7 @@
email[邮件] phone[电话]
openId[用户外部标识]
expireAt[用户过期时间] changePwdAtLogin[登陆后立刻修改密码]
tenantId

===========>extInfo[扩展信息]=========
idType[证件类型] idNbr[证件号]
Expand All @@ -46,6 +48,7 @@
password[密码] *__password2[重复密码]
email[邮件] phone[电话]
expireAt[用户过期时间] changePwdAtLogin[登陆后立刻修改密码]
tenantId[租户]

===========^extInfo[扩展信息]=========
idType[证件类型] idNbr[证件号]
Expand All @@ -62,6 +65,7 @@
</input-password>
</gen-control>
</cell>
<cell id="tenantId" mandatory="false" />
</cells>
</form>

Expand Down

0 comments on commit 205f2d5

Please sign in to comment.