diff --git a/seller/src/api/common.js b/seller/src/api/common.js index 0b024239..5951ab3f 100644 --- a/seller/src/api/common.js +++ b/seller/src/api/common.js @@ -1,4 +1,4 @@ -import { commonUrl, getRequest, uploadFileRequest ,uploadFile} from "@/libs/axios"; +import { commonUrl, getRequest, uploadFileRequest, uploadFile, request} from "@/libs/axios"; // 通过id获取子地区 export const getChildRegion = (id) => { @@ -25,3 +25,10 @@ export const upLoadFileMethods = (bold) => { console.log(bold) return uploadFileRequest(uploadFile, bold); }; + +/** + * 发送短信验证码 + */ +export function sendSms (params) { + return getRequest(`${commonUrl}/common/common/sms/${params.verificationEnums}/${params.mobile}`,params); +} diff --git a/seller/src/api/index.js b/seller/src/api/index.js index 38e125cc..3c124882 100644 --- a/seller/src/api/index.js +++ b/seller/src/api/index.js @@ -37,6 +37,11 @@ export const login = params => { return postRequestWithNoTokenData("/passport/login/userLogin", params); }; +// 手机登陆 +export const storeSmsLogin = params => { + return postRequestWithNoToken("/passport/login/smsLogin", params); +}; + // 登出 export const logout = () => { return postRequest("/passport/login/logout"); @@ -50,7 +55,10 @@ export const userInfo = params => { export const userMsg = params => { return getRequest('/settings/storeSettings', params) } - +//验证短信验证码 +export const validateCode = params => { + return postRequestWithNoToken("/passport/login/resetByMobile", params); +}; // 初始化验证码 export const initCaptcha = params => { return getRequestWithNoToken("/common/captcha/init", params); @@ -107,6 +115,10 @@ export const sendCodeEmail = (email, params) => { export const editEmail = params => { return postRequest("/email/editEmail", params); }; +// 忘记密码并修改 +export const forgetAndModify = params => { + return postRequest("/passport/login/resetPassword", params); +}; // 个人中心修改密码 export const changePass = params => { return postRequest("/passport/login/modifyPass", params); diff --git a/seller/src/router/index.js b/seller/src/router/index.js index 176eb936..7ab1a445 100644 --- a/seller/src/router/index.js +++ b/seller/src/router/index.js @@ -3,7 +3,7 @@ import ViewUI from 'view-design'; import Util from '../libs/util'; import VueRouter from 'vue-router'; import Cookies from 'js-cookie'; -import {routers} from './router'; +import { routers } from './router'; Vue.use(VueRouter); @@ -16,10 +16,10 @@ const RouterConfig = { /** * 解决重复点击菜单会控制台报错bug */ - const routerPush = VueRouter.prototype.push - VueRouter.prototype.push = function push(location) { - return routerPush.call(this, location).catch(error=> error) - } +const routerPush = VueRouter.prototype.push +VueRouter.prototype.push = function push(location) { + return routerPush.call(this, location).catch(error => error) +} export const router = new VueRouter(RouterConfig); @@ -32,10 +32,15 @@ router.beforeEach((to, from, next) => { const name = to.name; if (!Cookies.get('userInfoSeller') && name !== 'login') { - // 判断是否已经登录且前往的页面不是登录页 - next({ - name: 'login' - }); + if (name === 'forgetPassword') { + console.log(name) + Util.toDefaultPage([...routers], name, router, next); + } else { + // 判断是否已经登录且前往的页面不是登录页 + next({ + name: 'login' + }); + } } else if (Cookies.get('userInfoSeller') && name === 'login') { // 判断是否已经登录且前往的是登录页 Util.title(); diff --git a/seller/src/router/router.js b/seller/src/router/router.js index 61acc146..e47bb194 100644 --- a/seller/src/router/router.js +++ b/seller/src/router/router.js @@ -10,6 +10,11 @@ export const loginRouter = { }, component: () => import("@/views/login.vue") }; +export const forgetPasswordRouter = { + path: "/forgetPassword", + name: "forgetPassword", + component: () => import("@/views/ForgetPassword.vue") +}; // 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里 export const otherRouter = { @@ -193,4 +198,4 @@ export const page500 = { component: () => import("@/views/error-page/500.vue") }; // 所有上面定义的路由都要写在下面的routers里 -export const routers = [loginRouter, otherRouter, page500, page403]; +export const routers = [loginRouter, forgetPasswordRouter, otherRouter, page500, page403]; diff --git a/seller/src/views/ForgetPassword.vue b/seller/src/views/ForgetPassword.vue new file mode 100644 index 00000000..8c706cc8 --- /dev/null +++ b/seller/src/views/ForgetPassword.vue @@ -0,0 +1,331 @@ + + + + + diff --git a/seller/src/views/login.vue b/seller/src/views/login.vue index e46cbc8e..64b05c3c 100644 --- a/seller/src/views/login.vue +++ b/seller/src/views/login.vue @@ -2,59 +2,58 @@
-
- -
- - - - - - -
- - - @@ -62,7 +61,8 @@ @@ -184,12 +265,14 @@ export default { display: flex; align-items: center; justify-content: center; + .verify-con { position: absolute; top: 126px; z-index: 10; left: 20px; } + .form { padding-top: 1vh; } @@ -208,9 +291,11 @@ export default { text-align: center; transition: 0.35s; } + .login-btn:hover { opacity: 0.9; border-radius: 10px; } + }