Skip to content

Commit 2978267

Browse files
committed
fix(link): 修复了当题面中有多个链接时,只有一个链接会使用浏览器打开的bug
当代码提交之后,自动刷新提交页面 修复了缓存页面不会自动刷新的 bug Closes #1, #2, #3
1 parent 65028ca commit 2978267

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

src/components/About.vue

+27-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
<a href="https://github.com/Hukeqing/codeforces-client/releases" target="_blank"
1010
style="text-decoration:none;color: #3a8ee6; margin-left: 40px">Latest Release</a>
1111
</h2>
12-
<p>当前的版本号为:1.0.0</p>
12+
<p style="font-size: 20px">当前的版本号为:{{ version }}</p>
13+
<p>最新的版本号:{{ latestVersion }}
14+
<a :href="updateLink" target="_blank"
15+
style="text-decoration:none;color: #3a8ee6; margin-left: 20px">下载链接</a></p>
1316
<p style="margin-top: 120px; font-size: 14px">
1417
Copyleft (ɔ) 2020.Mauve,版权部分所有,遵循 GPL 授权使用
1518
</p>
@@ -19,6 +22,29 @@
1922
<script>
2023
export default {
2124
name: "Info",
25+
26+
data() {
27+
return {
28+
version: 'v1.0.1',
29+
latestVersion: '',
30+
updateLink: '',
31+
}
32+
},
33+
34+
created() {
35+
fetch('https://api.github.com/repos/Hukeqing/codeforces-client/releases/latest').then(response => response.json()).then(json => {
36+
this.latestVersion = json.tag_name
37+
this.updateLink = json.html_url
38+
if (this.latestVersion !== this.version) {
39+
this.$message({
40+
dangerouslyUseHTMLString: true,
41+
message: '检测到更新的版本:' + this.latestVersion + '<br>' + json.body.replace(/\r\n/g, '<br>').replace(/ - \[x\]/g, '&#12288;')
42+
})
43+
}
44+
}).catch(() => {
45+
this.$message.error('检测版本出错')
46+
})
47+
}
2248
}
2349
</script>
2450

src/components/Home.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<ProblemSet v-show="status==='4-3'" v-on:proMessage="proMessage"></ProblemSet>
7878
<Problem v-show="status==='5'" :contestId="contestId" :problemId="problemId" :wat="watchAttr['5']"
7979
v-on:proMessage="proMessage"></Problem>
80-
<LocalManager v-show="status==='6'"></LocalManager>
80+
<LocalManager v-if="status==='6'"></LocalManager>
8181
<About v-show="status==='7'"></About>
8282
</el-main>
8383
</el-container>

src/components/Submit.vue

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export default {
161161
this.$message.error('提交肯定出错了')
162162
} else {
163163
this.$message.success('提交大概是成功了')
164+
this.code = ''
164165
this.$emit('proMessage', {contest: this.myCid, id: this.myPid, next: '3'})
165166
}
166167
// loading.close()

src/main/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeforces-client",
3-
"version": "0.1.0",
3+
"version": "1.0.1",
44
"main": "main.js",
55
"scripts": {
66
"start": "electron .",

src/static/crawler/problem.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
try {
2020
let $ = cheerio.load(b)
2121
// let problem = $('div[class=problemindexholder]').html().replace(/ href=.+?>/, '>')
22-
let problem = $('div[class=problemindexholder]').html().replace(/<a /, '<a target="_blank" ')
22+
let problem = $('div[class=problemindexholder]').html().replace(/<a /g, '<a target="_blank" ')
2323
callback(false, problem)
2424
} catch (e) {
2525
console.log(e)

0 commit comments

Comments
 (0)