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