3737 />
3838 </el-form-item >
3939 <el-form-item label =" Scope" prop =" config.scope" >
40- <el-input v-model =" form.config.scope" placeholder =" openid+profile+email " />
40+ <el-input v-model =" form.config.scope" placeholder =" openid+profile+email " />
4141 </el-form-item >
4242 <el-form-item label =" State" prop =" config.state" >
43- <el-input v-model =" form.config.state" placeholder =" " />
43+ <el-input v-model =" form.config.state" placeholder =" " />
4444 </el-form-item >
4545 <el-form-item
4646 :label =" $t('views.system.authentication.oidc.clientId')"
8181 </el-form-item >
8282 <el-form-item >
8383 <el-checkbox v-model =" form.is_active"
84- >{{ $t('views.system.authentication.oidc.enableAuthentication') }}
84+ >{{ $t('views.system.authentication.oidc.enableAuthentication') }}
8585 </el-checkbox >
8686 </el-form-item >
8787 </el-form >
8888
8989 <div >
90- <el-button @click =" submit(authFormRef)" type =" primary" :disabled =" loading"
91- v-hasPermission ="
92- new ComplexPermission(
93- [RoleConst.ADMIN],
94- [PermissionConst.LOGIN_AUTH_EDIT],
95- [],'OR',)"
90+ <el-button
91+ @click =" submit(authFormRef)"
92+ type =" primary"
93+ :disabled =" loading"
94+ v-hasPermission ="
95+ new ComplexPermission([RoleConst.ADMIN], [PermissionConst.LOGIN_AUTH_EDIT], [], 'OR')
96+ "
9697 >
9798 {{ $t('common.save') }}
9899 </el-button >
102103 </div >
103104</template >
104105<script setup lang="ts">
105- import {reactive , ref , watch , onMounted } from ' vue'
106+ import { reactive , ref , watch , onMounted } from ' vue'
106107import authApi from ' @/api/system-settings/auth-setting'
107- import type {FormInstance , FormRules } from ' element-plus'
108- import {t } from ' @/locales'
109- import {MsgSuccess } from ' @/utils/message'
110- import {PermissionConst , RoleConst } from ' @/utils/permission/data'
111- import {ComplexPermission } from ' @/utils/permission/type'
108+ import type { FormInstance , FormRules } from ' element-plus'
109+ import { t } from ' @/locales'
110+ import { MsgSuccess } from ' @/utils/message'
111+ import { PermissionConst , RoleConst } from ' @/utils/permission/data'
112+ import { ComplexPermission } from ' @/utils/permission/type'
112113
113114const form = ref <any >({
114115 id: ' ' ,
@@ -122,9 +123,9 @@ const form = ref<any>({
122123 clientId: ' ' ,
123124 clientSecret: ' ' ,
124125 fieldMapping: ' {"username": "preferred_username", "email": "email"}' ,
125- redirectUrl: ' '
126+ redirectUrl: ' ' ,
126127 },
127- is_active: true
128+ is_active: true ,
128129})
129130
130131const authFormRef = ref ()
@@ -136,65 +137,65 @@ const rules = reactive<FormRules<any>>({
136137 {
137138 required: true ,
138139 message: t (' views.system.authentication.oidc.authEndpointPlaceholder' ),
139- trigger: ' blur'
140- }
140+ trigger: ' blur' ,
141+ },
141142 ],
142143 ' config.tokenEndpoint' : [
143144 {
144145 required: true ,
145146 message: t (' views.system.authentication.oidc.tokenEndpointPlaceholder' ),
146- trigger: ' blur'
147- }
147+ trigger: ' blur' ,
148+ },
148149 ],
149150 ' config.userInfoEndpoint' : [
150151 {
151152 required: true ,
152153 message: t (' views.system.authentication.oidc.userInfoEndpointPlaceholder' ),
153- trigger: ' blur'
154- }
154+ trigger: ' blur' ,
155+ },
155156 ],
156157 ' config.scope' : [
157158 {
158159 required: true ,
159160 message: t (' views.system.authentication.oidc.scopePlaceholder' ),
160- trigger: ' blur'
161- }
161+ trigger: ' blur' ,
162+ },
162163 ],
163164 ' config.clientId' : [
164165 {
165166 required: true ,
166167 message: t (' views.system.authentication.oidc.clientIdPlaceholder' ),
167- trigger: ' blur'
168- }
168+ trigger: ' blur' ,
169+ },
169170 ],
170171 ' config.clientSecret' : [
171172 {
172173 required: true ,
173174 message: t (' views.system.authentication.oidc.clientSecretPlaceholder' ),
174- trigger: ' blur'
175- }
175+ trigger: ' blur' ,
176+ },
176177 ],
177178 ' config.fieldMapping' : [
178179 {
179180 required: true ,
180181 message: t (' views.system.authentication.oauth2.filedMappingPlaceholder' ),
181- trigger: ' blur'
182- }
182+ trigger: ' blur' ,
183+ },
183184 ],
184185 ' config.redirectUrl' : [
185186 {
186187 required: true ,
187188 message: t (' views.system.authentication.oidc.redirectUrlPlaceholder' ),
188- trigger: ' blur'
189- }
189+ trigger: ' blur' ,
190+ },
190191 ],
191192 ' config.logoutEndpoint' : [
192193 {
193194 required: true ,
194195 message: t (' views.system.authentication.oidc.logoutEndpointPlaceholder' ),
195- trigger: ' blur'
196- }
197- ]
196+ trigger: ' blur' ,
197+ },
198+ ],
198199})
199200
200201const submit = async (formEl : FormInstance | undefined , test ? : string ) => {
@@ -212,16 +213,13 @@ function getDetail() {
212213 authApi .getAuthSetting (form .value .auth_type , loading ).then ((res : any ) => {
213214 if (res .data && JSON .stringify (res .data ) !== ' {}' ) {
214215 form .value = res .data
215- if (
216- form .value .config .fieldMapping === ' ' ||
217- form .value .config .fieldMapping === undefined
218- ) {
216+ if (form .value .config .fieldMapping === ' ' || form .value .config .fieldMapping === undefined ) {
219217 form .value .config .fieldMapping = ' {"username": "preferred_username", "email": "email"}'
220218 }
221219 }
222220 if (! form .value .config .redirectUrl ) {
223- form .value .config .redirectUrl = window .location .origin + window .MaxKB .prefix + ' /api/oidc'
224- }
221+ form .value .config .redirectUrl = window .location .origin + window .MaxKB .prefix + ' /api/oidc'
222+ }
225223 })
226224}
227225
0 commit comments