232
This commit is contained in:
parent
82366257e0
commit
4bbf595d2b
@ -1,5 +1,5 @@
|
|||||||
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
|
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
|
||||||
NODE_ENV = 'production'
|
NODE_ENV = 'production'
|
||||||
VITE_APP_BASE_API = 'https://mini-chat.1024tool.vip/api'
|
VITE_APP_BASE_API = 'https://dsjhd9s.tbmw.cn/api/'
|
||||||
VITE_SERVE = "https://mini-chat.1024tool.vip/api/"
|
VITE_SERVE = "https://dsjhd9s.tbmw.cn/api/"
|
||||||
VITE_APP_BASE_API_img = "https://mini-chat.1024tool.vip/"
|
VITE_APP_BASE_API_img = "https://dsjhd9s.tbmw.cn/"
|
||||||
|
|||||||
11
components.d.ts
vendored
11
components.d.ts
vendored
@ -12,10 +12,13 @@ declare module 'vue' {
|
|||||||
ElButton: typeof import('element-plus/es')['ElButton']
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
ElCard: typeof import('element-plus/es')['ElCard']
|
ElCard: typeof import('element-plus/es')['ElCard']
|
||||||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
||||||
|
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
|
||||||
ElCol: typeof import('element-plus/es')['ElCol']
|
ElCol: typeof import('element-plus/es')['ElCol']
|
||||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||||
|
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||||
|
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||||
ElForm: typeof import('element-plus/es')['ElForm']
|
ElForm: typeof import('element-plus/es')['ElForm']
|
||||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||||
ElHeader: typeof import('element-plus/es')['ElHeader']
|
ElHeader: typeof import('element-plus/es')['ElHeader']
|
||||||
@ -30,15 +33,23 @@ declare module 'vue' {
|
|||||||
ElOption: typeof import('element-plus/es')['ElOption']
|
ElOption: typeof import('element-plus/es')['ElOption']
|
||||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||||
ElPopover: typeof import('element-plus/es')['ElPopover']
|
ElPopover: typeof import('element-plus/es')['ElPopover']
|
||||||
|
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||||
|
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||||
|
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||||
ElRow: typeof import('element-plus/es')['ElRow']
|
ElRow: typeof import('element-plus/es')['ElRow']
|
||||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||||
ElSelectV2: typeof import('element-plus/es')['ElSelectV2']
|
ElSelectV2: typeof import('element-plus/es')['ElSelectV2']
|
||||||
|
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
|
||||||
ElTable: typeof import('element-plus/es')['ElTable']
|
ElTable: typeof import('element-plus/es')['ElTable']
|
||||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||||
|
ElTag: typeof import('element-plus/es')['ElTag']
|
||||||
|
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
|
||||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||||
|
ElTour: typeof import('element-plus/es')['ElTour']
|
||||||
|
ElTourStep: typeof import('element-plus/es')['ElTourStep']
|
||||||
IndexUser: typeof import('./src/components/TagClass/indexUser.vue')['default']
|
IndexUser: typeof import('./src/components/TagClass/indexUser.vue')['default']
|
||||||
KeyWords: typeof import('./src/components/KeyWords/index.vue')['default']
|
KeyWords: typeof import('./src/components/KeyWords/index.vue')['default']
|
||||||
MaterialPublic: typeof import('./src/components/MaterialPublic/index.vue')['default']
|
MaterialPublic: typeof import('./src/components/MaterialPublic/index.vue')['default']
|
||||||
|
|||||||
@ -32,3 +32,12 @@ export const get_messages = (params) => {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const send_template_message = (data) => {
|
||||||
|
return request({
|
||||||
|
url: `wechat/subscribe`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -37,6 +37,14 @@
|
|||||||
>
|
>
|
||||||
{{ isSending ? '发送中...' : '发送' }}
|
{{ isSending ? '发送中...' : '发送' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="sendTemplateMessage"
|
||||||
|
:loading="isSending2"
|
||||||
|
style="height: 60px;"
|
||||||
|
>
|
||||||
|
{{ isSending2 ? '发送中...' : '发送模板消息' }}
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -50,7 +58,7 @@ import WxUserCard from '@/components/UserCard/index.vue'
|
|||||||
import UserMessage from '@/components/UserMessage/index.vue'
|
import UserMessage from '@/components/UserMessage/index.vue'
|
||||||
import mihoutai from '@/assets/images/mihoutai.png'
|
import mihoutai from '@/assets/images/mihoutai.png'
|
||||||
import V3Emoji from "vue3-emoji";
|
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 { useRoute } from 'vue-router'
|
||||||
import { uploadFile } from '@/api/upload'
|
import { uploadFile } from '@/api/upload'
|
||||||
import { ElMessage } from 'element-plus'
|
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(() => {
|
onMounted(() => {
|
||||||
getUsers()
|
getUsers()
|
||||||
|
|||||||
@ -504,7 +504,7 @@ const uploadSuccess = (e) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleDetail = (row) => {
|
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('')
|
const qrCode = ref('')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user