commit
3a44eacdbb
@ -38,6 +38,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xkcoding.justauth</groupId>
|
<groupId>com.xkcoding.justauth</groupId>
|
||||||
<artifactId>justauth-spring-boot-starter</artifactId>
|
<artifactId>justauth-spring-boot-starter</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-core</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.iocoder.boot</groupId>
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
|
@ -146,7 +146,7 @@ spring:
|
|||||||
client:
|
client:
|
||||||
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
|
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
|
||||||
instance:
|
instance:
|
||||||
prefer-ip: true # 注册实例时,优先使用 IP
|
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||||||
# Spring Boot Admin Server 服务端的相关配置
|
# Spring Boot Admin Server 服务端的相关配置
|
||||||
context-path: /admin # 配置 Spring
|
context-path: /admin # 配置 Spring
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ spring:
|
|||||||
client:
|
client:
|
||||||
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
|
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
|
||||||
instance:
|
instance:
|
||||||
prefer-ip: true # 注册实例时,优先使用 IP
|
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||||||
# Spring Boot Admin Server 服务端的相关配置
|
# Spring Boot Admin Server 服务端的相关配置
|
||||||
context-path: /admin # 配置 Spring
|
context-path: /admin # 配置 Spring
|
||||||
|
|
||||||
|
@ -50,18 +50,18 @@
|
|||||||
"vue-cropper": "^1.0.3",
|
"vue-cropper": "^1.0.3",
|
||||||
"vue-i18n": "9.1.10",
|
"vue-i18n": "9.1.10",
|
||||||
"vue-router": "^4.1.2",
|
"vue-router": "^4.1.2",
|
||||||
"vue-types": "^4.1.1",
|
"vue-types": "^4.2.0",
|
||||||
"web-storage-cache": "^1.1.1"
|
"web-storage-cache": "^1.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^17.0.3",
|
"@commitlint/cli": "^17.0.3",
|
||||||
"@commitlint/config-conventional": "^17.0.3",
|
"@commitlint/config-conventional": "^17.0.3",
|
||||||
"@iconify/json": "^2.1.80",
|
"@iconify/json": "^2.1.81",
|
||||||
"@intlify/vite-plugin-vue-i18n": "^5.0.0",
|
"@intlify/vite-plugin-vue-i18n": "^5.0.1",
|
||||||
"@purge-icons/generated": "^0.8.1",
|
"@purge-icons/generated": "^0.8.1",
|
||||||
"@types/intro.js": "^5.1.0",
|
"@types/intro.js": "^5.1.0",
|
||||||
"@types/lodash-es": "^4.17.6",
|
"@types/lodash-es": "^4.17.6",
|
||||||
"@types/node": "^18.0.6",
|
"@types/node": "^18.6.0",
|
||||||
"@types/nprogress": "^0.2.0",
|
"@types/nprogress": "^0.2.0",
|
||||||
"@types/qrcode": "^1.4.2",
|
"@types/qrcode": "^1.4.2",
|
||||||
"@types/qs": "^6.9.7",
|
"@types/qs": "^6.9.7",
|
||||||
@ -96,11 +96,11 @@
|
|||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-eslint": "^1.7.0",
|
"vite-plugin-eslint": "^1.7.0",
|
||||||
"vite-plugin-html": "^3.2.0",
|
"vite-plugin-html": "^3.2.0",
|
||||||
"vite-plugin-purge-icons": "^0.8.1",
|
"vite-plugin-purge-icons": "^0.8.2",
|
||||||
"vite-plugin-style-import": "^1.4.1",
|
"vite-plugin-style-import": "^1.4.1",
|
||||||
"vite-plugin-svg-icons": "^2.0.1",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
"vite-plugin-windicss": "^1.8.7",
|
"vite-plugin-windicss": "^1.8.7",
|
||||||
"vue-tsc": "^0.38.9",
|
"vue-tsc": "^0.39.0",
|
||||||
"windicss": "^3.5.6",
|
"windicss": "^3.5.6",
|
||||||
"windicss-analysis": "^0.3.5"
|
"windicss-analysis": "^0.3.5"
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useAxios } from '@/hooks/web/useAxios'
|
import { useAxios } from '@/hooks/web/useAxios'
|
||||||
import type { SmsTemplateVO, SmsSendVO } from './types'
|
import type { SmsTemplateVO } from './types'
|
||||||
|
|
||||||
const request = useAxios()
|
const request = useAxios()
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ export const deleteSmsTemplateApi = (id: number) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 发送短信
|
// 发送短信
|
||||||
export function sendSms(data: SmsSendVO) {
|
export const sendSmsApi = (data) => {
|
||||||
return request.post({ url: '/system/sms-template/send-sms', data })
|
return request.post({ url: '/system/sms-template/send-sms', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,6 @@ const editCropper = () => {
|
|||||||
state.dialogVisible = true
|
state.dialogVisible = true
|
||||||
state.cropperVisible = true
|
state.cropperVisible = true
|
||||||
}
|
}
|
||||||
/** 覆盖默认上传行为 */
|
|
||||||
const requestUpload = () => {}
|
|
||||||
/** 向左旋转 */
|
/** 向左旋转 */
|
||||||
const rotateLeft = () => {
|
const rotateLeft = () => {
|
||||||
cropper.value.rotateLeft()
|
cropper.value.rotateLeft()
|
||||||
@ -121,12 +119,7 @@ watch(
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :lg="2" :md="2">
|
<el-col :lg="2" :md="2">
|
||||||
<el-upload
|
<el-upload action="#" :show-file-list="false" :before-upload="beforeUpload">
|
||||||
action="#"
|
|
||||||
:http-request="requestUpload"
|
|
||||||
:show-file-list="false"
|
|
||||||
:before-upload="beforeUpload"
|
|
||||||
>
|
|
||||||
<el-button size="small">
|
<el-button size="small">
|
||||||
<Icon icon="ep:upload-filled" class="mr-5px" />
|
<Icon icon="ep:upload-filled" class="mr-5px" />
|
||||||
选择
|
选择
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, unref } from 'vue'
|
import { ref, unref } from 'vue'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage, ElForm, ElFormItem, ElInput } from 'element-plus'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { useTable } from '@/hooks/web/useTable'
|
import { useTable } from '@/hooks/web/useTable'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
@ -82,23 +82,45 @@ const handleDetail = async (row: SmsTemplateVO) => {
|
|||||||
detailRef.value = row
|
detailRef.value = row
|
||||||
setDialogTile('detail')
|
setDialogTile('detail')
|
||||||
}
|
}
|
||||||
const sendSmsForm = reactive({
|
// ========== 测试相关 ==========
|
||||||
|
const sendSmsForm = ref({
|
||||||
content: '',
|
content: '',
|
||||||
params: '',
|
params: {},
|
||||||
mobile: '',
|
mobile: '141',
|
||||||
templateCode: '',
|
templateCode: '',
|
||||||
templateParams: {}
|
templateParams: {}
|
||||||
})
|
})
|
||||||
// TODO 发送短信
|
const sendSmsRules = ref({
|
||||||
// ========== 测试相关 ==========
|
mobile: [{ required: true, message: '手机不能为空', trigger: 'blur' }],
|
||||||
|
templateCode: [{ required: true, message: '手机不能为空', trigger: 'blur' }],
|
||||||
|
templateParams: {}
|
||||||
|
})
|
||||||
|
const sendVisible = ref(false)
|
||||||
|
|
||||||
const handleSendSms = (row: any) => {
|
const handleSendSms = (row: any) => {
|
||||||
sendSmsForm.content = row.content
|
sendSmsForm.value.content = row.content
|
||||||
sendSmsForm.params = row.params
|
sendSmsForm.value.params = row.params
|
||||||
sendSmsForm.templateCode = row.code
|
sendSmsForm.value.templateCode = row.code
|
||||||
sendSmsForm.templateParams = row.params.reduce(function (obj, item) {
|
sendSmsForm.value.templateParams = row.params.reduce(function (obj, item) {
|
||||||
obj[item] = undefined
|
obj[item] = undefined
|
||||||
return obj
|
return obj
|
||||||
}, {})
|
}, {})
|
||||||
|
sendSmsRules.value.templateParams = row.params.reduce(function (obj, item) {
|
||||||
|
obj[item] = { required: true, message: '参数 ' + item + ' 不能为空', trigger: 'change' }
|
||||||
|
return obj
|
||||||
|
}, {})
|
||||||
|
sendVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const sendSmsTest = () => {
|
||||||
|
const data = {
|
||||||
|
mobile: sendSmsForm.value.mobile,
|
||||||
|
templateCode: sendSmsForm.value.templateCode,
|
||||||
|
templateParams: sendSmsForm.value.templateParams
|
||||||
|
}
|
||||||
|
SmsTemplateApi.sendSmsApi(data)
|
||||||
|
ElMessage.info('发送成功')
|
||||||
|
sendVisible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 初始化 ==========
|
// ========== 初始化 ==========
|
||||||
@ -213,4 +235,37 @@ getList()
|
|||||||
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
|
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
<Dialog v-model="sendVisible" title="测试">
|
||||||
|
<el-form :model="sendSmsForm" :rules="sendSmsRules" label-width="140px">
|
||||||
|
<el-form-item label="模板内容" prop="content">
|
||||||
|
<el-input
|
||||||
|
v-model="sendSmsForm.content"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入模板内容"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号" prop="mobile">
|
||||||
|
<el-input v-model="sendSmsForm.mobile" placeholder="请输入手机号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-for="param in sendSmsForm.params"
|
||||||
|
:key="param"
|
||||||
|
:label="'参数 {' + param + '}'"
|
||||||
|
:prop="'templateParams.' + param"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="sendSmsForm.templateParams[param]"
|
||||||
|
:placeholder="'请输入 ' + param + ' 参数'"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<!-- 操作按钮 -->
|
||||||
|
<template #footer>
|
||||||
|
<el-button type="primary" :loading="loading" @click="sendSmsTest">
|
||||||
|
{{ t('action.test') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="sendVisible = false">{{ t('dialog.close') }}</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user