Skip to content

Commit a02ae7f

Browse files
committed
版本检查
1 parent 332a1c3 commit a02ae7f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

plugin/src/popup/router/pages/Index.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
</div>
3232
</div>
3333
</template>
34-
34+
å
3535
<script>
3636
import axios from 'axios';
37+
import config from '../../../../package.json';
3738
3839
export default {
3940
data() {
@@ -81,7 +82,13 @@ export default {
8182
axios
8283
.get('https://raw.githubusercontent.com/dengyuhan/github-tags/master/update.json')
8384
.then(rsp => {
84-
this.updateInfo = rsp.data;
85+
if (rsp.data && rsp.data.version) {
86+
let ver = parseInt(rsp.data.version.replace(new RegExp(/\./, 'g'), ''));
87+
let c_ver = parseInt(config.version.replace(new RegExp(/\./, 'g'), ''));
88+
if (ver > c_ver) {
89+
this.updateInfo = rsp.data;
90+
}
91+
}
8592
})
8693
.catch(error => {
8794
console.error(new Date(), error);

0 commit comments

Comments
 (0)