Commit 3a1bc474 authored by qddidi's avatar qddidi

正式

parent c4e44c70
......@@ -18,6 +18,11 @@ export default function $axios(options) {
// request 拦截器
instance.interceptors.request.use(
config => {
if(localStorage.getItem("token")){
Cookies.set('token',localStorage.getItem("token"))
console.log(localStorage.getItem("token"))
}
let token = Cookies.get('token')
// 1. 请求开始的时候可以结合 vuex 开启全屏 loading 动画
// console.log(store.state.loading)
......@@ -25,8 +30,9 @@ export default function $axios(options) {
// 2. 带上token
if (token) {
config.headers.token = token
} else {
} else {
console.log("重定向到登录页面")
// 重定向到登录页面
router.push('/login')
}
......
......@@ -203,6 +203,11 @@ router.beforeEach((to, from, next) => {
// 登录界面登录成功之后,会把用户信息保存在会话
// 存在时间为会话生命周期,页面关闭即失效。
if(localStorage.getItem("token")){
Cookies.set('token',localStorage.getItem("token"))
}
let token = Cookies.get('token')
let userName = sessionStorage.getItem('user')
if (to.path === '/login') {
......
......@@ -5,10 +5,11 @@
*/
// 后台管理系统服务器地址
// export const baseUrl2 = 'http://xclc.rensheju.com'
// //export const baseUrl = 'http://xc.rensheju.com'
// export const baseUrl = 'http://172.16.10.33:9002'
export const baseUrl2 = 'http://xclc.rensheju.com'
//export const baseUrl = 'http://xc.rensheju.com'
export const baseUrl = 'http://172.16.10.33:9002'
export const baseUrl = 'http://xc.rensheju.com'
export default {
baseUrl,
......
......@@ -2,13 +2,14 @@
<div>
<el-cascader
:props="{ checkStrictly: true }"
:props="{ expandTrigger: 'hover' }"
clearable
placeholder="请选择镇村"
v-model="value"
:options="options"
size="mini"
@change="handleChange"></el-cascader>
@change="handleChange"
></el-cascader>
</div>
......
<template>
<div>
<div class="sele">
<Candode v-on:childByValue="childByValue"></Candode>
<el-input v-model="idcard" style="width:50%" size="mini" clearable placeholder="请输入身份证号"></el-input>
<el-button type="primary" size="mini" style="background:#148A9B;margin-left:10px" icon="el-icon-search" @click="serch">搜索</el-button>
<Candode v-on:childByValue="childByValue" style="width:30%"></Candode>
<el-input v-model="idcard" style="width:30%" size="mini" clearable placeholder="请输入身份证号"></el-input>
<div class="s" style="width:30%">
<el-select size="mini" @change="torz" clearable v-model="state" placeholder="所有状态">
<el-option
v-for="item3 in stateList"
:key="item3.value"
:label="item3.label"
:value="item3.value">
</el-option>
</el-select>
</div>
<el-button type="primary" size="mini" style="background:#148A9B;margin-left:10px" icon="el-icon-search" @click="serch">搜索</el-button>
</div>
<el-table
:data="tableData"
......@@ -33,20 +44,23 @@
</el-table>
<div style="width:100%;height:80px;overflow:scroll;margin-bottom:20px">
<el-pagination
class="pone"
:page-size='10'
layout="total, prev, pager, next, jumper"
layout="total, prev, pager, next"
:total="totals"
:current-page.sync="Page"
@current-change="current_change"
small
>
</el-pagination>
</div>
</div>
</template>
<style>
<style scoped>
.op{
display: flex;
align-items: center;
......@@ -76,11 +90,10 @@
.el-timeline{
padding-left: 20px
}
.add{
margin-left: 20px
}
.sele{
display: flex
display: flex;
margin-top: 10px
}
</style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment