From ea580327dbcee44dc9b3ce114c8d0fabf4f54a24 Mon Sep 17 00:00:00 2001 From: John Wu <524306184@qq.com> Date: Wed, 6 May 2020 12:18:35 +0800 Subject: [PATCH 1/2] fix: curl command guide --- src/components/SubmitFlag.vue | 17 +++++++++++------ src/utils.js | 3 +++ 2 files changed, 14 insertions(+), 6 deletions(-) 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, From 3d0b9e512bba36b94db90eac6e3164d90e516f6e Mon Sep 17 00:00:00 2001 From: John Wu <524306184@qq.com> Date: Wed, 6 May 2020 12:36:20 +0800 Subject: [PATCH 2/2] fix: login page title --- src/views/Login.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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()) {