Commit 12ab2c1a by lihu541

localStorage改成sessionStorage

parent 2af700b3
...@@ -35,7 +35,7 @@ export function commonMethod(param) { ...@@ -35,7 +35,7 @@ export function commonMethod(param) {
headers:{ headers:{
'Content-Type':'application/json; charset=UTF-8', 'Content-Type':'application/json; charset=UTF-8',
"Accept": "*/*", "Accept": "*/*",
"MyToken":localStorage.getItem('token') "MyToken":sessionStorage.getItem('token')
}, },
data:JSON.stringify(param) data:JSON.stringify(param)
}) })
...@@ -49,7 +49,7 @@ export function otherMethod(param) { ...@@ -49,7 +49,7 @@ export function otherMethod(param) {
headers:{ headers:{
'Content-Type':'application/json; charset=UTF-8', 'Content-Type':'application/json; charset=UTF-8',
"Accept": "*/*", "Accept": "*/*",
"MyToken":localStorage.getItem('token') "MyToken":sessionStorage.getItem('token')
}, },
data:JSON.stringify(param) data:JSON.stringify(param)
}) })
......
...@@ -1102,8 +1102,8 @@ ...@@ -1102,8 +1102,8 @@
this.isShow = false this.isShow = false
this.OptionsPlace = [{ this.OptionsPlace = [{
'value': localStorage.getItem("organizcode"), 'value': sessionStorage.getItem("organizcode"),
'label': localStorage.getItem("organizcodeName"), 'label': sessionStorage.getItem("organizcodeName"),
'level': 'sq' 'level': 'sq'
}] }]
this.selectOrg = this.OptionsPlace[0] this.selectOrg = this.OptionsPlace[0]
...@@ -1182,28 +1182,28 @@ ...@@ -1182,28 +1182,28 @@
changeScreenTwo(data) { changeScreenTwo(data) {
// 获取子组件传递来的数据 用以操作home页组件 // 获取子组件传递来的数据 用以操作home页组件
this.screenTagshow = data this.screenTagshow = data
localStorage.setItem("ScreenPage", this.screenTagshow) sessionStorage.setItem("ScreenPage", this.screenTagshow)
}, },
toSideTwo(){ toSideTwo(){
this.$refs.mySwiper.swiper.slideTo(1, 10, true) this.$refs.mySwiper.swiper.slideTo(1, 10, true)
} }
}, },
mounted() { mounted() {
this._ywsj = localStorage.getItem("ywsj") this._ywsj = sessionStorage.getItem("ywsj")
this.userRole = localStorage.getItem("userRole") this.userRole = sessionStorage.getItem("userRole")
if ('city' === this.userRole) {//市角色 if ('city' === this.userRole) {//市角色
this.PlaceCode = "" this.PlaceCode = ""
this._group = "XZQH" this._group = "XZQH"
this.pageLevel = 'sj' this.pageLevel = 'sj'
} else if ('area' === this.userRole) {//区角色 } else if ('area' === this.userRole) {//区角色
this.PlaceCode = localStorage.getItem("organizcode") this.PlaceCode = sessionStorage.getItem("organizcode")
this._yljgdm = '' this._yljgdm = ''
this._group = "YLJGDM" this._group = "YLJGDM"
this.pageLevel = 'qj' this.pageLevel = 'qj'
} else if ('hospital' === this.userRole) {//社区角色 } else if ('hospital' === this.userRole) {//社区角色
this.PlaceCode = localStorage.getItem("porgcode") this.PlaceCode = sessionStorage.getItem("porgcode")
this._yljgdm = localStorage.getItem("organizcode") this._yljgdm = sessionStorage.getItem("organizcode")
this._group = "YWSJ" this._group = "YWSJ"
this.pageLevel = 'sq' this.pageLevel = 'sq'
} }
......
...@@ -47,20 +47,20 @@ ...@@ -47,20 +47,20 @@
login(this.loginID, this.loginPas).then( res=>{ login(this.loginID, this.loginPas).then( res=>{
console.log(res) console.log(res)
if(res.code==1){ if(res.code==1){
localStorage.setItem('token', res.data.token); sessionStorage.setItem('token', res.data.token);
localStorage.setItem('userinfo', JSON.stringify(res.data.userInfo)); sessionStorage.setItem('userinfo', JSON.stringify(res.data.userInfo));
localStorage.setItem('ywsj', res.data.userInfo.jzrq); sessionStorage.setItem('ywsj', res.data.userInfo.jzrq);
localStorage.setItem('porgcode', res.data.userInfo.porgcode); sessionStorage.setItem('porgcode', res.data.userInfo.porgcode);
localStorage.setItem('organizcode', res.data.userInfo.organizcode); sessionStorage.setItem('organizcode', res.data.userInfo.organizcode);
localStorage.setItem('organizcodeName', res.data.userInfo.jgjc); sessionStorage.setItem('organizcodeName', res.data.userInfo.jgjc);
if('hcms.shizhang' === res.data.userInfo.roles[0]){//市角色 if('hcms.shizhang' === res.data.userInfo.roles[0]){//市角色
localStorage.setItem('userRole', "city"); sessionStorage.setItem('userRole', "city");
}else if('hcms.App_Qu' === res.data.userInfo.roles[0]){//区角色 }else if('hcms.App_Qu' === res.data.userInfo.roles[0]){//区角色
localStorage.setItem('userRole', "area"); sessionStorage.setItem('userRole', "area");
}else if('hcms.APP_SQYZ' === res.data.userInfo.roles[0]){//社区角色 }else if('hcms.APP_SQYZ' === res.data.userInfo.roles[0]){//社区角色
localStorage.setItem('userRole', "hospital"); sessionStorage.setItem('userRole', "hospital");
} }
this.$router.push({path: './Index'}); this.$router.push({path: './Index'});
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
if(this.checked){ if(this.checked){
// local 存储 用户登录返回的所有数据(不包含密码) // local 存储 用户登录返回的所有数据(不包含密码)
// local 存储 用户密码 // local 存储 用户密码
localStorage.setItem('userID', this.loginID); sessionStorage.setItem('userID', this.loginID);
localStorage.setItem('userPas', this.loginPas); sessionStorage.setItem('userPas', this.loginPas);
localStorage.setItem('ifselect', true); sessionStorage.setItem('ifselect', true);
} }
// 登陆成功, 路由跳转 // 登陆成功, 路由跳转
this.$router.push({path: './Index'}); this.$router.push({path: './Index'});
...@@ -88,16 +88,16 @@ ...@@ -88,16 +88,16 @@
} }
}, },
mounted() { mounted() {
if(localStorage.getItem('userID') && localStorage.getItem('userPas')){ if(sessionStorage.getItem('userID') && sessionStorage.getItem('userPas')){
// 若 local 存在即自动跳转 // 若 local 存在即自动跳转
// 获取密码与账户 // 获取密码与账户
this.loginID = localStorage.getItem('userID') this.loginID = sessionStorage.getItem('userID')
this.loginPas = localStorage.getItem('userPas') this.loginPas = sessionStorage.getItem('userPas')
this.checked = localStorage.getItem('ifselect') this.checked = sessionStorage.getItem('ifselect')
console.log(localStorage.getItem('ifselect')); console.log(sessionStorage.getItem('ifselect'));
// let localUserID = JSON.parse(localStorage.getItem('UserMessage')).data.userInfo.userId // let localUserID = JSON.parse(sessionStorage.getItem('UserMessage')).data.userInfo.userId
// let localUserPas = localStorage.getItem('UserPass') // let localUserPas = sessionStorage.getItem('UserPass')
// login(localUserID, localUserPas).then( res=>{ // login(localUserID, localUserPas).then( res=>{
// console.log(res.msg); // console.log(res.msg);
// if(res.msg == "操作成功"){ // if(res.msg == "操作成功"){
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
console.log(value) console.log(value)
var myDate = new Date(); var myDate = new Date();
myDate.getYear(); myDate.getYear();
localStorage.setItem("EndTime",value) sessionStorage.setItem("EndTime",value)
if(value){ if(value){
this.nowdate = value this.nowdate = value
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
} }
}, },
mounted(){ mounted(){
this.value = localStorage.getItem("EndTime")?localStorage.getItem("EndTime"):this.value this.value = sessionStorage.getItem("EndTime")?sessionStorage.getItem("EndTime"):this.value
this.nowdate = localStorage.getItem("EndTime")?localStorage.getItem("EndTime"):this.nowdate this.nowdate = sessionStorage.getItem("EndTime")?sessionStorage.getItem("EndTime"):this.nowdate
} }
} }
</script> </script>
......
...@@ -1029,8 +1029,8 @@ ...@@ -1029,8 +1029,8 @@
this.commun = "社区" this.commun = "社区"
console.log("此处是第一次点击"); console.log("此处是第一次点击");
console.log("diann"); console.log("diann");
this.areaname = localStorage.getItem("organizcodeName") this.areaname = sessionStorage.getItem("organizcodeName")
this.PlaceCode = localStorage.getItem("organizcode") this.PlaceCode = sessionStorage.getItem("organizcode")
this.BackCLick = false this.BackCLick = false
this.BarType = 'YLJGDM' this.BarType = 'YLJGDM'
this.BeginCode = false this.BeginCode = false
...@@ -1050,15 +1050,15 @@ ...@@ -1050,15 +1050,15 @@
this.thname = '医院' this.thname = '医院'
} else if ('hospital' === this.userRole) {//社区角色 } else if ('hospital' === this.userRole) {//社区角色
this.PlaceCode = localStorage.getItem("porgcode") this.PlaceCode = sessionStorage.getItem("porgcode")
this._yljgdm = localStorage.getItem("organizcode") this._yljgdm = sessionStorage.getItem("organizcode")
this._group = "YWSJ" this._group = "YWSJ"
this.pageLevel = 'sq' this.pageLevel = 'sq'
console.log(111); console.log(111);
this.closeareaclick = false this.closeareaclick = false
// this.PlaceCode = yldm // this.PlaceCode = yldm
this.areaname = localStorage.getItem("organizcodeName") this.areaname = sessionStorage.getItem("organizcodeName")
this.BeginCode = false this.BeginCode = false
this.communhidden = false this.communhidden = false
this.BarType = 'YWSJ' this.BarType = 'YWSJ'
...@@ -1088,7 +1088,7 @@ ...@@ -1088,7 +1088,7 @@
}, },
dataSearch(value) { dataSearch(value) {
console.log(value) console.log(value)
localStorage.setItem("ywsj", value) sessionStorage.setItem("ywsj", value)
this.DieaChange(this.DieaNo) this.DieaChange(this.DieaNo)
this.homeinit() this.homeinit()
...@@ -2464,9 +2464,9 @@ ...@@ -2464,9 +2464,9 @@
} }
}, },
mounted() { mounted() {
this.cxsj = localStorage.getItem("ywsj") this.cxsj = sessionStorage.getItem("ywsj")
this.userinfo = JSON.parse(localStorage.getItem("userinfo")) this.userinfo = JSON.parse(sessionStorage.getItem("userinfo"))
this.userRole = localStorage.getItem("userRole") this.userRole = sessionStorage.getItem("userRole")
if ('city' === this.userRole) {//市角色 if ('city' === this.userRole) {//市角色
this.PlaceCode = "" this.PlaceCode = ""
...@@ -2485,8 +2485,8 @@ ...@@ -2485,8 +2485,8 @@
this.commun = "社区" this.commun = "社区"
console.log("此处是第一次点击"); console.log("此处是第一次点击");
console.log("diann"); console.log("diann");
this.areaname = localStorage.getItem("organizcodeName") this.areaname = sessionStorage.getItem("organizcodeName")
this.PlaceCode = localStorage.getItem("organizcode") this.PlaceCode = sessionStorage.getItem("organizcode")
this.BackCLick = false this.BackCLick = false
this.BarType = 'YLJGDM' this.BarType = 'YLJGDM'
this.BeginCode = false this.BeginCode = false
...@@ -2506,15 +2506,15 @@ ...@@ -2506,15 +2506,15 @@
this.thname = '医院' this.thname = '医院'
} else if ('hospital' === this.userRole) {//社区角色 } else if ('hospital' === this.userRole) {//社区角色
this.PlaceCode = localStorage.getItem("porgcode") this.PlaceCode = sessionStorage.getItem("porgcode")
this._yljgdm = localStorage.getItem("organizcode") this._yljgdm = sessionStorage.getItem("organizcode")
this._group = "YWSJ" this._group = "YWSJ"
this.pageLevel = 'sq' this.pageLevel = 'sq'
console.log(111); console.log(111);
this.closeareaclick = false this.closeareaclick = false
// this.PlaceCode = yldm // this.PlaceCode = yldm
this.areaname = localStorage.getItem("organizcodeName") this.areaname = sessionStorage.getItem("organizcodeName")
this.BeginCode = false this.BeginCode = false
this.communhidden = false this.communhidden = false
this.BarType = 'YWSJ' this.BarType = 'YWSJ'
...@@ -2527,7 +2527,7 @@ ...@@ -2527,7 +2527,7 @@
} }
localStorage.setItem("ScreenPage", 1) sessionStorage.setItem("ScreenPage", 1)
}, },
components: {} components: {}
} }
......
...@@ -958,7 +958,7 @@ ...@@ -958,7 +958,7 @@
} else if ('area' === this.userRole) {//区角色 } else if ('area' === this.userRole) {//区角色
// 点击区 -- 展示城镇信息 // 点击区 -- 展示城镇信息
this._xzqh = localStorage.getItem("organizcode") this._xzqh = sessionStorage.getItem("organizcode")
this._group = "YLJGDM" this._group = "YLJGDM"
this.pageLevel = 'qj' this.pageLevel = 'qj'
...@@ -967,20 +967,20 @@ ...@@ -967,20 +967,20 @@
this.thname = '医院' this.thname = '医院'
this.arname = '社区' this.arname = '社区'
this.areaname = localStorage.getItem("organizcodeName") this.areaname = sessionStorage.getItem("organizcodeName")
this.homeinit(this.themeId) this.homeinit(this.themeId)
this.change_age(1) this.change_age(1)
} else if ('hospital' === this.userRole) {//社区角色 } else if ('hospital' === this.userRole) {//社区角色
this._xzqh = localStorage.getItem("organizcode") this._xzqh = sessionStorage.getItem("organizcode")
this._group = "YWSJ" this._group = "YWSJ"
this.pageLevel = 'sq' this.pageLevel = 'sq'
this.tablename = "社区" this.tablename = "社区"
this.thname = "医院" this.thname = "医院"
this.arname = '社区' this.arname = '社区'
this.areaname = localStorage.getItem("organizcodeName") this.areaname = sessionStorage.getItem("organizcodeName")
this.homeinit(this.themeId) this.homeinit(this.themeId)
this.change_age(1) this.change_age(1)
...@@ -3243,9 +3243,9 @@ ...@@ -3243,9 +3243,9 @@
} }
}, },
mounted() { mounted() {
this.cxsj = localStorage.getItem("ywsj") this.cxsj = sessionStorage.getItem("ywsj")
this.userinfo = JSON.parse(localStorage.getItem("userinfo")) this.userinfo = JSON.parse(sessionStorage.getItem("userinfo"))
this.userRole = localStorage.getItem("userRole") this.userRole = sessionStorage.getItem("userRole")
if ('city' === this.userRole) {//市角色 if ('city' === this.userRole) {//市角色
this._xzqh = "" this._xzqh = ""
this._group = "XZQH" this._group = "XZQH"
...@@ -3255,7 +3255,7 @@ ...@@ -3255,7 +3255,7 @@
this.change_age(1) this.change_age(1)
} else if ('area' === this.userRole) {//区角色 } else if ('area' === this.userRole) {//区角色
this._xzqh = localStorage.getItem("organizcode") this._xzqh = sessionStorage.getItem("organizcode")
this._group = "YLJGDM" this._group = "YLJGDM"
this.pageLevel = 'qj' this.pageLevel = 'qj'
// 点击区 -- 展示城镇信息 // 点击区 -- 展示城镇信息
...@@ -3264,20 +3264,20 @@ ...@@ -3264,20 +3264,20 @@
this.thname = '医院' this.thname = '医院'
this.arname = '社区' this.arname = '社区'
this.areaname = localStorage.getItem("organizcodeName") this.areaname = sessionStorage.getItem("organizcodeName")
this.homeinit(this.themeId) this.homeinit(this.themeId)
this.change_age(1) this.change_age(1)
} else if ('hospital' === this.userRole) {//社区角色 } else if ('hospital' === this.userRole) {//社区角色
this._xzqh = localStorage.getItem("organizcode") this._xzqh = sessionStorage.getItem("organizcode")
this._group = "YWSJ" this._group = "YWSJ"
this.pageLevel = 'sq' this.pageLevel = 'sq'
this.tablename = "社区" this.tablename = "社区"
this.thname = "医院" this.thname = "医院"
this.arname = '社区' this.arname = '社区'
this.areaname = localStorage.getItem("organizcodeName") this.areaname = sessionStorage.getItem("organizcodeName")
this.homeinit(this.themeId) this.homeinit(this.themeId)
this.change_age(1) this.change_age(1)
......
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
value: '2019-09', value: '2019-09',
nowdate: '2019-09', nowdate: '2019-09',
startTime: '2019-01', startTime: '2019-01',
selectStarttime: localStorage.getItem("EndTime"), selectStarttime: sessionStorage.getItem("EndTime"),
sel: '筛选', sel: '筛选',
data_x: [], data_x: [],
option: { option: {
...@@ -662,7 +662,7 @@ ...@@ -662,7 +662,7 @@
dataSearch(value) { dataSearch(value) {
var myDate = new Date(); var myDate = new Date();
myDate.getYear(); myDate.getYear();
localStorage.setItem("EndTime", value) sessionStorage.setItem("EndTime", value)
this.startTime = value.slice(0, 4) + '-01' this.startTime = value.slice(0, 4) + '-01'
if (value) { if (value) {
......
...@@ -470,7 +470,7 @@ ...@@ -470,7 +470,7 @@
dataY06: [], dataY06: [],
dataY07: [], dataY07: [],
dataY08: [], dataY08: [],
selectStarttime: localStorage.getItem("EndTime"), selectStarttime: sessionStorage.getItem("EndTime"),
lastStatus: {}, lastStatus: {},
PlaceCode: '', PlaceCode: '',
option2: { option2: {
...@@ -648,7 +648,7 @@ ...@@ -648,7 +648,7 @@
console.log(value) console.log(value)
var myDate = new Date(); var myDate = new Date();
myDate.getYear(); myDate.getYear();
localStorage.setItem("EndTime", value) sessionStorage.setItem("EndTime", value)
this.startTime = value.slice(0, 4) + '-01' this.startTime = value.slice(0, 4) + '-01'
//console.log(this.startTime) //console.log(this.startTime)
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
DieaNo: 1, DieaNo: 1,
thname: '各区', thname: '各区',
startTime: '2019-01', startTime: '2019-01',
selectStarttime: localStorage.getItem("EndTime"), selectStarttime: sessionStorage.getItem("EndTime"),
djNo: 1, djNo: 1,
value2: '', value2: '',
pageNo: 5, pageNo: 5,
...@@ -940,7 +940,7 @@ ...@@ -940,7 +940,7 @@
dataSearch(value) { dataSearch(value) {
var myDate = new Date(); var myDate = new Date();
myDate.getYear(); myDate.getYear();
localStorage.setItem("EndTime", value) sessionStorage.setItem("EndTime", value)
this.startTime = value.slice(0, 4) + '-01' this.startTime = value.slice(0, 4) + '-01'
if (value) { if (value) {
......
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