From a7110c99655c026ff379a26b21ac709fd4ff8bfd Mon Sep 17 00:00:00 2001 From: Administrator <123456> Date: Thu, 23 Sep 2021 10:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=B1=E6=80=9D=E7=A6=B9=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=EF=BC=9A=E6=8F=90=E4=BA=A4=E4=BD=93=E8=B4=A8=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/global-llibs/axios-config.js | 2 +- src/views/physicalHealth/login/Login.vue | 188 +++++++++++++++++- .../physicalHealth/login/interfaceConfig.js | 23 +++ src/views/physicalHealth/main.js | 41 ++-- .../physicalHealth/mainPage/MainPage.vue | 3 +- .../mainPage/MainPageContent.vue | 66 +++--- src/views/physicalHealth/router.js | 6 + src/views/physicalHealth/store.js | 3 +- 8 files changed, 268 insertions(+), 64 deletions(-) create mode 100644 src/views/physicalHealth/login/interfaceConfig.js diff --git a/src/global-llibs/axios-config.js b/src/global-llibs/axios-config.js index ef6404e..fc4bcc7 100644 --- a/src/global-llibs/axios-config.js +++ b/src/global-llibs/axios-config.js @@ -63,7 +63,7 @@ export default { content:result.code === 5000?"请联系管理员":result.msg, centered:true }) - success = false; + success = result.code !== 5000; break; } } diff --git a/src/views/physicalHealth/login/Login.vue b/src/views/physicalHealth/login/Login.vue index 505e2e2..1efe061 100644 --- a/src/views/physicalHealth/login/Login.vue +++ b/src/views/physicalHealth/login/Login.vue @@ -1,12 +1,147 @@ @@ -14,17 +149,56 @@ .login-div-style{ width: 100%; height: 100%; - background-image: url("../assets/loginBg.png"); - background-size: cover; - background-repeat: no-repeat; + /*background-image: url("../assets/loginBg.png");*/ + /*background-size: cover;*/ + /*background-repeat: no-repeat;*/ position: relative; + padding-top: 100px; .title-style{ - position: absolute; - color:#36FEFE; + /*position: absolute;*/ + /*color:#36FEFE;*/ font-size: 25px; font-weight: bold; - width: 220px; + /*width: 220px;*/ text-align: center; + margin-bottom: 100px; + } + .div-style{ + width: 500px; + padding: 32px 20px 0 20px; + border: 1px solid #e5e5e5; + border-radius: 5px; + margin: auto; + .span-style{ + float: left; + width: 100px; + height: 32px; + font-size: 16px; + text-align: right; + letter-spacing: 5px; + line-height: 32px; + } + .input-style{ + float: left; + width: 330px; + height: 32px; + margin-left: 20px; + } + .tips-style{ + float: left; + width: 330px; + margin-left: 120px; + height: 32px; + text-align: right; + line-height: 32px; + color:red; + font-size: 14px; + } + .btn-style{ + float: left; + width: 330px; + margin-left: 120px; + } } } diff --git a/src/views/physicalHealth/login/interfaceConfig.js b/src/views/physicalHealth/login/interfaceConfig.js new file mode 100644 index 0000000..825130c --- /dev/null +++ b/src/views/physicalHealth/login/interfaceConfig.js @@ -0,0 +1,23 @@ +const InterfaceConfig = { + /* + * 【1.4.1】用户名密码登录接口 + * login_name 必填 string 登录名称base64后传输 + * login_pwd 必填 string 登录密码base64后传输 + * */ + loginByLoginNameAndPassword:{ + url:'intellioa/sys/login/loginByLoginNameAndPassword', + method:'post', + isTestLogin:false + }, + /* + * 【1.4.2】根据person_id、identity_id获取用户上下文信息 + * person_id 必填 string 登录名称base64后传输 + * identity_id 必填 string 登录密码base64后传输 + * */ + getPersonInfo:{ + url:'intellioa/sys/base/getPersonInfo', + method:'get', + isTestLogin:true + } +}; +export default InterfaceConfig; diff --git a/src/views/physicalHealth/main.js b/src/views/physicalHealth/main.js index 8e55b6c..e9432e6 100644 --- a/src/views/physicalHealth/main.js +++ b/src/views/physicalHealth/main.js @@ -25,24 +25,35 @@ Vue.use(VueBus); Vue.component('vueScroll', vuescroll) Vue.component('MyIcon', MyIcon) Vue.config.productionTip = false -Cookie.set('person_id','22933'); -Cookie.set('person_name',Base64.encode('费利明')) -Cookie.set('org_id','400195'); -Cookie.set('org_name',Base64.encode('研发测试学校')); -Cookie.set('role','city'); -Cookie.set('district_id','315005'); -Cookie.set('district_name',Base64.encode('南关区教育局')); +// Cookie.set('person_id','22933'); +// Cookie.set('person_name',Base64.encode('费利明')) +// Cookie.set('org_id','28'); +// Cookie.set('org_name',Base64.encode('研发测试学校')); +// Cookie.set('role','school'); +// Cookie.set('district_id','315005'); +// Cookie.set('district_name',Base64.encode('南关区教育局')); router.beforeEach((to,from,next)=>{ let person_id = Cookie.get('person_id') - if (person_id && person_id !== ''){//登录过 + let token = Cookie.get('token'); + if (person_id && person_id !== '' && token && token !== ''){//登录过 if (!store.state.person_id || store.state.person_id === ''){ - store.commit('setSingleParam',{key:'person_id',value:person_id}); - store.commit('setSingleParam',{key:'person_name',value:Base64.decode(Cookie.get('person_name'))}); - store.commit('setSingleParam',{key:'org_id',value:Cookie.get('org_id')}); - store.commit('setSingleParam',{key:'org_name',value:Base64.decode(Cookie.get('org_name'))}); - store.commit('setSingleParam',{key:'role',value:Cookie.get('role')}); - store.commit('setSingleParam',{key:'district_id',value:Cookie.get('district_id')}); - store.commit('setSingleParam',{key:'district_name',value:Base64.decode(Cookie.get('district_name'))}); + let storeData = { + person_id:person_id, + org_id:Cookie.get('org_id'), + token:token, + role:Cookie.get('role'), + district_id:Cookie.get('district_id'), + identity_id:Cookie.get('identity_id'), + } + let person_name = Cookie.get('person_name'); + let org_name = Cookie.get('org_name'); + let district_name = Cookie.get('district_name'); + + storeData.person_name = person_name && person_name !== ''?Base64.decode(person_name):''; + storeData.org_name = org_name && org_name !== ''?Base64.decode(org_name):''; + storeData.district_name = district_name && district_name !== ''?Base64.decode(district_name):''; + store.commit('setParams',storeData); + resetRoutes(store); } diff --git a/src/views/physicalHealth/mainPage/MainPage.vue b/src/views/physicalHealth/mainPage/MainPage.vue index 01a2c15..2acce75 100644 --- a/src/views/physicalHealth/mainPage/MainPage.vue +++ b/src/views/physicalHealth/mainPage/MainPage.vue @@ -52,7 +52,8 @@ -
+
返回
diff --git a/src/views/physicalHealth/mainPage/MainPageContent.vue b/src/views/physicalHealth/mainPage/MainPageContent.vue index 2d8c438..c8b1a73 100644 --- a/src/views/physicalHealth/mainPage/MainPageContent.vue +++ b/src/views/physicalHealth/mainPage/MainPageContent.vue @@ -245,20 +245,16 @@ {value: 1048, name: '已上报学校'}, {value: 735, name: '未上报学校'}, ], - itemStyle: { - emphasis: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - }, - normal:{ - label:{ - show: true, - formatter: '{b} : \n\n{d}%', - }, - labelLine :{show:true} - } + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' }, + label:{ + show: true, + formatter: '{b} : \n\n{d}%', + }, + labelLine :{show:true} } ] }, @@ -325,20 +321,16 @@ {value: 1048, name: '男'}, {value: 735, name: '女'}, ], - itemStyle: { - emphasis: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - }, - normal:{ - label:{ - show: true, - formatter: '{b} : {d}%' - }, - labelLine :{show:true} - } + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + }, + label:{ + show: true, + formatter: '{b} : {d}%' }, + labelLine :{show:true} } ] } @@ -395,20 +387,16 @@ {value: 1048, name: '乡村数量'}, {value: 735, name: '城市数量'}, ], - itemStyle: { - emphasis: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - }, - normal:{ - label:{ - show: true, - formatter: '{b} : \n\n{d}%', - }, - labelLine :{show:true} - } + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + }, + label:{ + show: true, + formatter: '{b} : \n\n{d}%', }, + labelLine :{show:true} } ] }, diff --git a/src/views/physicalHealth/router.js b/src/views/physicalHealth/router.js index 3249c3c..be696f3 100644 --- a/src/views/physicalHealth/router.js +++ b/src/views/physicalHealth/router.js @@ -4,6 +4,12 @@ import {menuConfig} from './menuConfig'; import _ from 'lodash'; Vue.use(VueRouter) +//以下几行解决控制台报错NavigationDuplicated: Avoided redundant navigation to current location +const originalPush = VueRouter.prototype.push +VueRouter.prototype.push = function push(location, onResolve, onReject) { + if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) + return originalPush.call(this, location).catch(err => err) +} const createRouter = ()=> new VueRouter({ mode:'hash', diff --git a/src/views/physicalHealth/store.js b/src/views/physicalHealth/store.js index 6bac15c..b195cf5 100644 --- a/src/views/physicalHealth/store.js +++ b/src/views/physicalHealth/store.js @@ -14,12 +14,13 @@ const store = new Vuex.Store({ org_name:'', org_id:'', role:'',//school 学校 city 市教育局 county县域教育局 + token:'', menu:[], breadCrumb:[] }, mutations:{ setParams(state,params){ - Object(state).keys().forEach((item)=>{ + Object.keys(state).forEach((item)=>{ state[item] = params[item]; }) },