Skip to content

Commit

Permalink
Merge pull request #3 from vidar-team/dev
Browse files Browse the repository at this point in the history
v0.5.0
  • Loading branch information
wuhan005 authored May 27, 2020
2 parents 6e15446 + 3d0b9e5 commit 020d3ab
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
17 changes: 11 additions & 6 deletions src/components/SubmitFlag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
<v-card-text>
<h2>POST <code style="background-color: #1c1c1c">/flag</code></h2><br>
<p>Content-Type: application/json</p>
<p>Header:<pre>Authorization: {{info.Token}}</pre></p>
<p>Header:
<pre>Authorization: {{info.Token}}</pre>
</p>
<p>Body:</p>
<code class="pa-3" style="width: 100%; background-color: #1c1c1c; color: rgba(255, 255, 255, 0.7);">{"flag": "your_flag_here"}</code>
<code class="pa-3" style="width: 100%; background-color: #1c1c1c; color: rgba(255, 255, 255, 0.7);">{"flag":
"your_flag_here"}</code>
<br><br>
<v-divider></v-divider>
<br>
<p>
<code class="pa-3" style="width: 100%; background-color: #1c1c1c; color: rgba(255, 255, 255, 0.7);">curl -X POST {{utils.baseURL}}/flag -H 'Authorization: {{info.Token}}' -d '{ "flag": "your_flag_here" }'</code>
<code class="pa-3" style="width: 100%; background-color: #1c1c1c; color: rgba(255, 255, 255, 0.7);">curl
-X POST {{baseURL}}/api/flag -H 'Authorization: {{info.Token}}' -d '{ "flag": "your_flag_here" }'</code>
</p>
</v-card-text>
</v-card>
Expand All @@ -22,15 +26,16 @@
name: "SubmitFlag",
data: () => ({
info: null
info: null,
baseURL: window.location.origin,
}),
mounted() {
this.getInfo()
},
methods:{
getInfo(){
methods: {
getInfo() {
this.utils.GET("/team/info").then(res => {
this.info = res
})
Expand Down
3 changes: 3 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import axios from 'axios'

let baseURL = '/api'
if (process.env.NODE_ENV === 'development') {
baseURL = 'http://localhost:19999/api'
}

export default {
baseURL: baseURL,
Expand Down
12 changes: 11 additions & 1 deletion src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<v-snackbar v-model="messageBar" color="error" :timeout="2000" :top="true">{{ message }}</v-snackbar>

<v-row align="center" justify="center" style="margin-top: 12%;">
<h1 class="display-2 font-weight-thin">HCTF</h1>
<h1 class="display-2 font-weight-thin">{{base.Title}}</h1>
</v-row>
<br>
<v-card class="mx-auto" max-width="400">
Expand Down Expand Up @@ -59,6 +59,10 @@
messageBar: false,
message: '',
base: {
Title: ''
},
nameRules: [
v => !!v || this.$i18n.t('login.account_empty')
],
Expand All @@ -72,6 +76,12 @@
}
},
created() {
this.utils.GET('/base').then(res => {
this.base = res
}).catch(() => this.base.Title = 'Cardinal')
},
methods: {
onLogin() {
if (!this.$refs.form.validate()) {
Expand Down

0 comments on commit 020d3ab

Please sign in to comment.