1
This commit is contained in:
parent
3a88754647
commit
216a76781e
@ -107,8 +107,16 @@ export default {
|
||||
const data = {
|
||||
cusCode: fingerprintHash,
|
||||
tenantId: 'main',
|
||||
prodId:id
|
||||
prodId:id,
|
||||
|
||||
};
|
||||
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
||||
// 简单判断是否为手机端
|
||||
if (/android|webos|iphone|ipod|BlackBerry|iemobile|opera mini/i.test(userAgent.toLowerCase())) {
|
||||
data.equipment = '手机端';
|
||||
} else {
|
||||
data.equipment = 'pc端';
|
||||
}
|
||||
// 这里使用箭头函数,确保 `this` 指向当前 Vue 实例
|
||||
this.$axios.$post('/web/chatMain', data).then((res) => {
|
||||
if (res.id != null) {
|
||||
|
@ -21,8 +21,9 @@ export const mutations = {
|
||||
}
|
||||
else if (e.data.startsWith("系统通知")){
|
||||
state.notices.push(e.data);
|
||||
}
|
||||
else {
|
||||
}else if (e.data.startsWith("close")){
|
||||
console.log(e.data)
|
||||
} else {
|
||||
state.messages.push(JSON.parse(e.data));
|
||||
console.log(state.messages);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user