添加后台清缓存的处理
This commit is contained in:
@@ -29,7 +29,12 @@ watch(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function emitUpdateUser(value) {
|
||||||
|
updateUser(value);
|
||||||
|
}
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
uni.$on("update-user", emitUpdateUser);
|
||||||
const token = uni.getStorageSync(
|
const token = uni.getStorageSync(
|
||||||
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
||||||
);
|
);
|
||||||
@@ -42,6 +47,7 @@ onShow(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onHide(() => {
|
onHide(() => {
|
||||||
|
uni.$off("update-user", emitUpdateUser);
|
||||||
websocket.closeWebSocket();
|
websocket.closeWebSocket();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ function request(method, url, data = {}) {
|
|||||||
uni.removeStorageSync(
|
uni.removeStorageSync(
|
||||||
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
||||||
);
|
);
|
||||||
|
uni.$emit("update-user");
|
||||||
}
|
}
|
||||||
if (message === "ROOM_FULL") {
|
if (message === "ROOM_FULL") {
|
||||||
resolve({ full: true });
|
resolve({ full: true });
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ onShow(() => {
|
|||||||
height: 14px;
|
height: 14px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
border: 1rpx solid #fff;
|
border: 1px solid #fff;
|
||||||
}
|
}
|
||||||
.protocol > view:last-child {
|
.protocol > view:last-child {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ onShow(async () => {
|
|||||||
console.log("首页数据:", homeData);
|
console.log("首页数据:", homeData);
|
||||||
if (homeData.user) {
|
if (homeData.user) {
|
||||||
updateUser(homeData.user);
|
updateUser(homeData.user);
|
||||||
if (homeData.user.id === 823) {
|
if ("823,209".indexOf(homeData.user.id) !== -1) {
|
||||||
const show = uni.getStorageSync("show-the-user");
|
const show = uni.getStorageSync("show-the-user");
|
||||||
if (!show) {
|
if (!show) {
|
||||||
showTheUser.value = true;
|
showTheUser.value = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user