Conflicts: config/index.jswulanhaote
@@ -4,5 +4,5 @@ const prodEnv = require('./prod.env') | |||||
module.exports = merge(prodEnv, { | module.exports = merge(prodEnv, { | ||||
NODE_ENV: '"development"', | NODE_ENV: '"development"', | ||||
VUE_APP_BASE_API:'"/dev-api"' | |||||
VUE_APP_BASE_API: '"/api"' | |||||
}) | }) |
@@ -10,20 +10,20 @@ module.exports = { | |||||
assetsSubDirectory: 'static', | assetsSubDirectory: 'static', | ||||
assetsPublicPath: '/', | assetsPublicPath: '/', | ||||
proxyTable: { | proxyTable: { | ||||
"/dev-api": { | |||||
"/api": { | |||||
// 请求的目标主机 | // 请求的目标主机 | ||||
target: 'http://116.255.135.38:8081/nsgk_test/', | |||||
//target: 'http://192.168.31.107:8080/', | |||||
//target: 'http://116.255.135.38:8081/nsgk_test/', | |||||
target: 'http://localhost:8080/', | |||||
changeOrigin: true, | changeOrigin: true, | ||||
pathRewrite: { | pathRewrite: { | ||||
'^/dev-api': '' | |||||
'^/api': '' | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
// Various Dev Server settings | // Various Dev Server settings | ||||
host: '0.0.0.0', // can be overwritten by process.env.HOST | host: '0.0.0.0', // can be overwritten by process.env.HOST | ||||
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined | |||||
port: 85, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined | |||||
autoOpenBrowser: false, | autoOpenBrowser: false, | ||||
errorOverlay: true, | errorOverlay: true, | ||||
notifyOnErrors: true, | notifyOnErrors: true, | ||||
@@ -1,4 +1,5 @@ | |||||
'use strict' | 'use strict' | ||||
module.exports = { | module.exports = { | ||||
NODE_ENV: '"production"' | |||||
NODE_ENV: '"production"', | |||||
VUE_APP_BASE_API: '"/api"' | |||||
} | } |
@@ -6,6 +6,9 @@ | |||||
<meta name="viewport" | <meta name="viewport" | ||||
content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum=scale=1.0" /> | content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum=scale=1.0" /> | ||||
<link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico"> | <link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico"> | ||||
<script src="/static/js/ol.js"></script> | |||||
<script type="text/javascript" | |||||
src="http://api.tianditu.gov.cn/api?v=4.0&tk=cc4aba6e967096098249efa069733067"></script> | |||||
<title>农燊高科</title> | <title>农燊高科</title> | ||||
</head> | </head> | ||||
@@ -5676,6 +5676,11 @@ | |||||
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", | ||||
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" | ||||
}, | }, | ||||
"jquery": { | |||||
"version": "3.6.0", | |||||
"resolved": "https://registry.npm.taobao.org/jquery/download/jquery-3.6.0.tgz?cache=0&sync_timestamp=1614705639458&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjquery%2Fdownload%2Fjquery-3.6.0.tgz", | |||||
"integrity": "sha1-xyoJ8Vwb3OFC9J2/EXC9+K2sJHA=" | |||||
}, | |||||
"js-base64": { | "js-base64": { | ||||
"version": "2.6.4", | "version": "2.6.4", | ||||
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", | "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", | ||||
@@ -11,6 +11,7 @@ | |||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
"axios": "^0.21.1", | "axios": "^0.21.1", | ||||
"jquery": "^3.6.0", | |||||
"global": "^4.4.0", | "global": "^4.4.0", | ||||
"js-cookie": "^2.2.1", | "js-cookie": "^2.2.1", | ||||
"lib-flexible": "^0.3.2", | "lib-flexible": "^0.3.2", | ||||
@@ -0,0 +1,80 @@ | |||||
import request from '@/utils/request' | |||||
//查询列表 | |||||
export function listSampling(data){ | |||||
return request({ | |||||
url:'service/sampling/list', | |||||
method:'get', | |||||
params:data | |||||
}) | |||||
} | |||||
// 删除农户抽样 | |||||
export function delSampling(id) { | |||||
return request({ | |||||
url: '/service/sampling/remove/' + id, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
export function updateSampling(data) { | |||||
return request({ | |||||
url: '/service/sampling/edit', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 查询农户抽样详细 | |||||
export function getInvestigate(id) { | |||||
return request({ | |||||
url: '/service/sampling/getInvestigate/' + id, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
// 新增农户抽样 | |||||
export function addSampling(data) { | |||||
return request({ | |||||
url: '/service/sampling/add', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 新增农户抽样 | |||||
export function addInvestigate(data) { | |||||
return request({ | |||||
url: '/service/sampling/addInvestigate', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 修改农户抽样 | |||||
export function updateInvestigate(data) { | |||||
return request({ | |||||
url: '/service/sampling/editInvestigate', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
//查询列表 | |||||
export function listSamplingDept(data){ | |||||
return request({ | |||||
url:'service/sampling/listSamplingDept', | |||||
method:'get', | |||||
params:data | |||||
}) | |||||
} | |||||
// 修改农户抽样 | |||||
export function uploadFile(data) { | |||||
return request({ | |||||
url: '/service/sampling/ocr/idcard', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 修改农户抽样 | |||||
export function uploadFileBase(data) { | |||||
return request({ | |||||
url: '/common/upload', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} |
@@ -0,0 +1,153 @@ | |||||
import request from '@/utils/request' | |||||
// 获取区下拉 | |||||
export function bigDataHcAreaInfo(query) { | |||||
return request({ | |||||
url: '/bigData/hc/hcAreaInfo', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
// 获取乡镇下拉 | |||||
export function bigDataHcCountyInfo(query) { | |||||
return request({ | |||||
url: '/bigData/hc/hcCountyInfo', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
//获取村级下拉 | |||||
export function bigDataHcVillageInfo(query) { | |||||
return request({ | |||||
url: '/bigData/hc/hcVillageInfo', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
//右侧详情农房农地列表 | |||||
export function hcBottomSearch(query) { | |||||
return request({ | |||||
url: '/bigData/hc/hcBottomSearch', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
//上传附件图片 | |||||
export function commonUpload(query) { | |||||
return request({ | |||||
url: '/common/upload', | |||||
method: 'post', | |||||
data: query | |||||
}) | |||||
} | |||||
//农房新增 | |||||
export function houseAdd(query) { | |||||
return request({ | |||||
url: '/geo/house/add', | |||||
method: 'post', | |||||
data: query | |||||
}) | |||||
} | |||||
//农房编辑 | |||||
export function houseEdit(query) { | |||||
return request({ | |||||
url: '/geo/house/edit', | |||||
method: 'post', | |||||
data: query | |||||
}) | |||||
} | |||||
//农地新增 | |||||
export function landAdd(query) { | |||||
return request({ | |||||
url: '/geo/land/add', | |||||
method: 'post', | |||||
data: query | |||||
}) | |||||
} | |||||
//农地编辑 | |||||
export function landEdit(query) { | |||||
return request({ | |||||
url: '/geo/land/edit', | |||||
method: 'post', | |||||
data: query | |||||
}) | |||||
} | |||||
//获取区、镇、村地区 | |||||
export function treeselectByUser(query) { | |||||
return request({ | |||||
url: '/system/dept/treeselectByUser', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
//获取村的经纬度 | |||||
export function deptGetId(id) { | |||||
return request({ | |||||
url: '/system/dept/get/' + id, | |||||
method: 'get', | |||||
}) | |||||
} | |||||
//查询农地地信息 | |||||
export function getLand(id) { | |||||
return request({ | |||||
url: '/geo/land/get/' + id, | |||||
method: 'get', | |||||
}) | |||||
} | |||||
//查询农房信息 | |||||
export function getHouse(id) { | |||||
return request({ | |||||
url: '/geo/house/get/' + id, | |||||
method: 'get', | |||||
}) | |||||
} | |||||
//获取接口地图地址 | |||||
export function currentLocation(query) { | |||||
return request({ | |||||
url: '/bigData/common/currentLocation', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
//修改坐标数据同步 | |||||
export function coordinatesUpdateGeo(data) { | |||||
return request({ | |||||
url: '/geo/geo/coordinatesEdit', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
//删除农房信息 | |||||
export function houseRemove(id) { | |||||
return request({ | |||||
url: '/geo/house/remove/' + id, | |||||
method: 'get', | |||||
}) | |||||
} | |||||
//删除农地信息 | |||||
export function landRemove(id) { | |||||
return request({ | |||||
url: '/geo/land/remove/' + id, | |||||
method: 'get', | |||||
}) | |||||
} |
@@ -11,7 +11,10 @@ export function login(username, password, code, uuid) { | |||||
return request({ | return request({ | ||||
url: '/login', | url: '/login', | ||||
method: 'post', | method: 'post', | ||||
data: data | |||||
data: data, | |||||
headers: { | |||||
isToken: false | |||||
} | |||||
}) | }) | ||||
} | } | ||||
@@ -25,7 +28,10 @@ export function smsLogin(mobile, smsCode, uuid) { | |||||
return request({ | return request({ | ||||
url: '/sms/login', | url: '/sms/login', | ||||
method: 'post', | method: 'post', | ||||
data: data | |||||
data: data, | |||||
headers: { | |||||
isToken: false | |||||
} | |||||
}) | }) | ||||
} | } | ||||
@@ -49,7 +55,10 @@ export function logout() { | |||||
export function getCodeImg() { | export function getCodeImg() { | ||||
return request({ | return request({ | ||||
url: '/captchaImage', | url: '/captchaImage', | ||||
method: 'get' | |||||
method: 'get', | |||||
headers: { | |||||
isToken: false | |||||
} | |||||
}) | }) | ||||
} | } | ||||
@@ -63,7 +72,7 @@ export function getSmsCode(mobile) { | |||||
return request({ | return request({ | ||||
url: '/sms/code', | url: '/sms/code', | ||||
method: 'post', | method: 'post', | ||||
data:data | |||||
data: data | |||||
}) | }) | ||||
} | } | ||||
@@ -22,11 +22,15 @@ const whiteList = [ | |||||
'/register/userRegister', | '/register/userRegister', | ||||
'/register/companyRegister', | '/register/companyRegister', | ||||
'/biddingHall', | '/biddingHall', | ||||
'/authenticRight', | |||||
'/authenticRight/login', | |||||
'/project', | '/project', | ||||
'/policy', | '/policy', | ||||
'/policyDetail', | '/policyDetail', | ||||
'/attestationDetail', | '/attestationDetail', | ||||
'/noticeDetail', | '/noticeDetail', | ||||
'/homestead/login', | |||||
] | ] | ||||
@@ -53,7 +57,13 @@ router.beforeEach((to, from, next) => { | |||||
}).catch(err => { | }).catch(err => { | ||||
store.dispatch('LogOut').then(() => { | store.dispatch('LogOut').then(() => { | ||||
// Message.error(err) | // Message.error(err) | ||||
next({ path: '/' }) | |||||
if ('/authenticRight/index'.indexOf(to.path) !== -1) { | |||||
next({ path: '/authenticRight/login' }) | |||||
} else if ('/homestead/index'.indexOf(to.path) !== -1) { | |||||
next({ path: '/homestead/login' }) | |||||
} else { | |||||
next({ path: '/' }) | |||||
} | |||||
}) | }) | ||||
}) | }) | ||||
} else { | } else { | ||||
@@ -66,8 +76,16 @@ router.beforeEach((to, from, next) => { | |||||
// 在免登录白名单,直接进入 | // 在免登录白名单,直接进入 | ||||
next() | next() | ||||
} else { | } else { | ||||
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 | |||||
//next('/index'); | |||||
if ('/authenticRight/index'.indexOf(to.path) !== -1) { | |||||
next(`/authenticRight/login?redirect=${to.fullPath}`) | |||||
} else if ('/homestead/index'.indexOf(to.path) !== -1) { | |||||
next(`/homestead/login?redirect=${to.fullPath}`) | |||||
} else { | |||||
next(`/login?redirect=${to.fullPath}`) | |||||
} | |||||
// // 否则全部重定向到登录页 | |||||
//next('/index'); | |||||
NProgress.done() | NProgress.done() | ||||
} | } | ||||
} | } | ||||
@@ -76,6 +76,14 @@ export const constantRoutes = [ | |||||
title: '我的' | title: '我的' | ||||
}, | }, | ||||
component: (resolve) => require(['@/views/mynsgk'], resolve) | component: (resolve) => require(['@/views/mynsgk'], resolve) | ||||
} , | |||||
{ | |||||
path: '/authenticRight', | |||||
name: 'authenticRight', | |||||
meta: { | |||||
title: '确权颁证调查统计表', | |||||
}, | |||||
component: (resolve) => require(['@/views/authenticRight/index'], resolve) | |||||
}, | }, | ||||
{ | { | ||||
path: '/biddingHall', | path: '/biddingHall', | ||||
@@ -354,10 +362,28 @@ export const constantRoutes = [ | |||||
hidden: true, | hidden: true, | ||||
}, | }, | ||||
component: (resolve) => require(['@/views/homestead/login'], resolve) | component: (resolve) => require(['@/views/homestead/login'], resolve) | ||||
}, | |||||
//两清三化宅基地 | |||||
{ | |||||
path: '/authenticRight/index', | |||||
name: 'authenticRightIndex', | |||||
meta: { | |||||
title: '两清三化宅基地', | |||||
hidden: true, | |||||
}, | |||||
component: (resolve) => require(['@/views/authenticRight/index'], resolve) | |||||
}, | |||||
{ | |||||
path: '/authenticRight/login', | |||||
name: 'authenticRightLogin', | |||||
meta: { | |||||
title: '登录页', | |||||
hidden: true, | |||||
}, | |||||
component: (resolve) => require(['@/views/authenticRight/login'], resolve) | |||||
} | } | ||||
]; | ]; | ||||
@@ -70,7 +70,13 @@ service.interceptors.response.use(res => { | |||||
}) | }) | ||||
.then(() => { | .then(() => { | ||||
store.dispatch('LogOut').then(() => { | store.dispatch('LogOut').then(() => { | ||||
location.href = '/index'; | |||||
if ('/authenticRight/index'.indexOf(to.path) !== -1) { | |||||
location.href = '/authenticRight/login'; | |||||
} else if ('/homestead/index'.indexOf(to.path) !== -1) { | |||||
location.href = '/homestead/login'; | |||||
} else { | |||||
location.href = '/index'; | |||||
} | |||||
}) | }) | ||||
}) | }) | ||||
} else if (code === 500) { | } else if (code === 500) { | ||||
@@ -0,0 +1,236 @@ | |||||
<template> | |||||
<div class="app-container" :style="{ height: windowHeight + 'px' }"> | |||||
<div class="login_header"></div> | |||||
<div class="login_content"> | |||||
<div class="homestead_wrap"> | |||||
<div class="key_title">确权颁证调查统计系统</div> | |||||
<div class="slogan"></div> | |||||
</div> | |||||
<div class="from_wrap"> | |||||
<div class="from_content"> | |||||
<div class="signIn_container"> | |||||
<div class="signIn_input_wrap"> | |||||
<van-field | |||||
autosize | |||||
v-model="formData.username" | |||||
placeholder="请输入用户名" | |||||
/> | |||||
</div> | |||||
</div> | |||||
<div class="signIn_container"> | |||||
<div class="signIn_input_wrap"> | |||||
<van-field | |||||
autosize | |||||
type="password" | |||||
placeholder="请输入密码" | |||||
v-model="formData.password" | |||||
/> | |||||
</div> | |||||
</div> | |||||
<div class="signIn_container"> | |||||
<div class="signIn_input_wrap"> | |||||
<div class="verification_code"> | |||||
<van-field | |||||
autosize | |||||
placeholder="请输入验证码" | |||||
v-model="formData.code" | |||||
/> | |||||
</div> | |||||
<div class="verification_images"> | |||||
<img class="code-img" :src="codeUrl" @click="getCode" /> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="signIn_container"> | |||||
<div class="remember_num"> | |||||
<van-checkbox | |||||
v-model="rememberPassword" | |||||
icon-size="16px" | |||||
checked-color="#3CBF5B" | |||||
>记住密码</van-checkbox | |||||
> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="from_btn" @click="handleLogin">登录</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { getCodeImg } from "@/api/login"; | |||||
import Cookies from "js-cookie"; | |||||
export default { | |||||
name: "homesteadLogin", | |||||
data() { | |||||
return { | |||||
formData: { | |||||
username: "", //账号 | |||||
password: "", //密码 | |||||
code: null, //图片验证码 | |||||
uuid: null, //识别uuid | |||||
}, | |||||
codeUrl: "", //图片验证码 | |||||
windowHeight: 0, | |||||
rememberPassword: false, //记住密码 1记住 2不记住 | |||||
}; | |||||
}, | |||||
created() { | |||||
this.getCode(); | |||||
let userName = Cookies.get("homesteadUserName"); // => 'value' | |||||
let password = Cookies.get("homesteadPassword"); // => undefined | |||||
if (userName != undefined) { | |||||
this.formData.username = userName; | |||||
this.rememberPassword = true; | |||||
} | |||||
if (password != undefined) { | |||||
this.formData.password = password; | |||||
} | |||||
}, | |||||
mounted() { | |||||
let windowHeight = document.documentElement.clientHeight; | |||||
this.windowHeight = windowHeight; | |||||
}, | |||||
methods: { | |||||
getCode() { | |||||
getCodeImg().then((res) => { | |||||
this.formData.uuid = res.uuid; | |||||
this.codeUrl = "data:image/gif;base64," + res.img; | |||||
}); | |||||
}, | |||||
handleLogin() { | |||||
//账号密码登录 | |||||
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(() => { | |||||
if (this.rememberPassword == true) { | |||||
Cookies.set("homesteadUserName", this.formData.username, { | |||||
expires: 30, | |||||
}); | |||||
Cookies.set("homesteadPassword", this.formData.password, { | |||||
expires: 30, | |||||
}); | |||||
} | |||||
this.$router | |||||
.push({ path: this.redirect || "/authenticRight/index" }) | |||||
.catch(() => {}); | |||||
}) | |||||
.catch(() => { | |||||
this.loading = false; | |||||
this.getCode(); | |||||
}); | |||||
}, | |||||
}, | |||||
}; | |||||
</script> | |||||
<style scoped lang="scss"> | |||||
.app-container { | |||||
display: flex; | |||||
width: 100vw; | |||||
height: 100vh; | |||||
flex-direction: column; | |||||
.login_header { | |||||
flex: 0.35; | |||||
background: url("../../assets/images/homestead/login_bg.jpg") center bottom | |||||
no-repeat; | |||||
background-size: 100% 100%; | |||||
} | |||||
.login_content { | |||||
flex: 0.65; | |||||
display: flex; | |||||
flex-direction: column; | |||||
.homestead_wrap { | |||||
flex: 0.28; | |||||
display: flex; | |||||
justify-content: center; /* 相对父元素水平居中 */ | |||||
align-items: center; /* 子元素相对父元素垂直居中 */ | |||||
flex-direction: column; | |||||
.key_title { | |||||
font-size: 56px; | |||||
margin-bottom: 10px; | |||||
} | |||||
.slogan { | |||||
font-size: 32px; | |||||
color: #9f9f9f; | |||||
} | |||||
} | |||||
.from_wrap { | |||||
flex: 0.72; | |||||
padding-bottom: 14%; | |||||
flex-direction: column; | |||||
display: flex; | |||||
margin: 0 40px; | |||||
.from_content { | |||||
flex: 1; | |||||
display: flex; | |||||
flex-direction: column; | |||||
padding-bottom: 14%; | |||||
.signIn_container { | |||||
flex: 1; | |||||
display: flex; | |||||
max-height: 90px; | |||||
margin-bottom: 24px; | |||||
&:last-child { | |||||
margin-bottom: 0; | |||||
} | |||||
.signIn_input_wrap { | |||||
flex: 1; | |||||
display: flex; | |||||
.verification_code { | |||||
flex: 1; | |||||
} | |||||
.verification_images { | |||||
flex: 0 0 220px; | |||||
margin-left: 20px; | |||||
img { | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
} | |||||
.van-cell { | |||||
border: 2px solid #f1f0f5; | |||||
border-radius: 46px; | |||||
font-size: 32px; | |||||
} | |||||
} | |||||
.remember_num { | |||||
margin-left: 14px; | |||||
font-size: 28px; | |||||
color: #3cbf5b; | |||||
} | |||||
} | |||||
} | |||||
.from_btn { | |||||
display: flex; | |||||
flex: 0 0 80px; | |||||
background: #3cbf5b; | |||||
border-radius: 40px; | |||||
font-size: 36px; | |||||
justify-content: center; /* 相对父元素水平居中 */ | |||||
align-items: center; /* 子元素相对父元素垂直居中 */ | |||||
color: #fff; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
</style> |
@@ -1,153 +1,236 @@ | |||||
<template> | |||||
<div class="app-container"> | |||||
<div class="login_header"></div> | |||||
<div class="login_content"> | |||||
<div class="homestead_wrap"> | |||||
<div class="key_title">两清三化宅基地</div> | |||||
<div class="slogan">随时随地管理宅基地</div> | |||||
</div> | |||||
<div class="from_wrap"> | |||||
<div class="from_content"> | |||||
<div class="signIn_container"> | |||||
<div class="signIn_input_wrap"> | |||||
<van-field | |||||
v-model="message" | |||||
autosize | |||||
placeholder="请输入手机号" | |||||
/> | |||||
</div> | |||||
</div> | |||||
<div class="signIn_container"> | |||||
<div class="signIn_input_wrap"> | |||||
<van-field v-model="message" autosize placeholder="请输入密码" /> | |||||
</div> | |||||
</div> | |||||
<div class="signIn_container"> | |||||
<div class="signIn_input_wrap"> | |||||
<div class="verification_code"> | |||||
<van-field | |||||
v-model="message" | |||||
autosize | |||||
placeholder="请输入验证码" | |||||
/> | |||||
</div> | |||||
<div class="verification_images"></div> | |||||
</div> | |||||
</div> | |||||
<div class="signIn_container"> | |||||
<div class="remember_num"> | |||||
<van-radio-group v-model="radio"> | |||||
<van-radio name="1" icon-size="16px" checked-color="#3CBF5B" | |||||
>记住密码</van-radio | |||||
> | |||||
</van-radio-group> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="from_btn">登录</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
name: "homesteadLogin", | |||||
data() { | |||||
return { | |||||
message: "", | |||||
radio: "2", | |||||
}; | |||||
}, | |||||
mounted() {}, | |||||
methods: {}, | |||||
}; | |||||
</script> | |||||
<style scoped lang="scss"> | |||||
.app-container { | |||||
display: flex; | |||||
width: 100vw; | |||||
height: 100vh; | |||||
flex-direction: column; | |||||
.login_header { | |||||
flex: 0.35; | |||||
background: url("../../assets/images/homestead/login_bg.jpg") center bottom | |||||
no-repeat; | |||||
background-size: 100% 100%; | |||||
} | |||||
.login_content { | |||||
flex: 0.65; | |||||
display: flex; | |||||
flex-direction: column; | |||||
.homestead_wrap { | |||||
flex: 0.28; | |||||
display: flex; | |||||
justify-content: center; /* 相对父元素水平居中 */ | |||||
align-items: center; /* 子元素相对父元素垂直居中 */ | |||||
flex-direction: column; | |||||
.key_title { | |||||
font-size: 56px; | |||||
margin-bottom: 10px; | |||||
} | |||||
.slogan { | |||||
font-size: 32px; | |||||
color: #9f9f9f; | |||||
} | |||||
} | |||||
.from_wrap { | |||||
flex: 0.72; | |||||
padding-bottom: 14%; | |||||
flex-direction: column; | |||||
display: flex; | |||||
margin: 0 40px; | |||||
.from_content { | |||||
flex: 1; | |||||
display: flex; | |||||
flex-direction: column; | |||||
padding-bottom: 14%; | |||||
.signIn_container { | |||||
flex: 1; | |||||
display: flex; | |||||
margin-bottom: 18px; | |||||
&:last-child { | |||||
margin-bottom: 0; | |||||
} | |||||
.signIn_input_wrap { | |||||
flex: 1; | |||||
display: flex; | |||||
.verification_code { | |||||
flex: 1; | |||||
} | |||||
.verification_images { | |||||
flex: 0 0 220px; | |||||
margin-left: 20px; | |||||
} | |||||
.van-cell { | |||||
border: 2px solid #f1f0f5; | |||||
border-radius: 46px; | |||||
font-size: 32px; | |||||
} | |||||
} | |||||
.remember_num { | |||||
margin-left: 14px; | |||||
font-size: 28px; | |||||
color: #3cbf5b; | |||||
} | |||||
} | |||||
} | |||||
.from_btn { | |||||
display: flex; | |||||
flex: 0 0 80px; | |||||
background: #3cbf5b; | |||||
border-radius: 40px; | |||||
font-size: 36px; | |||||
justify-content: center; /* 相对父元素水平居中 */ | |||||
align-items: center; /* 子元素相对父元素垂直居中 */ | |||||
color: #fff; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
</style> | |||||
<template> | |||||
<div class="app-container" :style="{ height: windowHeight + 'px' }"> | |||||
<div class="login_header"></div> | |||||
<div class="login_content"> | |||||
<div class="homestead_wrap"> | |||||
<div class="key_title">环翠区两清三化</div> | |||||
<div class="slogan">数据调查系统</div> | |||||
</div> | |||||
<div class="from_wrap"> | |||||
<div class="from_content"> | |||||
<div class="signIn_container"> | |||||
<div class="signIn_input_wrap"> | |||||
<van-field | |||||
autosize | |||||
v-model="formData.username" | |||||
placeholder="请输入用户名" | |||||
/> | |||||
</div> | |||||
</div> | |||||
<div class="signIn_container"> | |||||
<div class="signIn_input_wrap"> | |||||
<van-field | |||||
autosize | |||||
type="password" | |||||
placeholder="请输入密码" | |||||
v-model="formData.password" | |||||
/> | |||||
</div> | |||||
</div> | |||||
<div class="signIn_container"> | |||||
<div class="signIn_input_wrap"> | |||||
<div class="verification_code"> | |||||
<van-field | |||||
autosize | |||||
placeholder="请输入验证码" | |||||
v-model="formData.code" | |||||
/> | |||||
</div> | |||||
<div class="verification_images"> | |||||
<img class="code-img" :src="codeUrl" @click="getCode" /> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="signIn_container"> | |||||
<div class="remember_num"> | |||||
<van-checkbox | |||||
v-model="rememberPassword" | |||||
icon-size="16px" | |||||
checked-color="#3CBF5B" | |||||
>记住密码</van-checkbox | |||||
> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="from_btn" @click="handleLogin">登录</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { getCodeImg } from "@/api/login"; | |||||
import Cookies from "js-cookie"; | |||||
export default { | |||||
name: "homesteadLogin", | |||||
data() { | |||||
return { | |||||
formData: { | |||||
username: "", //账号 | |||||
password: "", //密码 | |||||
code: null, //图片验证码 | |||||
uuid: null, //识别uuid | |||||
}, | |||||
codeUrl: "", //图片验证码 | |||||
rememberPassword: false, //记住密码 1记住 2不记住 | |||||
windowHeight: 0, | |||||
}; | |||||
}, | |||||
created() { | |||||
this.getCode(); | |||||
let userName = Cookies.get("homesteadUserName"); // => 'value' | |||||
let password = Cookies.get("homesteadPassword"); // => undefined | |||||
if (userName != undefined) { | |||||
this.formData.username = userName; | |||||
this.rememberPassword = true; | |||||
} | |||||
if (password != undefined) { | |||||
this.formData.password = password; | |||||
} | |||||
}, | |||||
mounted() { | |||||
let windowHeight = document.documentElement.clientHeight; | |||||
this.windowHeight = windowHeight; | |||||
}, | |||||
methods: { | |||||
getCode() { | |||||
getCodeImg().then((res) => { | |||||
this.formData.uuid = res.uuid; | |||||
this.codeUrl = "data:image/gif;base64," + res.img; | |||||
}); | |||||
}, | |||||
handleLogin() { | |||||
//账号密码登录 | |||||
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(() => { | |||||
if (this.rememberPassword == true) { | |||||
Cookies.set("homesteadUserName", this.formData.username, { | |||||
expires: 30, | |||||
}); | |||||
Cookies.set("homesteadPassword", this.formData.password, { | |||||
expires: 30, | |||||
}); | |||||
} | |||||
this.$router | |||||
.push({ path: this.redirect || "/homestead/index" }) | |||||
.catch(() => {}); | |||||
}) | |||||
.catch(() => { | |||||
this.loading = false; | |||||
this.getCode(); | |||||
}); | |||||
}, | |||||
}, | |||||
}; | |||||
</script> | |||||
<style scoped lang="scss"> | |||||
.app-container { | |||||
display: flex; | |||||
width: 100vw; | |||||
height: 100vh; | |||||
flex-direction: column; | |||||
.login_header { | |||||
flex: 0.35; | |||||
background: url("../../assets/images/homestead/login_bg.jpg") center bottom | |||||
no-repeat; | |||||
background-size: 100% 100%; | |||||
} | |||||
.login_content { | |||||
flex: 0.65; | |||||
display: flex; | |||||
flex-direction: column; | |||||
.homestead_wrap { | |||||
flex: 0.28; | |||||
display: flex; | |||||
justify-content: center; /* 相对父元素水平居中 */ | |||||
align-items: center; /* 子元素相对父元素垂直居中 */ | |||||
flex-direction: column; | |||||
.key_title { | |||||
font-size: 56px; | |||||
margin-bottom: 10px; | |||||
} | |||||
.slogan { | |||||
font-size: 32px; | |||||
color: #9f9f9f; | |||||
} | |||||
} | |||||
.from_wrap { | |||||
flex: 0.72; | |||||
padding-bottom: 14%; | |||||
flex-direction: column; | |||||
display: flex; | |||||
margin: 0 40px; | |||||
.from_content { | |||||
flex: 1; | |||||
display: flex; | |||||
flex-direction: column; | |||||
padding-bottom: 14%; | |||||
.signIn_container { | |||||
flex: 1; | |||||
display: flex; | |||||
max-height: 90px; | |||||
margin-bottom: 24px; | |||||
&:last-child { | |||||
margin-bottom: 0; | |||||
} | |||||
.signIn_input_wrap { | |||||
flex: 1; | |||||
display: flex; | |||||
.verification_code { | |||||
flex: 1; | |||||
} | |||||
.verification_images { | |||||
flex: 0 0 220px; | |||||
margin-left: 20px; | |||||
img { | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
} | |||||
.van-cell { | |||||
border: 2px solid #f1f0f5; | |||||
border-radius: 46px; | |||||
font-size: 32px; | |||||
} | |||||
} | |||||
.remember_num { | |||||
margin-left: 14px; | |||||
font-size: 28px; | |||||
color: #3cbf5b; | |||||
} | |||||
} | |||||
} | |||||
.from_btn { | |||||
display: flex; | |||||
flex: 0 0 80px; | |||||
background: #3cbf5b; | |||||
border-radius: 40px; | |||||
font-size: 36px; | |||||
justify-content: center; /* 相对父元素水平居中 */ | |||||
align-items: center; /* 子元素相对父元素垂直居中 */ | |||||
color: #fff; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
</style> |
@@ -38,6 +38,10 @@ | |||||
<van-image src="../../static/images/icon/icon_need.png" width="40" height="40" /> | <van-image src="../../static/images/icon/icon_need.png" width="40" height="40" /> | ||||
<p>个人供求</p> | <p>个人供求</p> | ||||
</van-grid-item> | </van-grid-item> | ||||
<van-grid-item to="/authenticRight"> | |||||
<van-image src="../../static/images/icon/icon_need.png" width="40" height="40" /> | |||||
<p>确权调查</p> | |||||
</van-grid-item> | |||||
</van-grid> | </van-grid> | ||||
</div> | </div> | ||||
<p class="newTit">新闻咨询</p> | <p class="newTit">新闻咨询</p> | ||||
@@ -0,0 +1,18 @@ | |||||
@echo off | |||||
D: | |||||
cd D:\workspace\code\nsgk_mobile | |||||
::安装依赖 | |||||
:: npm install | |||||
::强烈建议不要用直接使用 cnpm 安装,会有各种诡异的 bug,可以通过重新指定 registry 来解决 npm 安装速度慢的问题。 | |||||
:: npm install --registry=https://registry.npm.taobao.org | |||||
::本地开发 启动项目 | |||||
npm run dev | |||||
@echo SUCCESS | |||||
pause |
@@ -0,0 +1,18 @@ | |||||
@echo off | |||||
D: | |||||
cd D:\workspace\code\nsgk_mobile | |||||
::安装依赖 | |||||
npm install | |||||
::强烈建议不要用直接使用 cnpm 安装,会有各种诡异的 bug,可以通过重新指定 registry 来解决 npm 安装速度慢的问题。 | |||||
npm install --registry=https://registry.npm.taobao.org | |||||
::本地开发 启动项目 | |||||
:: npm run dev | |||||
@echo SUCCESS | |||||
pause |
@@ -0,0 +1,14 @@ | |||||
@echo off | |||||
D: | |||||
cd D:\workspace\code\nsgk_mobile | |||||
:: 打包预发布环境 | |||||
npm run build | |||||
@echo SUCCESS | |||||
pause |