diff --git a/src/components/SubmitFlag.vue b/src/components/SubmitFlag.vue
index 901110c..e3739d6 100644
--- a/src/components/SubmitFlag.vue
+++ b/src/components/SubmitFlag.vue
@@ -4,14 +4,18 @@
POST /flag
Content-Type: application/json
- Header:
Authorization: {{info.Token}}
+ Header:
+
Authorization: {{info.Token}}
+
Body:
- {"flag": "your_flag_here"}
+ {"flag":
+ "your_flag_here"}
- curl -X POST {{utils.baseURL}}/flag -H 'Authorization: {{info.Token}}' -d '{ "flag": "your_flag_here" }'
+ curl
+ -X POST {{baseURL}}/api/flag -H 'Authorization: {{info.Token}}' -d '{ "flag": "your_flag_here" }'
@@ -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
})
diff --git a/src/utils.js b/src/utils.js
index 755226b..d3a0e03 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -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,
diff --git a/src/views/Login.vue b/src/views/Login.vue
index ff1aac1..acd5880 100644
--- a/src/views/Login.vue
+++ b/src/views/Login.vue
@@ -3,7 +3,7 @@
{{ message }}
- HCTF
+ {{base.Title}}
@@ -59,6 +59,10 @@
messageBar: false,
message: '',
+ base: {
+ Title: ''
+ },
+
nameRules: [
v => !!v || this.$i18n.t('login.account_empty')
],
@@ -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()) {