diff --git a/src/components/lib/AjaxTable.vue b/src/components/lib/AjaxTable.vue
index e7be4caf..a90821d8 100644
--- a/src/components/lib/AjaxTable.vue
+++ b/src/components/lib/AjaxTable.vue
@@ -44,7 +44,7 @@ export default {
this.loading = false;
})
.catch(err => {
- this.$SegmentMessage.error(this, '[Ajax Table] Request Failed.');
+ this.$SegmentMessage.error(this, '[Ajax Table] Request Failed');
console.log(err);
});
}
diff --git a/src/components/lib/captcha.vue b/src/components/lib/captcha.vue
new file mode 100644
index 00000000..2594e795
--- /dev/null
+++ b/src/components/lib/captcha.vue
@@ -0,0 +1,52 @@
+
+
+
+
![]()
+
+
+
+
+
+
diff --git a/src/components/problem/list.vue b/src/components/problem/list.vue
index 8a287bac..33c3cdd7 100644
--- a/src/components/problem/list.vue
+++ b/src/components/problem/list.vue
@@ -67,7 +67,7 @@ export default {
this.data_count = data.res;
})
.catch(err => {
- this.$SegmentMessage.error(this, '[Problem List] Get List Length Failed.');
+ this.$SegmentMessage.error(this, '[Problem List] Get List Length Failed');
console.log(err);
});
}
diff --git a/src/components/user/register.vue b/src/components/user/register.vue
index 7b880e9d..8de7ea20 100644
--- a/src/components/user/register.vue
+++ b/src/components/user/register.vue
@@ -18,6 +18,8 @@
+
Captcha
+
Register
Cancel
@@ -30,6 +32,7 @@
\ No newline at end of file
diff --git a/src/sfconfig.js b/src/sfconfig.js
index 9c5b4b40..74cb0e4e 100644
--- a/src/sfconfig.js
+++ b/src/sfconfig.js
@@ -1,6 +1,6 @@
export default {
api: {
- server: 'http://172.32.5.25:8000/api'
+ server: 'http://172.32.1.144:8000/api'
},
markdown: {
gfm: true,
@@ -9,5 +9,6 @@ export default {
pedantic: false,
smartLists: true,
smartypants: false,
- }
+ },
+ captchaKeyMax: 2000000000
};
\ No newline at end of file
diff --git a/src/store/captcha.js b/src/store/captcha.js
new file mode 100644
index 00000000..b0b44e98
--- /dev/null
+++ b/src/store/captcha.js
@@ -0,0 +1,18 @@
+import sfconfig from './../sfconfig';
+
+const captchastore = {
+ state: {
+ captchaKey: null,
+ captchaAnswer: null
+ },
+ mutations: {
+ newCaptcha(state) {
+ state.captchaKey = Math.floor(Math.random() * sfconfig.captchaKeyMax) + 1;
+ },
+ setAnswer(state, data) {
+ state.captchaAnswer = data.val;
+ }
+ }
+};
+
+export default captchastore;
\ No newline at end of file
diff --git a/src/store/store.js b/src/store/store.js
index c6d04ae9..9d6f0e3d 100644
--- a/src/store/store.js
+++ b/src/store/store.js
@@ -4,9 +4,11 @@ import Vuex from 'vuex';
Vue.use(Vuex);
import userstore from './user';
+import captchastore from './captcha';
export default new Vuex.Store({
modules: {
- user: userstore
+ user: userstore,
+ captcha: captchastore
}
});
\ No newline at end of file