chore: opt template code
This commit is contained in:
@@ -42,7 +42,7 @@ const handleSubmit = async () => {
|
||||
try {
|
||||
let postData = {
|
||||
"name": formData.name,
|
||||
"id": generateBizUniqueID("C"),
|
||||
"id": generateBizUniqueID("CM"),
|
||||
"title": formData.title,
|
||||
"content": formData.content,
|
||||
"cron": formData.cron_expression,
|
||||
|
||||
@@ -153,7 +153,7 @@ export default defineComponent({
|
||||
</div>
|
||||
|
||||
<!-- 说明 -->
|
||||
<div class="border-l-4 border-blue-500 bg-blue-50 dark:bg-blue-950 p-3 rounded text-sm space-y-1">
|
||||
<div class="border-l-4 border-blue-500 bg-blue-50 dark:bg-blue-950 p-3 rounded text-xs space-y-1">
|
||||
<p class="font-semibold text-blue-900 dark:text-blue-200">💡 使用说明</p>
|
||||
<ul class="text-blue-800 dark:text-blue-300 space-y-1 ml-4 list-disc">
|
||||
<li><strong>token 参数:</strong>需要使用加密后的 token,不能直接使用明文模板ID(安全考虑)</li>
|
||||
|
||||
@@ -112,7 +112,7 @@ const handleAddSubmit = async () => {
|
||||
|
||||
// 组建表单数据
|
||||
let postData = {
|
||||
"id": generateBizUniqueID('I'),
|
||||
"id": generateBizUniqueID('IN'),
|
||||
"enable": 1,
|
||||
"template_id": props.templateData.id,
|
||||
"way_id": displayOptions.value[0]?.id,
|
||||
|
||||
@@ -25,7 +25,7 @@ const handleCancel = () => {
|
||||
|
||||
// 添加一条任务
|
||||
const handleSubmit = async () => {
|
||||
const taskId = generateBizUniqueID('T');
|
||||
const taskId = generateBizUniqueID('TK');
|
||||
const postData: Record<string, any> = {
|
||||
id: taskId,
|
||||
name: inputValue.value.trim(),
|
||||
|
||||
@@ -91,7 +91,7 @@ const handleClose = () => {
|
||||
const handleAddSubmit = async () => {
|
||||
// 组建表单数据
|
||||
let postData = {
|
||||
"id": generateBizUniqueID('I'),
|
||||
"id": generateBizUniqueID('IN'),
|
||||
"enable": 1,
|
||||
"task_id": props.editData.id,
|
||||
"way_id": displayOptions.value[0]?.id,
|
||||
|
||||
@@ -189,7 +189,7 @@ onMounted(async () => {
|
||||
<p class="text-sm text-blue-800 dark:text-blue-200">
|
||||
新项目建议使用
|
||||
<router-link to="/templates" class="font-medium underline hover:text-blue-600">消息模板</router-link>
|
||||
功能,它提供更好的内容管理和维护体验。发送任务主要用于兼容历史数据。
|
||||
功能,它提供更好的内容管理和维护体验。发送任务主要用于兼容早期使用数据。
|
||||
<a href="https://engigu.github.io/Message-Push-Nest/guide/template.html" target="_blank"
|
||||
class="font-medium underline hover:text-blue-600 ml-1">
|
||||
了解更多 →
|
||||
|
||||
@@ -18,7 +18,7 @@ function generateUniqueID() {
|
||||
|
||||
function generateBizUniqueID(flag) {
|
||||
const randomString = generateRandomString(10);
|
||||
return `${flag}-${randomString}`;
|
||||
return `${flag}${randomString}`;
|
||||
}
|
||||
|
||||
export { generateUniqueID, generateBizUniqueID };
|
||||
|
||||
Reference in New Issue
Block a user