diff --git a/buyer/src/components/verify/README.md b/buyer/src/components/verify/README.md index ff94a74d..b1fa811e 100644 --- a/buyer/src/components/verify/README.md +++ b/buyer/src/components/verify/README.md @@ -6,7 +6,7 @@ #### 在组件上添加v-if来判断组件显隐 -#### verifyType 验证格式[ 'LOGIN' ,'REGISTER' ]等,详情看接口文档 +#### verifyType 验证格式[ 'LOGIN' ,'REGISTER' ] #### @change方法 获取回调,参数为对象 {status:false,distance:100} status 为回调状态,distance为移动距离 diff --git a/buyer/src/components/verify/verify.js b/buyer/src/components/verify/verify.js index d1651961..eb385668 100644 --- a/buyer/src/components/verify/verify.js +++ b/buyer/src/components/verify/verify.js @@ -26,7 +26,3 @@ export function postVerifyImg (params) { headers: {uuid: storage.getItem('uuid')} }); } - -export function mouseup () { - console.log(111); -} diff --git a/manager/package.json b/manager/package.json index feb7da85..7f29bd03 100644 --- a/manager/package.json +++ b/manager/package.json @@ -47,7 +47,8 @@ "vuex": "^3.4.0", "wangeditor": "^4.5.3", "xlsx": "^0.16.2", - "xss": "^1.0.7" + "xss": "^1.0.7", + "uuid": "^8.3.2" }, "devDependencies": { "@vue/cli-plugin-babel": "^4.4.4", diff --git a/manager/src/App.vue b/manager/src/App.vue index e75223ee..1f8e3787 100644 --- a/manager/src/App.vue +++ b/manager/src/App.vue @@ -5,6 +5,7 @@ diff --git a/manager/src/api/common.js b/manager/src/api/common.js index aea5012d..d0690dda 100644 --- a/manager/src/api/common.js +++ b/manager/src/api/common.js @@ -1,4 +1,4 @@ -import {commonUrl, getRequest} from '@/libs/axios'; +import {commonUrl, getRequest, getRequestWithNoToken, postRequestWithNoToken} from '@/libs/axios'; // 通过id获取子地区 export const getChildRegion = (id) => { @@ -6,6 +6,16 @@ export const getChildRegion = (id) => { }; // 点地图获取地址信息 -export const getRegion = (parpams) => { - return getRequest(`${commonUrl}/common/region/region`, parpams); +export const getRegion = (params) => { + return getRequest(`${commonUrl}/common/region/region`, params); +}; + +// 获取拼图验证 +export const getVerifyImg = (verificationEnums) => { + return getRequestWithNoToken(`${commonUrl}/common/slider/${verificationEnums}`); +}; + +// 拼图验证 +export const postVerifyImg = (params) => { + return postRequestWithNoToken(`${commonUrl}/common/slider/${params.verificationEnums}`, params); }; diff --git a/manager/src/libs/axios.js b/manager/src/libs/axios.js index 3e91766a..6bd6d6c1 100644 --- a/manager/src/libs/axios.js +++ b/manager/src/libs/axios.js @@ -24,6 +24,8 @@ service.interceptors.request.use( ...config.params } } + const uuid = getStore('uuid'); + config.headers['uuid'] = uuid; return config; }, err => { diff --git a/manager/src/router/router.js b/manager/src/router/router.js index 5e3497f7..d62f3de8 100644 --- a/manager/src/router/router.js +++ b/manager/src/router/router.js @@ -5,7 +5,7 @@ export const loginRouter = { path: "/login", name: "login", meta: { - title: "登录 - lili " + title: "登录 - lili运营后台" }, component: () => import("@/views/login.vue") }; diff --git a/manager/src/views/login.vue b/manager/src/views/login.vue index e5c43a0d..d2ea2e2f 100644 --- a/manager/src/views/login.vue +++ b/manager/src/views/login.vue @@ -22,6 +22,13 @@ + +
@@ -41,6 +48,7 @@ import LangSwitch from "@/views/main-components/lang-switch"; import RectLoading from "@/views/my-components/lili/rect-loading"; import CountDownButton from "@/views/my-components/lili/count-down-button"; import util from "@/libs/util.js"; +import verify from '@/views/my-components/verify'; export default { components: { @@ -49,6 +57,7 @@ export default { LangSwitch, Header, Footer, + verify }, data() { return { @@ -79,7 +88,7 @@ export default { }, methods: { mounted() {}, - afterLogin(res) { + afterLogin(res) { // 登录成功后处理 let accessToken = res.result.accessToken; let refreshToken = res.result.refreshToken; this.setStore("accessToken", accessToken); @@ -100,23 +109,28 @@ export default { } }); }, - submitLogin() { + submitLogin() { // 登录操作 this.$refs.usernameLoginForm.validate((valid) => { if (valid) { - this.loading = true; - login({ - username: this.form.username, - password: this.md5(this.form.password), - }).then((res) => { - if (res && res.success) { - this.afterLogin(res); - } else { - this.loading = false; - } - }); + this.$refs.verify.show = true; } }); }, + verifyChange (con) { // 拼图验证码回显 + if (!con.status) return; + + this.loading = true; + login({ + username: this.form.username, + password: this.md5(this.form.password), + }).then((res) => { + if (res && res.success) { + this.afterLogin(res); + } else { + this.loading = false; + } + }).catch(()=>{this.loading = false}); + } }, }; @@ -140,7 +154,12 @@ export default { position: relative; zoom: 1; } - + .verify-con{ + position: absolute; + top: 90px; + z-index: 10; + left: 20px; + } .form { padding-top: 1vh; diff --git a/manager/src/views/my-components/verify/README.md b/manager/src/views/my-components/verify/README.md new file mode 100644 index 00000000..b1fa811e --- /dev/null +++ b/manager/src/views/my-components/verify/README.md @@ -0,0 +1,14 @@ +### 滑动拼图验证 + +### 在页面中引入 .vue文件 + +#### 参数 + +#### 在组件上添加v-if来判断组件显隐 + +#### verifyType 验证格式[ 'LOGIN' ,'REGISTER' ] + +#### @change方法 获取回调,参数为对象 {status:false,distance:100} status 为回调状态,distance为移动距离 + + +#### \ No newline at end of file diff --git a/manager/src/views/my-components/verify/index.vue b/manager/src/views/my-components/verify/index.vue new file mode 100644 index 00000000..2ce1ef45 --- /dev/null +++ b/manager/src/views/my-components/verify/index.vue @@ -0,0 +1,185 @@ + + + diff --git a/manager/src/views/my-components/verify/verify.js b/manager/src/views/my-components/verify/verify.js new file mode 100644 index 00000000..9282f5b3 --- /dev/null +++ b/manager/src/views/my-components/verify/verify.js @@ -0,0 +1,13 @@ + +import {commonUrl, getRequestWithNoToken, postRequestWithNoToken} from '@/libs/axios'; + + +// 获取拼图验证 +export const getVerifyImg = (verificationEnums) => { + return getRequestWithNoToken(`${commonUrl}/common/slider/${verificationEnums}`); +}; + +// 拼图验证 +export const postVerifyImg = (params) => { + return postRequestWithNoToken(`${commonUrl}/common/slider/${params.verificationEnums}`, params); +}; diff --git a/seller/package.json b/seller/package.json index 39448129..dee8c0ed 100644 --- a/seller/package.json +++ b/seller/package.json @@ -44,7 +44,8 @@ "vuex": "^3.4.0", "wangeditor": "^4.6.13", "xlsx": "^0.16.2", - "xss": "^1.0.7" + "xss": "^1.0.7", + "uuid": "^8.3.2" }, "devDependencies": { "@vue/cli-plugin-babel": "^4.4.4", diff --git a/seller/src/App.vue b/seller/src/App.vue index 2a6fc3f5..1f841906 100644 --- a/seller/src/App.vue +++ b/seller/src/App.vue @@ -5,13 +5,15 @@ diff --git a/seller/src/libs/axios.js b/seller/src/libs/axios.js index 037a4c0f..56d3afd8 100644 --- a/seller/src/libs/axios.js +++ b/seller/src/libs/axios.js @@ -24,6 +24,8 @@ service.interceptors.request.use( ...config.params } } + const uuid = getStore('uuid'); + config.headers['uuid'] = uuid; return config; }, err => { diff --git a/seller/src/router/router.js b/seller/src/router/router.js index 1a1828a3..5bb9b88e 100644 --- a/seller/src/router/router.js +++ b/seller/src/router/router.js @@ -5,7 +5,7 @@ export const loginRouter = { path: "/login", name: "login", meta: { - title: "登录 - lili " + title: "登录 - lili商家后台 " }, component: () => import("@/views/login.vue") }; diff --git a/seller/src/views/login.vue b/seller/src/views/login.vue index 8f9dd33d..93747100 100644 --- a/seller/src/views/login.vue +++ b/seller/src/views/login.vue @@ -55,6 +55,13 @@