From dae9ffa16e577d2db964c7e3c5a0bc1bc893daee Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Fri, 22 Dec 2023 14:57:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=99=BB=E5=BD=95=E9=AA=8C?= =?UTF-8?q?=E8=AF=81--=E6=94=B9=E4=B8=BA=E6=BB=91=E5=8A=A8=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- anrui-system-ui/package.json | 1 + anrui-system-ui/src/api/user.js | 10 +++++++ anrui-system-ui/src/main.js | 2 ++ anrui-system-ui/src/store/modules/user.js | 5 ++-- anrui-system-ui/src/views/login/login.vue | 17 +++++++----- anrui-system-ui/src/views/login/verify.vue | 31 ++++++++++++++++++++++ 6 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 anrui-system-ui/src/views/login/verify.vue diff --git a/anrui-system-ui/package.json b/anrui-system-ui/package.json index 047fd90d88..d171e1609e 100644 --- a/anrui-system-ui/package.json +++ b/anrui-system-ui/package.json @@ -29,6 +29,7 @@ "viewerjs": "^1.9.0", "vue": "2.6.10", "vue-amap": "^0.5.10", + "vue-monoplasty-slide-verify": "^1.3.1", "vue-router": "3.0.6", "vuex": "3.1.0", "vuex-persistedstate": "^4.0.0", diff --git a/anrui-system-ui/src/api/user.js b/anrui-system-ui/src/api/user.js index 535b7c5f45..0f02ea3a29 100644 --- a/anrui-system-ui/src/api/user.js +++ b/anrui-system-ui/src/api/user.js @@ -9,6 +9,16 @@ export function login(data) { headers: {'Content-Type': 'application/json'} }) } + +export function loginByNoVeriCode(data) { + return request({ + url: '/portal/v1/sysuser/loginByNoVeriCode', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }) +} + // 用户注册 export function registUser(data) { return request({ diff --git a/anrui-system-ui/src/main.js b/anrui-system-ui/src/main.js index e95aabe47c..faa5ab71f6 100644 --- a/anrui-system-ui/src/main.js +++ b/anrui-system-ui/src/main.js @@ -4,6 +4,8 @@ import 'normalize.css/normalize.css' // A modern alternative to CSS resets import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' +import slideVerify from 'vue-monoplasty-slide-verify' +Vue.use(slideVerify) Vue.use(ElementUI) diff --git a/anrui-system-ui/src/store/modules/user.js b/anrui-system-ui/src/store/modules/user.js index 01ddfc7c87..d2f453ee9e 100644 --- a/anrui-system-ui/src/store/modules/user.js +++ b/anrui-system-ui/src/store/modules/user.js @@ -1,4 +1,4 @@ -import { login, logout, getInfo } from '@/api/user' +import { login, logout, getInfo, loginByNoVeriCode } from '@/api/user' import { getStorage, setStorage, removeStorage } from '@/utils/auth' import router, { resetRouter } from '@/router' @@ -25,7 +25,8 @@ const actions = { // user login login({ commit }, userInfo) { return new Promise((resolve, reject) => { - login(userInfo).then(response => { + // login(userInfo).then(response => { + loginByNoVeriCode(userInfo).then(response => { const { data } = response commit('SET_TOKEN', data.token) setStorage(data.token) diff --git a/anrui-system-ui/src/views/login/login.vue b/anrui-system-ui/src/views/login/login.vue index f2c318417a..959aa4add7 100644 --- a/anrui-system-ui/src/views/login/login.vue +++ b/anrui-system-ui/src/views/login/login.vue @@ -27,7 +27,8 @@ trigger="click" v-model="loginCode" @show="codeShow"> - + + 登 录