@jx3box/jx3box-common-ui 9.2.8 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "9.2.8",
3
+ "version": "9.3.0",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Header.vue CHANGED
@@ -112,8 +112,11 @@ export default {
112
112
  const token_version = localStorage.getItem("token_version");
113
113
 
114
114
  if (User.isLogin()) {
115
- if (token_version != global_token_version) {
115
+ // 对于没有token_version或者token_version不是最新的用户,都需要登出
116
+ if (!token_version || token_version != global_token_version) {
117
+ // 先保存最新的token_version
116
118
  localStorage.setItem("token_version", global_token_version);
119
+ // 然后执行登出操作
117
120
  User.destroy().then((res) => {
118
121
  this.$refs.user?.logout();
119
122
  // 清除马甲所有马甲信息
@@ -132,6 +135,11 @@ export default {
132
135
  }
133
136
  });
134
137
  }
138
+ } else {
139
+ // 非登录状态也更新token_version,确保用户下次登录时使用新版本
140
+ if (global_token_version) {
141
+ localStorage.setItem("token_version", global_token_version);
142
+ }
135
143
  }
136
144
  });
137
145
  },
@@ -46,6 +46,7 @@ export default {
46
46
  show: true,
47
47
  visible: false,
48
48
  commit_hash: "",
49
+ isMobile: window.innerWidth < 768,
49
50
  };
50
51
  },
51
52
  computed: {
@@ -91,6 +92,9 @@ export default {
91
92
  });
92
93
  },
93
94
  handleContrast(item) {
95
+ if (this.isMobile) {
96
+ return;
97
+ }
94
98
  this.commit_hash = item.commit_hash;
95
99
  this.visible = true;
96
100
  },
@@ -165,6 +169,9 @@ export default {
165
169
 
166
170
  .u-compare {
167
171
  .db;
172
+ @media screen and (max-width: @phone) {
173
+ .none;
174
+ }
168
175
  }
169
176
  }
170
177
  .pointer;