1. 增加 yudao-spring-boot-starter-tenant 租户的组件

2. 改造 UserDO,接入多租户
This commit is contained in:
YunaiV
2021-12-04 21:09:49 +08:00
parent ccb56b3b99
commit 7c8fe2fc50
35 changed files with 426 additions and 15 deletions

View File

@ -20,8 +20,20 @@
<text class="tit fill">昵称</text>
<input class="input" v-model="userInfo.nickname" type="text" maxlength="8" placeholder="请输入昵称" placeholder-class="placeholder">
</view>
<u-cell-group>
<u-cell title="昵称" :value="userInfo.nickname" isLink @click="nicknameClick()"></u-cell>
</u-cell-group>
<u-modal :show="nicknameOpen" title="修改昵称" showCancelButton @confirm="nicknameSubmit" @cancel="nicknameCancel">
<view class="slot-content">
<u--form labelPosition="left" :model="nicknameForm" :rules="nicknameRules" ref="nicknameForm" errorType="toast">
<u-form-item prop="nickname">
<u--input v-model="nicknameForm.nickname" placeholder="请输入昵称" border="none"></u--input>
</u-form-item>
</u--form>
</view>
</u-modal>
<mix-button ref="confirmBtn" text="保存资料" marginTop="80rpx" @onConfirm="confirm"></mix-button>
</view>
</template>
@ -32,6 +44,16 @@
uploadProgress: 100, //头像上传进度
tempAvatar: '',
userInfo: {},
nicknameOpen: false,
nicknameForm: {
nickname: ''
},
nicknameRules: {
nickname: [{
required: true,
message: '请输入昵称'
}]
}
}
},
computed: {
@ -50,6 +72,30 @@
this.userInfo = {avatar, nickname, gender};
},
methods: {
nicknameClick() {
this.nicknameOpen = true;
this.nicknameForm.nickname = this.userInfo.nickname;
},
nicknameCancel() {
this.nicknameOpen = false;
},
nicknameSubmit() {
this.$refs.nicknameForm.validate().then(() => {
this.loading = true;
// 执行登陆
const { mobile, code, password} = this.form;
const loginPromise = this.loginType == 'password' ? login(mobile, password) :
smsLogin(mobile, code);
loginPromise.then(data => {
// 登陆成功
this.loginSuccessCallBack(data);
}).catch(errors => {
}).finally(() => {
this.loading = false;
})
}).catch(errors => {
});
},
// 提交修改
async confirm() {
// 校验信息是否变化