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