Sfoglia il codice sorgente

Task 银农登录去掉短信登录

rongxin_dev
zhaodengke 3 mesi fa
parent
commit
02d6db13d8
5 ha cambiato i file con 210 aggiunte e 6 eliminazioni
  1. +13
    -3
      src/permission.js
  2. +9
    -0
      src/router/index.js
  3. +9
    -3
      src/utils/request.js
  4. +9
    -0
      src/views/yinnong/my.vue
  5. +170
    -0
      src/views/yinnongNoSMSLogin.vue

+ 13
- 3
src/permission.js Vedi File

@@ -71,6 +71,7 @@ const whiteList = [
'/lawEnforcement/complaintAdd',
'/homesteadLogin',
'/yinnongLogin',
'/yinnongLiteLogin',
'/lawEnforcement/userRegister',
'/lawEnforcement/companyRegister',

@@ -280,9 +281,18 @@ router.beforeEach((to, from, next) => {
} else {
try {
let loginUrl = Cookies.get("_Login_url");
if (loginUrl && loginUrl.indexOf("onlineHomeLogin") !== -1) {
next({ path: `/onlineHomeLogin?redirect=${to.fullPath}` })
return;
console.log('登录页面: ' + loginUrl)
if (loginUrl) {
if(loginUrl.indexOf("onlineHomeLogin") !== -1)
{
next({ path: `/onlineHomeLogin?redirect=${to.fullPath}` })
return;
}
else if(loginUrl.indexOf("yinnongLiteLogin") !== -1)
{
next({ path: '/yinnongLiteLogin' })
return;
}
}
} catch (e) { console.log(e); }
if ('/authenticRight/index'.indexOf(to.path) !== -1) {


+ 9
- 0
src/router/index.js Vedi File

@@ -472,6 +472,15 @@ export const constantRoutes = [
},
component: (resolve) => require(['@/views/yinnongLogin'], resolve)
},
{
path: '/yinnongLiteLogin',
name: 'yinnongLiteLogin',
meta: {
title: '登录页',
hidden: true,
},
component: (resolve) => require(['@/views/yinnongNoSMSLogin'], resolve)
},
{
path: '/yinnongIndex',
name: 'yinnongIndex',


+ 9
- 3
src/utils/request.js Vedi File

@@ -83,9 +83,15 @@ if(responseInterceptor === undefined){
console.log('退出')
try {
let loginUrl = Cookies.get("_Login_url");
if(loginUrl && loginUrl.indexOf("onlineHomeLogin") !== -1) {
window.location.href = loginUrl;
return;
console.log('登录页面: ' + loginUrl)
if(loginUrl) {
if(loginUrl.indexOf("onlineHomeLogin") !== -1
|| loginUrl.indexOf('yinnongLiteLogin') !== -1
)
{
window.location.href = loginUrl;
return;
}
}
} catch (e) { console.log(e); }



+ 9
- 0
src/views/yinnong/my.vue Vedi File

@@ -141,6 +141,7 @@
import {getInfo, logout} from "../../api/login";
import request from '@/utils/request'
import {A_myDoneList, A_myTodoList} from "@/api/audit/aauditpipeline";
import Cookies from "js-cookie";
export default {
components: {
yinnongIndex
@@ -184,6 +185,14 @@
},
logout(){
this.$store.dispatch('LogOut').then(() => {
let loginUrl = Cookies.get("_Login_url");
if(loginUrl) {
if(loginUrl.indexOf('yinnongLiteLogin') !== -1)
{
this.$router.push({path:"/yinnongLiteLogin"})
return;
}
}
this.$router.push({path:"../yinnongLogin"})
});
},


+ 170
- 0
src/views/yinnongNoSMSLogin.vue Vedi File

@@ -0,0 +1,170 @@
<template>
<div class="app-container">
<div class="title">
<img style="display: block;width: 90%;margin: 0 auto;" src="../../static/images/yinnong/yinnongLogo1.png" alt="">
</div>
<div style="background: rgba(255, 255, 255, .2);margin:1.5rem auto 0;width: calc(100% - 40px);border-radius: 20px;overflow: hidden;border: 1px solid #fff;">
<p class="login-title">用户登录</p>
<van-form style="padding:30px 0;">
<van-field
v-model="formData.username"
placeholder="请输入手机号/账号"
left-icon="contact-o"
:rules="[{ required: true, message:'' }]"
/>
<van-field
v-model="formData.password"
type="password"
left-icon="edit"
style="margin-top: 20px"
placeholder="请输入密码"
:rules="[{ required: true, message:'' }]"
/>
<div style="display: flex;width: 90%;margin: 20px auto 0;">
<van-field
v-model="formData.code"
left-icon="shield-o"
center
clearable
placeholder="图形验证码"
/>
<div style="border-radius: 100vh;width: 120px;margin-left: 20px;overflow: hidden;flex-shrink: 0;">
<img style="width: 120px;display: block;transform: scale(1.1);" :src="codeUrl" @click="getCode" />
</div>
</div>
<van-checkbox style="float: left;margin-top:10px;margin-left:20px;" v-model="formData.rememberMe" shape="square">记住密码</van-checkbox>
<!-- <p style="float: right;margin-top:10px;margin-right:20px;color:#1D6FE9 ">忘记密码</p>-->
<div class="clear"></div>
<div style="margin: 50px 16px 16px;border-radius: 100vh;overflow: hidden;">
<van-button block type="info" color="linear-gradient(to right, #97eedc, #5166f5)" native-type="submit" @click="handleLogin">登录</van-button>
<!-- <p style="text-align: center;margin-top: 20px;color:#878787 " @click="showMessagePop">短信验证码登录</p>-->
</div>
</van-form>
</div>
</div>
</template>
<style scoped lang="scss">
.app-container{
background: #fafafa url("../../static/images/yinnong/login_bg.png") no-repeat top;
background-size: 100% auto;
min-height: 100vh;
/*overflow: hidden;*/
}
/deep/ .van-cell{
background: #eaeef6;
border-radius: 100vh;
width: 90%;
margin: 0 auto;
}

.title{
padding-top: 15%;
width: 100%;
margin: 0 auto;
}

.login-title {
text-align: center;
font-size: .5rem;
font-weight: bold;
color: white;
background: linear-gradient(to right, rgb(151, 238, 220), rgb(81, 102, 245));
padding-top: .3rem;
padding-bottom: .3rem;
}
</style>
<script>
import { getCodeImg, } from "../api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from "../utils/jsencrypt";
//引用wx sdk
import wx from "weixin-js-sdk";
export default {
name: "yinnongLogin",
data() {
return {
smsCodeValue:"",
showKeyboard:false,
formData: {
username: "", //账号
password: "", //密码
code: null, //图片验证码
uuid: null, //识别uuid
mobile: null, //手机号
smsCode: null, //短信验证码
memberName:null, //身份信息
idcard:null, //身份号码
rememberMe:false
},
loading: false,
codeUrl: "", //验证码
};
},
created() {
this.getCode();
this.getCookie();
this.reset();
},
methods: {
reset(){

},
getCode() {
getCodeImg().then((res) => {
this.formData.uuid = res.uuid;
this.codeUrl = "data:image/gif;base64," + res.img;
});
},
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const rememberMe = Cookies.get("rememberMe");
this.formData = {
username: username === undefined ? this.formData.username : username,
password:
password === undefined ? this.formData.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
},
handleLogin(values) {
if (this.formData.rememberMe) {
Cookies.set("username", this.formData.username, { expires: 30 });
Cookies.set("password", encrypt(this.formData.password), { expires: 30 });
Cookies.set("rememberMe", this.formData.rememberMe, { expires: 30 });
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove("rememberMe");
}
//账号密码登录
if (this.formData.username == "") {
this.$dialog.alert({
message: '账号不能为空',
});
return false;
} else if (this.formData.password == "") {
this.$dialog.alert({
message: '密码不能为空',
});
return false;
} else if (!this.formData.code) {
this.$dialog.alert({
message: '图片验证码不能为空',
});
return false;
}
this.$store
.dispatch("Login", this.formData)
.then(() => {
this.$router.push({ path: "/yinnong/doneCompleted/completedNew" }).catch(() => {});
})
.catch((error) => {
//console.log(error)
this.formData.code = '';
this.loading = false;
this.getCode();
});
},
},
};
</script>

Caricamento…
Annulla
Salva