mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-26 15:07:04 +00:00
feat: 支持自定义短信认证
This commit is contained in:
committed by
Jiangjie.Bai
parent
7a8df3fb7b
commit
62eced61d2
@@ -1455,6 +1455,7 @@
|
||||
}
|
||||
},
|
||||
"setting": {
|
||||
"Custom": "Custom",
|
||||
"CleanHelpText": " Regular cleanup tasks will be executed at 2 o'clock in the morning every day, and the cleaned data cannot be recovered",
|
||||
"Applets": "Applets",
|
||||
"EndpointListHelpMessage": "The service endpoint is the address (port) for the user to access the service. When the user connects to the asset, the service endpoint will be selected according to the endpoint rules and asset tags, and the connection will be established as the access entry to realize the distributed connection of assets.",
|
||||
|
@@ -1450,6 +1450,7 @@
|
||||
}
|
||||
},
|
||||
"setting": {
|
||||
"Custom": "カスタムです",
|
||||
"CleanHelpText": " 定期清理タスクは毎日午前2時に実行され、クリーンアップ後のデータは復元できません",
|
||||
"OAuth2LogoTip": "ヒント: 認証サービス プロバイダー (推奨画像サイズ: 64px*64px)",
|
||||
"EndpointListHelpMessage": "サービスエンドポイントは、ユーザーがサービスにアクセスするためのアドレス(ポート)です。ユーザーがアセットに接続すると、エンドポイントルールとアセットタグに従ってサービスエンドポイントが選択され、接続がアクセスエントリとして確立されます。資産の分散接続を実現します。",
|
||||
|
@@ -1450,6 +1450,7 @@
|
||||
"PublishStatus": "发布状态"
|
||||
},
|
||||
"setting": {
|
||||
"Custom": "自定义",
|
||||
"CleanHelpText": "定期清理任务会在 每天凌晨 2 点执行, 清理后的数据将无法恢复",
|
||||
"OAuth2LogoTip": "提示:认证服务提供商(建议图片大小为: 64px*64px)",
|
||||
"Applets": "远程应用",
|
||||
|
70
src/views/settings/SMS/SMSCustom.vue
Normal file
70
src/views/settings/SMS/SMSCustom.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<BaseSMS ref="baseSms" :title="$tc('setting.Custom')" :config="$data" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseSMS from './Base'
|
||||
import { JsonEditor } from '@/components/FormFields'
|
||||
|
||||
export default {
|
||||
name: 'SMSCustom',
|
||||
components: {
|
||||
BaseSMS
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
url: `/api/v1/settings/setting/?category=custom`,
|
||||
hasDetailInMsg: false,
|
||||
visible: false,
|
||||
moreButtons: [
|
||||
{
|
||||
title: this.$t('common.Test'),
|
||||
loading: false,
|
||||
callback: function(value, form, btn) {
|
||||
btn.loading = true
|
||||
vm.$axios.post(
|
||||
`/api/v1/settings/sms/custom/testing/`,
|
||||
value
|
||||
).then(res => {
|
||||
vm.$message.success(res['msg'])
|
||||
}).catch((error) => {
|
||||
vm.$log.error('err occur')
|
||||
vm.$refs.baseSms.testPerformError(error)
|
||||
}).finally(() => { btn.loading = false })
|
||||
}
|
||||
}
|
||||
],
|
||||
fields: [
|
||||
[
|
||||
this.$t('common.BasicInfo'),
|
||||
[
|
||||
'CUSTOM_SMS_URL', 'CUSTOM_SMS_REQUEST_METHOD', 'CUSTOM_SMS_API_PARAMS'
|
||||
]
|
||||
],
|
||||
[
|
||||
this.$t('common.Other'),
|
||||
[
|
||||
'SMS_TEST_PHONE'
|
||||
]
|
||||
]
|
||||
],
|
||||
fieldsMeta: {
|
||||
'CUSTOM_SMS_API_PARAMS': {
|
||||
label: this.$t('common.Params'),
|
||||
component: JsonEditor
|
||||
}
|
||||
},
|
||||
submitMethod() {
|
||||
return 'patch'
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@@ -7,6 +7,7 @@ import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage
|
||||
import SMSAlibaba from './SMSAlibaba'
|
||||
import SMSTencent from './SMSTencent'
|
||||
import SMSHuawei from './SMSHuawei'
|
||||
import SMSCustom from './SMSCustom'
|
||||
import CMPP2 from './CMPP2'
|
||||
|
||||
export default {
|
||||
@@ -25,7 +26,7 @@ export default {
|
||||
],
|
||||
[
|
||||
this.$t('setting.SMSProvider'), [
|
||||
'ALIYUN', 'QCLOUD', 'HUAWEICLOUD', 'CMPP2'
|
||||
'ALIYUN', 'QCLOUD', 'HUAWEICLOUD', 'CMPP2', 'SMSCustom'
|
||||
]
|
||||
]
|
||||
],
|
||||
@@ -57,6 +58,13 @@ export default {
|
||||
hidden: (form) => {
|
||||
return form['SMS_BACKEND'] !== 'cmpp2'
|
||||
}
|
||||
},
|
||||
SMSCustom: {
|
||||
label: this.$t('setting.Custom'),
|
||||
component: SMSCustom,
|
||||
hidden: (form) => {
|
||||
return form['SMS_BACKEND'] !== 'custom'
|
||||
}
|
||||
}
|
||||
},
|
||||
submitMethod() {
|
||||
|
Reference in New Issue
Block a user