3030 <el-form-item :label =" $t('views.applicationOverview.appInfo.LimitDialog.authentication')" >
3131 <el-switch size =" small" v-model =" form.authentication" @change =" firstGeneration" ></el-switch >
3232 </el-form-item >
33- <el-radio-group v-if =" form.authentication" v-model =" form.method" class =" card__radio" >
34- <el-card shadow =" never" class =" mb-16" :class =" form.method === 'replace' ? 'active' : ''" >
33+ <el-radio-group
34+ v-if =" form.authentication"
35+ v-model =" form.authentication_value.type"
36+ class =" card__radio"
37+ >
38+ <el-card
39+ shadow =" never"
40+ class =" mb-16"
41+ :class =" form.authentication_value.type === 'password' ? 'active' : ''"
42+ >
3543 <el-radio value =" replace" size =" large" >
3644 <p class =" mb-4 lighter" >
3745 {{ $t('views.applicationOverview.appInfo.LimitDialog.authenticationValue') }}
4048 <el-form-item class =" ml-24" >
4149 <el-input
4250 class =" authentication-append-input"
43- v-model =" form.authentication_value"
51+ v-model =" form.authentication_value.password_value "
4452 readonly
4553 style =" width : 268px "
4654 >
6977 </el-input >
7078 </el-form-item >
7179 </el-card >
72-
73- <el-card shadow =" never" class =" mb-16" :class =" form.method === 'complete' ? 'active' : ''" >
74- <el-radio value =" complete" size =" large" >
80+ <el-card
81+ shadow =" never"
82+ class =" mb-16"
83+ :class =" form.authentication_value.type === 'login' ? 'active' : ''"
84+ >
85+ <el-radio value =" login" size =" large" >
7586 <p class =" mb-16 lighter" >
7687 {{ $t('views.system.authentication.title') }}
7788 <el-button type =" primary" link @click =" router.push({ path: '' })" >
8899 trigger: 'change',
89100 },
90101 ]"
91- prop =" checkList "
102+ prop =" authentication_value.login_value "
92103 class =" ml-24 border-t"
93104 style =" padding-top : 16px "
94105 >
95- <el-checkbox-group v-model =" form.checkList" >
96- <el-checkbox label =" 账号登录" value =" 账号登录" />
97- <el-checkbox label =" LDAP" value =" LDAP" />
98- <el-checkbox label =" OIDC" value =" OIDC" />
99- <el-checkbox label =" CAS" value =" CAS" />
100- <el-checkbox label =" 企业微信" value =" 企业微信" />
101- <el-checkbox label =" 钉钉" value =" 钉钉" />
102- <el-checkbox label =" 飞书" value =" 飞书" />
106+ <el-checkbox-group v-model =" form.authentication_value.login_value" >
107+ <template v-for =" t in auth_list " :key =" t .value " >
108+ <el-checkbox :label =" t.label" :value =" t.value" />
109+ </template >
103110 </el-checkbox-group >
104111 </el-form-item >
105112 </el-card >
@@ -146,13 +153,13 @@ const {
146153} = route
147154
148155const emit = defineEmits ([' refresh' ])
149-
156+ const auth_list = ref < Array <{ label : string ; value : string }>>([])
150157const limitFormRef = ref ()
151158const form = ref <any >({
152159 access_num: 0 ,
153160 white_active: true ,
154161 white_list: ' ' ,
155- authentication_value: ' ' ,
162+ authentication_value: {} ,
156163 authentication: false ,
157164})
158165
@@ -168,14 +175,26 @@ watch(dialogVisible, (bool) => {
168175 }
169176 }
170177})
171-
178+ watch (
179+ () => form .authentication ,
180+ (b ) => {
181+ if (b ) {
182+ applicationApi .getChatUserAuthType ().then ((ok ) => {
183+ auth_list .value = ok .data
184+ })
185+ }
186+ },
187+ )
172188const open = (data : any ) => {
173189 form .value .access_num = data .access_num
174190 form .value .white_active = data .white_active
175191 form .value .white_list = data .white_list ?.length ? data .white_list ?.join (' \n ' ) : ' '
176192 form .value .authentication_value = data .authentication_value
177193 form .value .authentication = data .authentication
178194 dialogVisible .value = true
195+ applicationApi .getChatUserAuthType ().then ((ok ) => {
196+ auth_list .value = ok .data
197+ })
179198}
180199
181200const submit = async (formEl : FormInstance | undefined ) => {
@@ -207,7 +226,7 @@ function generateAuthenticationValue(length: number = 10) {
207226 .join (' ' )
208227}
209228function refreshAuthentication() {
210- form .value .authentication_value = generateAuthenticationValue ()
229+ form .value .authentication_value . password_value = generateAuthenticationValue ()
211230}
212231
213232function firstGeneration() {
0 commit comments