Skip to content

Commit

Permalink
fix: curl command guide
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhan005 committed May 6, 2020
1 parent 6fdfba3 commit ea58032
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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

0 comments on commit ea58032

Please sign in to comment.