3030 </template >
3131 <div v-if =" configType === 'wechat'" class =" flex align-center mb-16" >
3232 <span class =" lighter mr-8" >{{
33- $t('views.application.applicationAccess.wecomSetting.authenticationSuccessful')
34- }}</span >
35- <el-switch v-if =" configType === 'wechat'" v-model =" form[configType].is_certification" />
33+ $t('views.application.applicationAccess.wecomSetting.authenticationSuccessful')
34+ }}</span >
35+ <el-switch v-if =" configType === 'wechat'" v-model =" form[configType].is_certification" />
3636 </div >
3737
3838 <h4 class =" title-decoration-1 mb-16" >
5656 class =" color-primary"
5757 href =" https://mp.weixin.qq.com/advanced/advanced?action=dev&t=advanced/dev"
5858 target =" _blank"
59- >{{ $t('views.application.applicationAccess.wechatPlatform') }}</a
59+ >{{ $t('views.application.applicationAccess.wechatPlatform') }}</a
6060 >{{ $t('views.application.applicationAccess.wechatSetting.urlInfo') }}
6161 </el-text >
6262 <el-text type =" info" v-if =" configType === 'dingtalk'" >
6565 class =" color-primary"
6666 href =" https://open-dev.dingtalk.com/fe/app?hash=%23%2Fcorp%2Fapp#/corp/app"
6767 target =" _blank"
68- >{{ $t('views.application.applicationAccess.dingtalkPlatform') }}</a
68+ >{{ $t('views.application.applicationAccess.dingtalkPlatform') }}</a
6969 >{{ $t('views.application.applicationAccess.dingtalkSetting.urlInfo') }}
7070 </el-text >
7171 <el-text type =" info" v-if =" configType === 'wecom'" >
7474 class =" color-primary"
7575 href =" https://work.weixin.qq.com/wework_admin/frame#apps"
7676 target =" _blank"
77- >{{ $t('views.application.applicationAccess.wecomPlatform') }}</a
77+ >{{ $t('views.application.applicationAccess.wecomPlatform') }}</a
7878 >{{ $t('views.application.applicationAccess.wecomSetting.urlInfo') }}
7979 </el-text >
8080 <el-text type =" info" v-if =" configType === 'lark'" >
8181 {{ $t('views.application.applicationAccess.copyUrl') }}
8282 <a class =" primary" href =" https://open.feishu.cn/app/" target =" _blank" >{{
83- $t('views.application.applicationAccess.larkPlatform')
84- }}</a
83+ $t('views.application.applicationAccess.larkPlatform')
84+ }}</a
8585 >{{ $t('views.application.applicationAccess.larkSetting.urlInfo') }}
8686 </el-text >
8787 </el-form-item >
9999</template >
100100
101101<script setup lang="ts">
102- import { ref , reactive , computed } from ' vue'
103- import type { FormInstance } from ' element-plus'
104- import { useRoute } from ' vue-router'
105- import { MsgError , MsgSuccess } from ' @/utils/message'
106- import { copyClick } from ' @/utils/clipboard'
107- import { t } from ' @/locales'
108- import { loadSharedApi } from ' @/utils/dynamics-api/shared-api'
109- type PlatformType = ' wechat' | ' dingtalk' | ' wecom' | ' lark' | ' slack'
102+ import {ref , reactive , computed } from ' vue'
103+ import type {FormInstance } from ' element-plus'
104+ import {useRoute } from ' vue-router'
105+ import {MsgError , MsgSuccess } from ' @/utils/message'
106+ import {copyClick } from ' @/utils/clipboard'
107+ import {t } from ' @/locales'
108+ import {loadSharedApi } from ' @/utils/dynamics-api/shared-api'
109+
110+ type PlatformType = ' wechat' | ' dingtalk' | ' wecom' | ' lark' | ' slack' | ' wecomBot'
110111
111112const route = useRoute ()
112113
113114const {
114- params : { id },
115+ params : {id },
115116} = route as any
116117const apiType = computed (() => {
117118 if (route .path .includes (' resource-management' )) {
@@ -136,7 +137,7 @@ const form = reactive<any>({
136137 is_certification: false ,
137138 callback_url: ' ' ,
138139 },
139- dingtalk: { client_id: ' ' , client_secret: ' ' , callback_url: ' ' },
140+ dingtalk: {client_id: ' ' , client_secret: ' ' , callback_url: ' ' },
140141 wecom: {
141142 app_id: ' ' ,
142143 agent_id: ' ' ,
@@ -145,8 +146,13 @@ const form = reactive<any>({
145146 encoding_aes_key: ' ' ,
146147 callback_url: ' ' ,
147148 },
148- lark: { app_id: ' ' , app_secret: ' ' , verification_token: ' ' , callback_url: ' ' },
149- slack: { signing_secret: ' ' , bot_user_token: ' ' , callback_url: ' ' },
149+ lark: {app_id: ' ' , app_secret: ' ' , verification_token: ' ' , callback_url: ' ' },
150+ slack: {signing_secret: ' ' , bot_user_token: ' ' , callback_url: ' ' },
151+ wecomBot: {
152+ token: ' ' ,
153+ encoding_aes_key: ' ' ,
154+ callback_url: ' ' ,
155+ }
150156})
151157
152158const rules = reactive <{ [propName : string ]: any }>({
@@ -272,6 +278,22 @@ const rules = reactive<{ [propName: string]: any }>({
272278 },
273279 ],
274280 },
281+ wecomBot: {
282+ token: [
283+ {
284+ required: true ,
285+ message: t (' views.application.applicationAccess.wecomSetting.tokenPlaceholder' ),
286+ trigger: ' blur' ,
287+ },
288+ ],
289+ encoding_aes_key: [
290+ {
291+ required: true ,
292+ message: t (' views.application.applicationAccess.wecomSetting.encodingAesKeyPlaceholder' ),
293+ trigger: ' blur' ,
294+ },
295+ ],
296+ },
275297})
276298
277299const configFields: { [propName : string ]: { [propName : string ]: any } } = {
@@ -284,34 +306,38 @@ const configFields: { [propName: string]: { [propName: string]: any } } = {
284306 label: t (' views.application.applicationAccess.wechatSetting.appSecret' ),
285307 placeholder: ' ' ,
286308 },
287- token: { label: t (' views.application.applicationAccess.wechatSetting.token' ), placeholder: ' ' },
309+ token: {label: t (' views.application.applicationAccess.wechatSetting.token' ), placeholder: ' ' },
288310 encoding_aes_key: {
289311 label: t (' views.application.applicationAccess.wechatSetting.aesKey' ),
290312 placeholder: ' ' ,
291313 },
292314 },
293315 dingtalk: {
294- client_id: { label: ' Client ID' , placeholder: ' ' },
295- client_secret: { label: ' Client Secret' , placeholder: ' ' },
316+ client_id: {label: ' Client ID' , placeholder: ' ' },
317+ client_secret: {label: ' Client Secret' , placeholder: ' ' },
296318 },
297319 wecom: {
298320 app_id: {
299321 label: t (' views.application.applicationAccess.wecomSetting.cropId' ),
300322 placeholder: ' ' ,
301323 },
302- agent_id: { label: ' Agent ID' , placeholder: ' ' },
303- secret: { label: ' Secret' , placeholder: ' ' },
304- token: { label: ' Token' , placeholder: ' ' },
305- encoding_aes_key: { label: ' EncodingAESKey' , placeholder: ' ' },
324+ agent_id: {label: ' Agent ID' , placeholder: ' ' },
325+ secret: {label: ' Secret' , placeholder: ' ' },
326+ token: {label: ' Token' , placeholder: ' ' },
327+ encoding_aes_key: {label: ' EncodingAESKey' , placeholder: ' ' },
328+ },
329+ wecomBot: {
330+ token: {label: ' Token' , placeholder: ' ' },
331+ encoding_aes_key: {label: ' EncodingAESKey' , placeholder: ' ' },
306332 },
307333 lark: {
308- app_id: { label: ' App ID' , placeholder: ' ' },
309- app_secret: { label: ' App Secret' , placeholder: ' ' },
310- verification_token: { label: ' Verification Token' , placeholder: ' ' },
334+ app_id: {label: ' App ID' , placeholder: ' ' },
335+ app_secret: {label: ' App Secret' , placeholder: ' ' },
336+ verification_token: {label: ' Verification Token' , placeholder: ' ' },
311337 },
312338 slack: {
313- signing_secret: { label: ' Signing Secret' , placeholder: ' ' },
314- bot_user_token: { label: ' Bot User Token' , placeholder: ' ' },
339+ signing_secret: {label: ' Signing Secret' , placeholder: ' ' },
340+ bot_user_token: {label: ' Bot User Token' , placeholder: ' ' },
315341 },
316342}
317343
@@ -331,6 +357,7 @@ const drawerTitle = computed(
331357 wecom: t (' views.application.applicationAccess.wecomSetting.title' ),
332358 lark: t (' views.application.applicationAccess.larkSetting.title' ),
333359 slack: t (' views.application.applicationAccess.slackSetting.title' ),
360+ wecomBot: t (' views.application.applicationAccess.wecomBotSetting.title' ),
334361 })[configType .value ],
335362)
336363
@@ -342,6 +369,7 @@ const infoTitle = computed(
342369 wecom: t (' views.applicationOverview.appInfo.header' ),
343370 lark: t (' views.applicationOverview.appInfo.header' ),
344371 slack: t (' views.applicationOverview.appInfo.header' ),
372+ wecomBot: t (' views.applicationOverview.appInfo.header' ),
345373 })[configType .value ],
346374)
347375
@@ -369,7 +397,7 @@ const submit = async () => {
369397 formRef .value ?.validate (async (valid ) => {
370398 if (valid ) {
371399 try {
372- loadSharedApi ({ type: ' application' , systemType: apiType .value })
400+ loadSharedApi ({type: ' application' , systemType: apiType .value })
373401 .updatePlatformConfig (id , configType .value , form [configType .value ], loading )
374402 .then (() => {
375403 MsgSuccess (t (' common.saveSuccess' ))
@@ -407,5 +435,5 @@ const open = async (id: string, type: PlatformType) => {
407435 }
408436}
409437
410- defineExpose ({ open })
438+ defineExpose ({open })
411439 </script >
0 commit comments