新增聊天模块

This commit is contained in:
gxwebsoft
2024-04-28 01:36:43 +08:00
parent 16e38b6f31
commit d4713ad3e4
14 changed files with 1611 additions and 22 deletions
+11
View File
@@ -320,3 +320,14 @@ export const decrypt = (encrypt) => {
const bytes = CryptoJS.AES.decrypt(encrypt, APP_SECRET);
return bytes.toString(CryptoJS.enc.Utf8);
};
// 获取当前登录用户ID
export const getUserId = () => {
let userId = 0;
const uid = Number(localStorage.getItem('UserId'));
if (uid) {
userId = uid;
return userId;
}
return userId;
};