!226 修复升级hutool导致的bug

Merge pull request !226 from xingyu/master
This commit is contained in:
芋道源码 2022-07-25 05:17:45 +00:00 committed by Gitee
commit 3a44eacdbb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 83 additions and 29 deletions

View File

@ -38,6 +38,12 @@
<dependency>
<groupId>com.xkcoding.justauth</groupId>
<artifactId>justauth-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>

View File

@ -146,7 +146,7 @@ spring:
client:
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
instance:
prefer-ip: true # 注册实例时,优先使用 IP
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
# Spring Boot Admin Server 服务端的相关配置
context-path: /admin # 配置 Spring

View File

@ -156,7 +156,7 @@ spring:
client:
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
instance:
prefer-ip: true # 注册实例时,优先使用 IP
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
# Spring Boot Admin Server 服务端的相关配置
context-path: /admin # 配置 Spring

View File

@ -50,18 +50,18 @@
"vue-cropper": "^1.0.3",
"vue-i18n": "9.1.10",
"vue-router": "^4.1.2",
"vue-types": "^4.1.1",
"vue-types": "^4.2.0",
"web-storage-cache": "^1.1.1"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@iconify/json": "^2.1.80",
"@intlify/vite-plugin-vue-i18n": "^5.0.0",
"@iconify/json": "^2.1.81",
"@intlify/vite-plugin-vue-i18n": "^5.0.1",
"@purge-icons/generated": "^0.8.1",
"@types/intro.js": "^5.1.0",
"@types/lodash-es": "^4.17.6",
"@types/node": "^18.0.6",
"@types/node": "^18.6.0",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.4.2",
"@types/qs": "^6.9.7",
@ -96,11 +96,11 @@
"vite-plugin-compression": "^0.5.1",
"vite-plugin-eslint": "^1.7.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-svg-icons": "^2.0.1",
"vite-plugin-windicss": "^1.8.7",
"vue-tsc": "^0.38.9",
"vue-tsc": "^0.39.0",
"windicss": "^3.5.6",
"windicss-analysis": "^0.3.5"
},

View File

@ -1,5 +1,5 @@
import { useAxios } from '@/hooks/web/useAxios'
import type { SmsTemplateVO, SmsSendVO } from './types'
import type { SmsTemplateVO } from './types'
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 })
}

View File

@ -30,8 +30,6 @@ const editCropper = () => {
state.dialogVisible = true
state.cropperVisible = true
}
/** 覆盖默认上传行为 */
const requestUpload = () => {}
/** 向左旋转 */
const rotateLeft = () => {
cropper.value.rotateLeft()
@ -121,12 +119,7 @@ watch(
<template #footer>
<el-row>
<el-col :lg="2" :md="2">
<el-upload
action="#"
:http-request="requestUpload"
:show-file-list="false"
:before-upload="beforeUpload"
>
<el-upload action="#" :show-file-list="false" :before-upload="beforeUpload">
<el-button size="small">
<Icon icon="ep:upload-filled" class="mr-5px" />
选择

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import { reactive, ref, unref } from 'vue'
import { ref, unref } from 'vue'
import dayjs from 'dayjs'
import { ElMessage } from 'element-plus'
import { ElMessage, ElForm, ElFormItem, ElInput } from 'element-plus'
import { DICT_TYPE } from '@/utils/dict'
import { useTable } from '@/hooks/web/useTable'
import { useI18n } from '@/hooks/web/useI18n'
@ -82,23 +82,45 @@ const handleDetail = async (row: SmsTemplateVO) => {
detailRef.value = row
setDialogTile('detail')
}
const sendSmsForm = reactive({
// ========== ==========
const sendSmsForm = ref({
content: '',
params: '',
mobile: '',
params: {},
mobile: '141',
templateCode: '',
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) => {
sendSmsForm.content = row.content
sendSmsForm.params = row.params
sendSmsForm.templateCode = row.code
sendSmsForm.templateParams = row.params.reduce(function (obj, item) {
sendSmsForm.value.content = row.content
sendSmsForm.value.params = row.params
sendSmsForm.value.templateCode = row.code
sendSmsForm.value.templateParams = row.params.reduce(function (obj, item) {
obj[item] = undefined
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>
</template>
</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>