Compare commits

...

3 Commits

Author SHA1 Message Date
左哥
4bbf595d2b 232 2025-10-29 23:34:11 +08:00
左哥
82366257e0 Merge branch 'main' of https://git.1024tool.vip/xz/wx-chant-admin into main 2025-10-29 21:55:49 +08:00
左哥
195ee1f0d1 qwewe 2025-10-29 21:55:29 +08:00
5 changed files with 44 additions and 6 deletions

View File

@ -1,5 +1,5 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'production'
VITE_APP_BASE_API = 'https://mini-chat.1024tool.vip/api'
VITE_SERVE = "https://mini-chat.1024tool.vip/api/"
VITE_APP_BASE_API_img = "https://mini-chat.1024tool.vip/"
VITE_APP_BASE_API = 'https://dsjhd9s.tbmw.cn/api/'
VITE_SERVE = "https://dsjhd9s.tbmw.cn/api/"
VITE_APP_BASE_API_img = "https://dsjhd9s.tbmw.cn/"

1
components.d.ts vendored
View File

@ -8,7 +8,6 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
ChatRecord: typeof import('./src/components/ChatRecord/index.vue')['default']
copy: typeof import('./src/components/UserCard copy/index.vue')['default']
ElAside: typeof import('element-plus/es')['ElAside']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']

View File

@ -32,3 +32,12 @@ export const get_messages = (params) => {
params
})
}
export const send_template_message = (data) => {
return request({
url: `wechat/subscribe`,
method: 'post',
data
})
}

View File

@ -37,6 +37,14 @@
>
{{ isSending ? '发送中...' : '发送' }}
</el-button>
<el-button
type="primary"
@click="sendTemplateMessage"
:loading="isSending2"
style="height: 60px;"
>
{{ isSending2 ? '发送中...' : '发送模板消息' }}
</el-button>
</div>
</div>
</div>
@ -50,7 +58,7 @@ import WxUserCard from '@/components/UserCard/index.vue'
import UserMessage from '@/components/UserMessage/index.vue'
import mihoutai from '@/assets/images/mihoutai.png'
import V3Emoji from "vue3-emoji";
import { getUserList, send_message, get_messages } from '@/api/chat'
import { getUserList, send_message, get_messages, send_template_message } from '@/api/chat'
import { useRoute } from 'vue-router'
import { uploadFile } from '@/api/upload'
import { ElMessage } from 'element-plus'
@ -835,6 +843,28 @@ const restartMessageTimer = () => {
}
}
const sendTemplateMessage = async (templateId) => {
if (!activeUser.value.sender_id) return
try {
await send_template_message({
"app_id": route.query.app_id,
"app_secret": route.query.app_secret,
"template_id": route.query.template_id,
"touser": activeUser.value.sender_id
})
ElMessage({ type: 'success', message: '模板消息发送成功' })
// ID
setTimeout(() => {
getMessages(false, 1) //
}, 500)
} catch (error) {
console.error('模板消息发送失败:', error)
ElMessage({ type: 'error', message: '模板消息发送失败' })
}
}
//
onMounted(() => {
getUsers()

View File

@ -504,7 +504,7 @@ const uploadSuccess = (e) => {
}
const handleDetail = (row) => {
router.push({ path: '/chat', query: { app_id: row.app_id } })
router.push({ path: '/chat', query: { app_id: row.app_id, app_secret: row.app_secret, template_id: row.template_id } })
}
const qrCode = ref('')