Commit 2b784d180ed32b206d2d4593e1c8a9ab1ef7a04d
1 parent
1be09d09
调整 sso 界面,移除多租户的选择
Showing
1 changed file
with
0 additions
and
41 deletions
yudao-ui-admin/src/views/sso.vue
| @@ -20,11 +20,6 @@ | @@ -20,11 +20,6 @@ | ||
| 20 | </el-tabs> | 20 | </el-tabs> |
| 21 | <div> | 21 | <div> |
| 22 | <el-form ref="loginForm" :model="loginForm" :rules="LoginRules" class="login-form"> | 22 | <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> | ||
| 28 | <!-- 授权范围的选择 --> | 23 | <!-- 授权范围的选择 --> |
| 29 | 此第三方应用请求获得以下权限: | 24 | 此第三方应用请求获得以下权限: |
| 30 | <el-form-item prop="scopes"> | 25 | <el-form-item prop="scopes"> |
| @@ -56,10 +51,7 @@ | @@ -56,10 +51,7 @@ | ||
| 56 | </template> | 51 | </template> |
| 57 | 52 | ||
| 58 | <script> | 53 | <script> |
| 59 | -import {getTenantIdByName} from "@/api/system/tenant"; | ||
| 60 | -import {getTenantEnable} from "@/utils/ruoyi"; | ||
| 61 | import {authorize, getAuthorize} from "@/api/login"; | 54 | import {authorize, getAuthorize} from "@/api/login"; |
| 62 | -import {getTenantName, setTenantId} from "@/utils/auth"; | ||
| 63 | 55 | ||
| 64 | export default { | 56 | export default { |
| 65 | name: "Login", | 57 | name: "Login", |
| @@ -67,7 +59,6 @@ export default { | @@ -67,7 +59,6 @@ export default { | ||
| 67 | return { | 59 | return { |
| 68 | tenantEnable: true, | 60 | tenantEnable: true, |
| 69 | loginForm: { | 61 | loginForm: { |
| 70 | - tenantName: "芋道源码", | ||
| 71 | scopes: [], // 已选中的 scope 数组 | 62 | scopes: [], // 已选中的 scope 数组 |
| 72 | }, | 63 | }, |
| 73 | params: { // URL 上的 client_id、scope 等参数 | 64 | params: { // URL 上的 client_id、scope 等参数 |
| @@ -81,35 +72,10 @@ export default { | @@ -81,35 +72,10 @@ export default { | ||
| 81 | name: '', | 72 | name: '', |
| 82 | logo: '', | 73 | logo: '', |
| 83 | }, | 74 | }, |
| 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 | - }, | ||
| 105 | loading: false | 75 | loading: false |
| 106 | }; | 76 | }; |
| 107 | }, | 77 | }, |
| 108 | created() { | 78 | created() { |
| 109 | - // 租户开关 | ||
| 110 | - this.tenantEnable = getTenantEnable(); | ||
| 111 | - this.getCookie(); | ||
| 112 | - | ||
| 113 | // 解析参数 | 79 | // 解析参数 |
| 114 | // 例如说【自动授权不通过】:client_id=default&redirect_uri=https%3A%2F%2Fwww.iocoder.cn&response_type=code&scope=user.read%20user.write | 80 | // 例如说【自动授权不通过】:client_id=default&redirect_uri=https%3A%2F%2Fwww.iocoder.cn&response_type=code&scope=user.read%20user.write |
| 115 | // 例如说【自动授权通过】:client_id=default&redirect_uri=https%3A%2F%2Fwww.iocoder.cn&response_type=code&scope=user.read | 81 | // 例如说【自动授权通过】:client_id=default&redirect_uri=https%3A%2F%2Fwww.iocoder.cn&response_type=code&scope=user.read |
| @@ -162,13 +128,6 @@ export default { | @@ -162,13 +128,6 @@ export default { | ||
| 162 | }) | 128 | }) |
| 163 | }, | 129 | }, |
| 164 | methods: { | 130 | methods: { |
| 165 | - getCookie() { | ||
| 166 | - const tenantName = getTenantName(); | ||
| 167 | - this.loginForm = { | ||
| 168 | - ...this.loginForm, | ||
| 169 | - tenantName: tenantName ? tenantName : this.loginForm.tenantName, | ||
| 170 | - }; | ||
| 171 | - }, | ||
| 172 | handleAuthorize(approved) { | 131 | handleAuthorize(approved) { |
| 173 | this.$refs.loginForm.validate(valid => { | 132 | this.$refs.loginForm.validate(valid => { |
| 174 | if (!valid) { | 133 | if (!valid) { |