新增聊天模块
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user