Skip to content

Commit f818419

Browse files
committed
调整 sso 界面,移除多租户的选择
1 parent dc3a17c commit f818419

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

src/views/sso.vue

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
</el-tabs>
2121
<div>
2222
<el-form ref="loginForm" :model="loginForm" :rules="LoginRules" class="login-form">
23-
<el-form-item prop="tenantName" v-if="tenantEnable">
24-
<el-input v-model="loginForm.tenantName" type="text" auto-complete="off" placeholder='租户'>
25-
<svg-icon slot="prefix" icon-class="tree" class="el-input__icon input-icon"/>
26-
</el-input>
27-
</el-form-item>
2823
<!-- 授权范围的选择 -->
2924
此第三方应用请求获得以下权限:
3025
<el-form-item prop="scopes">
@@ -56,18 +51,14 @@
5651
</template>
5752

5853
<script>
59-
import {getTenantIdByName} from "@/api/system/tenant";
60-
import {getTenantEnable} from "@/utils/ruoyi";
6154
import {authorize, getAuthorize} from "@/api/login";
62-
import {getTenantName, setTenantId} from "@/utils/auth";
6355
6456
export default {
6557
name: "Login",
6658
data() {
6759
return {
6860
tenantEnable: true,
6961
loginForm: {
70-
tenantName: "芋道源码",
7162
scopes: [], // 已选中的 scope 数组
7263
},
7364
params: { // URL 上的 client_id、scope 等参数
@@ -81,35 +72,10 @@ export default {
8172
name: '',
8273
logo: '',
8374
},
84-
LoginRules: {
85-
tenantName: [
86-
{required: true, trigger: "blur", message: "租户不能为空"},
87-
{
88-
validator: (rule, value, callback) => {
89-
// debugger
90-
getTenantIdByName(value).then(res => {
91-
const tenantId = res.data;
92-
if (tenantId && tenantId >= 0) {
93-
// 设置租户
94-
setTenantId(tenantId)
95-
callback();
96-
} else {
97-
callback('租户不存在');
98-
}
99-
});
100-
},
101-
trigger: 'blur'
102-
}
103-
]
104-
},
10575
loading: false
10676
};
10777
},
10878
created() {
109-
// 租户开关
110-
this.tenantEnable = getTenantEnable();
111-
this.getCookie();
112-
11379
// 解析参数
11480
// 例如说【自动授权不通过】:client_id=default&redirect_uri=https%3A%2F%2Fwww.iocoder.cn&response_type=code&scope=user.read%20user.write
11581
// 例如说【自动授权通过】:client_id=default&redirect_uri=https%3A%2F%2Fwww.iocoder.cn&response_type=code&scope=user.read
@@ -162,13 +128,6 @@ export default {
162128
})
163129
},
164130
methods: {
165-
getCookie() {
166-
const tenantName = getTenantName();
167-
this.loginForm = {
168-
...this.loginForm,
169-
tenantName: tenantName ? tenantName : this.loginForm.tenantName,
170-
};
171-
},
172131
handleAuthorize(approved) {
173132
this.$refs.loginForm.validate(valid => {
174133
if (!valid) {

0 commit comments

Comments
 (0)