Browse Source

cookie和用户信息储存在session中

360view
bianyaqi 2 years ago
parent
commit
d898ae79ba
  1. 5
      src/components/360View/afterPart/index-copy.vue
  2. 5
      src/components/360View/afterPart/index.vue
  3. 4
      src/components/360View/collection.vue
  4. 2
      src/components/360View/commonForm/eyesVision.vue
  5. 2
      src/components/360View/commonForm/optometryForm-copy.vue
  6. 2
      src/components/360View/commonForm/optometryForm.vue
  7. 2
      src/components/360View/commonForm/threeVision.vue
  8. 5
      src/components/360View/forePart/index-copy.vue
  9. 5
      src/components/360View/forePart/index.vue
  10. 5
      src/components/360View/medicalRecord/outPatientRecord/afterForm.vue
  11. 5
      src/components/360View/medicalRecord/outPatientRecord/foreForm.vue
  12. 2
      src/components/360View/special/index.vue
  13. 2
      src/components/bread-crumb/index.vue
  14. 2
      src/components/patient-search/index.vue
  15. 6
      src/page-subspecialty/router/index.js
  16. 11
      src/page-subspecialty/store/index.js
  17. 9
      src/page-subspecialty/utils/request.js
  18. 2
      src/page-subspecialty/views/modules/formList/InformedConsent.vue
  19. 2
      src/page-subspecialty/views/modules/formList/laserSurgery.vue
  20. 2
      src/page-subspecialty/views/modules/formList/reportForm.vue
  21. 2
      src/page-subspecialty/views/modules/optometryManagement/cornea/patient-add-or-update.vue
  22. 2
      src/page-subspecialty/views/modules/optometryManagement/dioptric/patient-add-or-update.vue
  23. 2
      src/page-subspecialty/views/modules/optometryManagement/seeDoctor/historyRecord.vue
  24. 2
      src/page-subspecialty/views/modules/outpatientManagement/call/patient-add-or-update.vue
  25. 2
      src/page-subspecialty/views/modules/outpatientManagement/treat/patient-add-or-update.vue
  26. 2
      src/page-subspecialty/views/modules/systemManagement/team/edit-password.vue
  27. 2
      src/page-subspecialty/views/modules/systemManagement/team/index.vue
  28. 2
      src/page-subspecialty/views/modules/systemManagement/team/team-add-or-update.vue
  29. 12
      src/page-subspecialty/views/pages/login.vue
  30. 2
      static/js/sign.js

5
src/components/360View/afterPart/index-copy.vue

@ -359,7 +359,7 @@ export default {
created() { created() {
}, },
mounted() { mounted() {
this.userData = this.$store.state.currentUser
this.userData = JSON.parse(window.sessionStorage.getItem('qg-userData'))
this.doctorId = this.userData.id this.doctorId = this.userData.id
this.queryOptions() this.queryOptions()
this.getforeList() this.getforeList()
@ -611,8 +611,7 @@ export default {
queryTree(type) { queryTree(type) {
const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree' const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const employeeId = this.$store.state.currentUser.employeeId
axios.defaults.headers.common['token'] = Cookies.get('xa-token' + employeeId) || ''
axios.defaults.headers.common['token'] = window.sessionStorage.getItem('xa-token') || ''
axios.get(baseUrl, { axios.get(baseUrl, {
params: { params: {
doctorId: this.doctorId, doctorId: this.doctorId,

5
src/components/360View/afterPart/index.vue

@ -244,7 +244,7 @@ export default {
created() { created() {
}, },
mounted() { mounted() {
this.userData = this.$store.state.currentUser
this.userData = JSON.parse(window.sessionStorage.getItem('qg-userData'))
this.doctorId = this.userData.id this.doctorId = this.userData.id
this.getforeList().then(() => { this.getforeList().then(() => {
this.queryOptions() this.queryOptions()
@ -608,8 +608,7 @@ export default {
queryTree(type) { queryTree(type) {
const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree' const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const employeeId = this.$store.state.currentUser.employeeId
axios.defaults.headers.common['token'] = Cookies.get('xa-token' + employeeId) || ''
axios.defaults.headers.common['token'] = window.sessionStorage.getItem('xa-token') || ''
axios.get(baseUrl, { axios.get(baseUrl, {
params: { params: {
doctorId: this.doctorId, doctorId: this.doctorId,

4
src/components/360View/collection.vue

@ -88,7 +88,7 @@ export default {
id: '', id: '',
parentId: 0 parentId: 0
}, },
doctorId: this.$store.state.currentUser.id,
doctorId: JSON.parse(window.sessionStorage.getItem('qg-userData')).idid,
collectData: [], collectData: [],
tableData: [], tableData: [],
defaultProps: { defaultProps: {
@ -179,7 +179,7 @@ export default {
async findTree() { async findTree() {
const { data } = await this.$http.get(`/tree/findTree`, { const { data } = await this.$http.get(`/tree/findTree`, {
params: { params: {
doctorId: this.$store.state.currentUser.id,
doctorId: JSON.parse(window.sessionStorage.getItem('qg-userData')).idid,
platform: this.platform platform: this.platform
} }
}) })

2
src/components/360View/commonForm/eyesVision.vue

@ -832,7 +832,7 @@ export default {
methods: { methods: {
// //
setSign() { setSign() {
const userData = this.$store.state.currentUser
const userData = window.sessionStorage.getItem('qg-userData')
const date = this.$moment().format('YYYY-MM-DD') const date = this.$moment().format('YYYY-MM-DD')
const mzName = window.localStorage.getItem('mzDoctorName') const mzName = window.localStorage.getItem('mzDoctorName')
this.formData.ygsSign = userData.signImgBase this.formData.ygsSign = userData.signImgBase

2
src/components/360View/commonForm/optometryForm-copy.vue

@ -578,7 +578,7 @@ export default {
methods: { methods: {
// //
setSign() { setSign() {
const userData = this.$store.state.currentUser
const userData = window.sessionStorage.getItem('qg-userData')
const date = this.$moment().format('YYYY-MM-DD') const date = this.$moment().format('YYYY-MM-DD')
const mzName = window.localStorage.getItem('mzDoctorName') const mzName = window.localStorage.getItem('mzDoctorName')
this.dataForm.tongk = '正常瞳孔' this.dataForm.tongk = '正常瞳孔'

2
src/components/360View/commonForm/optometryForm.vue

@ -546,7 +546,7 @@ export default {
}, },
methods: { methods: {
setSign() { setSign() {
const userData = this.$store.state.currentUser
const userData = window.sessionStorage.getItem('qg-userData')
const date = this.$moment().format('YYYY-MM-DD') const date = this.$moment().format('YYYY-MM-DD')
const mzName = window.localStorage.getItem('mzDoctorName') const mzName = window.localStorage.getItem('mzDoctorName')
this.dataForm.optometrist = userData.signImgBase this.dataForm.optometrist = userData.signImgBase

2
src/components/360View/commonForm/threeVision.vue

@ -1243,7 +1243,7 @@ export default {
} }
}, },
setSign() { setSign() {
const userData = this.$store.state.currentUser
const userData = window.sessionStorage.getItem('qg-userData')
const date = this.$moment().format('YYYY-MM-DD') const date = this.$moment().format('YYYY-MM-DD')
this.dataForm.sgsSign = userData.signImgBase this.dataForm.sgsSign = userData.signImgBase
this.dataForm.riQi = date this.dataForm.riQi = date

5
src/components/360View/forePart/index-copy.vue

@ -753,7 +753,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.userData = this.$store.state.currentUser
this.userData = JSON.parse(window.sessionStorage.getItem('qg-userData'))
this.doctorId = this.userData.id this.doctorId = this.userData.id
this.queryOptions() this.queryOptions()
this.getforeList() this.getforeList()
@ -1008,8 +1008,7 @@ export default {
queryTree(type) { queryTree(type) {
const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree' const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const employeeId = this.$store.state.currentUser.employeeId
axios.defaults.headers.common['token'] = Cookies.get('xa-token' + employeeId) || ''
axios.defaults.headers.common['token'] = window.sessionStorage.getItem('xa-token') || ''
axios.get(baseUrl, { axios.get(baseUrl, {
params: { params: {
doctorId: this.doctorId, doctorId: this.doctorId,

5
src/components/360View/forePart/index.vue

@ -409,7 +409,7 @@ export default {
created() { created() {
}, },
mounted() { mounted() {
this.userData = this.$store.state.currentUser
this.userData = JSON.parse(window.sessionStorage.getItem('qg-userData'))
this.doctorId = this.userData.id this.doctorId = this.userData.id
this.getforeList().then(() => { this.getforeList().then(() => {
this.queryOptions() this.queryOptions()
@ -811,8 +811,7 @@ export default {
queryTree(type) { queryTree(type) {
const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree' const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const employeeId = this.$store.state.currentUser.employeeId
axios.defaults.headers.common['token'] = Cookies.get('xa-token' + employeeId) || ''
axios.defaults.headers.common['token'] = window.sessionStorage.getItem('xa-token') || ''
axios.get(baseUrl, { axios.get(baseUrl, {
params: { params: {
doctorId: this.doctorId, doctorId: this.doctorId,

5
src/components/360View/medicalRecord/outPatientRecord/afterForm.vue

@ -198,7 +198,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.userData = this.$store.state.currentUser
this.userData = JSON.parse(window.sessionStorage.getItem('qg-userData'))
this.doctorId = this.userData.id this.doctorId = this.userData.id
this.queryOptions() this.queryOptions()
}, },
@ -207,8 +207,7 @@ export default {
queryTree(type) { queryTree(type) {
const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree' const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const employeeId = this.$store.state.currentUser.employeeId
axios.defaults.headers.common['token'] = Cookies.get('xa-token' + employeeId) || ''
axios.defaults.headers.common['token'] = window.sessionStorage.getItem('xa-token') || ''
axios.get(baseUrl, { axios.get(baseUrl, {
params: { params: {
doctorId: this.doctorId, doctorId: this.doctorId,

5
src/components/360View/medicalRecord/outPatientRecord/foreForm.vue

@ -557,7 +557,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.userData = this.$store.state.currentUser
this.userData = JSON.parse(window.sessionStorage.getItem('qg-userData'))
this.doctorId = this.userData.id this.doctorId = this.userData.id
this.queryOptions() this.queryOptions()
}, },
@ -569,8 +569,7 @@ export default {
queryTree(type) { queryTree(type) {
const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree' const baseUrl = window.SITE_CONFIG['apiURL'] + '/treetag/findTree'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const employeeId = this.$store.state.currentUser.employeeId
axios.defaults.headers.common['token'] = Cookies.get('xa-token' + employeeId) || ''
axios.defaults.headers.common['token'] = window.sessionStorage.getItem('xa-token') || ''
axios.get(baseUrl, { axios.get(baseUrl, {
params: { params: {
doctorId: this.doctorId, doctorId: this.doctorId,

2
src/components/360View/special/index.vue

@ -123,7 +123,7 @@ export default {
} }
}, },
mounted() { mounted() {
const user = this.$store.state.currentUser
const user = window.sessionStorage.getItem('qg-userData')
this.employeeId = user.employeeId this.employeeId = user.employeeId
this.getPatientData() this.getPatientData()
this.getSpecialItem() this.getSpecialItem()

2
src/components/bread-crumb/index.vue

@ -27,7 +27,7 @@ export default {
} }
}, },
created() { created() {
this.userData = this.$store.state.currentUser
this.userData = window.sessionStorage.getItem('qg-userData')
this.getBreadcrumb() this.getBreadcrumb()
}, },
methods: { methods: {

2
src/components/patient-search/index.vue

@ -105,7 +105,7 @@ export default {
return { return {
uploadUrl: window.SITE_CONFIG['apiURL'] + '/patient/data/searchByExcel', uploadUrl: window.SITE_CONFIG['apiURL'] + '/patient/data/searchByExcel',
headers: { headers: {
token: Cookies.get('xa-token' + this.$store.state.currentUser.employeeId)
token: window.sessionStorage.setItem('xa-token')
}, },
dataForm: {}, dataForm: {},
keyWord: '', keyWord: '',

6
src/page-subspecialty/router/index.js

@ -226,9 +226,9 @@ function loginByDocId(doctorId, next) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
console.log(res) console.log(res)
const employeeId = res.data.currentUser.employeeId
Cookies.set('xa-token' + employeeId, res.data.token)
window.localStorage.setItem('qg-userData' + employeeId, JSON.stringify(res.data.currentUser))
// Cookies.set('xa-token', res.data.token)
window.sessionStorage.setItem('xa-token', res.data.token)
window.sessionStorage.setItem('qg-userData', JSON.stringify(res.data.currentUser))
getNavList(next) getNavList(next)
muneList(next) muneList(next)

11
src/page-subspecialty/store/index.js

@ -28,8 +28,7 @@ export default new Vuex.Store({
title: 'home' title: 'home'
} }
], ],
defauleActiveIndex: '',
currentUser: null
defauleActiveIndex: ''
}, },
modules: { modules: {
user, user,
@ -49,14 +48,6 @@ export default new Vuex.Store({
activeIndexFun(state, id) { activeIndexFun(state, id) {
state.defauleActiveIndex = id state.defauleActiveIndex = id
window.sessionStorage.setItem('defauleActiveIndex', id) window.sessionStorage.setItem('defauleActiveIndex', id)
},
setCurUser(state, value) {
state.currentUser = value
}
},
actions: {
acSetUser(context, value) {
context.commit('setCurUser', value)
} }
} }
}) })

9
src/page-subspecialty/utils/request.js

@ -9,7 +9,7 @@ import store from '../store'
*/ */
export function clearLoginInfo() { export function clearLoginInfo() {
store.commit('resetStore') store.commit('resetStore')
Cookies.remove('xa-token' + store.state.currentUser.employeeId)
Cookies.remove('xa-token')
window.localStorage.clear() window.localStorage.clear()
window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = false window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = false
} }
@ -25,12 +25,7 @@ const http = axios.create({
*/ */
http.interceptors.request.use(config => { http.interceptors.request.use(config => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
const employeeId = store.state.currentUser && store.state.currentUser.employeeId
if (employeeId) {
config.headers['token'] = Cookies.get('xa-token' + employeeId) || ''
} else {
config.headers['token'] = Cookies.get('xa-token') || ''
}
config.headers['token'] = window.sessionStorage.getItem('xa-token') || ''
// 默认参数 // 默认参数
var defaults = {} var defaults = {}
// 防止缓存,GET请求默认带_t参数 // 防止缓存,GET请求默认带_t参数

2
src/page-subspecialty/views/modules/formList/InformedConsent.vue

@ -372,7 +372,7 @@ export default {
this.confirmData.patientName = this.patientDetail.patientName this.confirmData.patientName = this.patientDetail.patientName
this.confirmData.patientAge = this.patientDetail.patientAge this.confirmData.patientAge = this.patientDetail.patientAge
this.confirmData.patientGender = this.patientDetail.patientSex this.confirmData.patientGender = this.patientDetail.patientSex
const userData = this.$store.state.currentUser
const userData = window.sessionStorage.getItem('qg-userData')
this.confirmData.operationSign = userData.signImgBase this.confirmData.operationSign = userData.signImgBase
this.confirmData.operationDate = this.$moment().format('YYYY-MM-DD HH:mm:ss') this.confirmData.operationDate = this.$moment().format('YYYY-MM-DD HH:mm:ss')
this.confirmData.patientDate = this.$moment().format('YYYY-MM-DD HH:mm:ss') this.confirmData.patientDate = this.$moment().format('YYYY-MM-DD HH:mm:ss')

2
src/page-subspecialty/views/modules/formList/laserSurgery.vue

@ -298,7 +298,7 @@ export default {
this.confirmData.jgzlSyt = odOrOs.os this.confirmData.jgzlSyt = odOrOs.os
} }
} }
const userData = this.$store.state.currentUser
const userData = window.sessionStorage.getItem('qg-userData')
this.confirmData.operateSign = userData.signImgBase this.confirmData.operateSign = userData.signImgBase
}) })
}, },

2
src/page-subspecialty/views/modules/formList/reportForm.vue

@ -144,7 +144,7 @@ export default {
created() { created() {
this.origin = JSON.parse(JSON.stringify(this.formData)) this.origin = JSON.parse(JSON.stringify(this.formData))
this.confirmData.patientName = this.patientDetail.patientName this.confirmData.patientName = this.patientDetail.patientName
const userData = this.$store.state.currentUser
const userData = window.sessionStorage.getItem('qg-userData')
this.confirmData.operator = userData.signImgBase this.confirmData.operator = userData.signImgBase
this.getReportInfo() this.getReportInfo()
}, },

2
src/page-subspecialty/views/modules/optometryManagement/cornea/patient-add-or-update.vue

@ -213,7 +213,7 @@ export default {
} else { } else {
this.mzDoctorList = data.data.data this.mzDoctorList = data.data.data
} }
// this.dataForm.sgDoctorId = this.$store.state.currentUser.employeeId
// this.dataForm.sgDoctorId = JSON.parse(window.sessionStorage.getItem('qg-userData')).employeeId
}) })
}, },
// //

2
src/page-subspecialty/views/modules/optometryManagement/dioptric/patient-add-or-update.vue

@ -213,7 +213,7 @@ export default {
} else { } else {
this.mzDoctorList = data.data.data this.mzDoctorList = data.data.data
} }
this.dataForm.sgDoctorId = this.$store.state.currentUser.employeeId
this.dataForm.sgDoctorId = JSON.parse(window.sessionStorage.getItem('qg-userData')).employeeId
}) })
}, },
// //

2
src/page-subspecialty/views/modules/optometryManagement/seeDoctor/historyRecord.vue

@ -54,7 +54,7 @@ export default {
patientId: this.patientId patientId: this.patientId
}, },
headers: { headers: {
token: Cookies.get('xa-token' + this.$store.state.currentUser.employeeId)
token: window.sessionStorage.setItem('xa-token')
}, },
filePath: '', filePath: '',
recordList: [], recordList: [],

2
src/page-subspecialty/views/modules/outpatientManagement/call/patient-add-or-update.vue

@ -211,7 +211,7 @@ export default {
} else { } else {
this.mzDoctorList = data.data.data this.mzDoctorList = data.data.data
} }
this.dataForm.mzDoctorId = this.$store.state.currentUser.employeeId
this.dataForm.mzDoctorId = JSON.parse(window.sessionStorage.getItem('qg-userData')).employeeId
}) })
}, },
// //

2
src/page-subspecialty/views/modules/outpatientManagement/treat/patient-add-or-update.vue

@ -209,7 +209,7 @@ export default {
} else { } else {
this.mzDoctorList = data.data.data this.mzDoctorList = data.data.data
} }
this.dataForm.mzDoctorId = this.$store.state.currentUser.employeeId
this.dataForm.mzDoctorId = JSON.parse(window.sessionStorage.getItem('qg-userData')).employeeId
}) })
}, },
// //

2
src/page-subspecialty/views/modules/systemManagement/team/edit-password.vue

@ -66,7 +66,7 @@ export default {
methods: { methods: {
init() { init() {
this.visible = true this.visible = true
this.loginInfo = this.$store.state.currentUser
this.loginInfo = window.sessionStorage.getItem('qg-userData')
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.dataForm.resetFields() // this.$refs.dataForm.resetFields() //
}) })

2
src/page-subspecialty/views/modules/systemManagement/team/index.vue

@ -105,7 +105,7 @@ export default {
created() { created() {
// //
this.getRoleName() this.getRoleName()
this.qgUserData = this.$store.state.currentUser
this.qgUserData = window.sessionStorage.getItem('qg-userData')
}, },
methods: { methods: {
// //

2
src/page-subspecialty/views/modules/systemManagement/team/team-add-or-update.vue

@ -204,7 +204,7 @@ export default {
// //
// this.getCentreList() // this.getCentreList()
// this.getCentreJobList() // this.getCentreJobList()
this.loginInfo = this.$store.state.currentUser
this.loginInfo = window.sessionStorage.getItem('qg-userData')
this.$refs.dataForm.resetFields() // this.$refs.dataForm.resetFields() //
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo() this.getInfo()

12
src/page-subspecialty/views/pages/login.vue

@ -53,7 +53,6 @@ import Cookies from 'js-cookie'
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { messages } from '@/i18n' import { messages } from '@/i18n'
import { getUUID } from '@/utils' import { getUUID } from '@/utils'
import { mapActions, MapActions } from 'vuex'
export default { export default {
data() { data() {
return { return {
@ -86,7 +85,6 @@ export default {
// this.getCaptcha() // this.getCaptcha()
}, },
methods: { methods: {
...mapActions(['acSetUser']),
submitNext() { submitNext() {
this.$refs.passWord.focus() this.$refs.passWord.focus()
}, },
@ -107,13 +105,9 @@ export default {
this.getCaptcha() this.getCaptcha()
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
if (!res.data.currentUser) {
return
}
this.acSetUser(res.data.currentUser)
const employeeId = this.$store.state.currentUser.employeeId
Cookies.set('xa-token' + employeeId, res.data.token)
// window.localStorage.setItem('qg-userData', JSON.stringify(res.data.currentUser))
// Cookies.set('xa-token', res.data.token)
window.sessionStorage.setItem('xa-token', res.data.token)
window.sessionStorage.setItem('qg-userData', JSON.stringify(res.data.currentUser))
this.$router.push({ name: 'outpatientManagement-call' }) this.$router.push({ name: 'outpatientManagement-call' })
}).catch(() => { }) }).catch(() => { })
}) })

2
static/js/sign.js

@ -170,7 +170,7 @@ function initCRF() {
function setAutoImport() { function setAutoImport() {
console.log(123); console.log(123);
const nodeIdName = JSON.parse(window.sessionStorage.getItem('sign-nodeIdName')) const nodeIdName = JSON.parse(window.sessionStorage.getItem('sign-nodeIdName'))
const img_base64 = this.$store.state.currentUser.signImgBase
const img_base64 = JSON.parse(window.sessionStorage.getItem('qg-userData')).signImgBasesignImgBase
// 调取接口 // 调取接口
let img = `<img id="${nodeIdName.name}-img" class="shouqian-img" style="width:60px;margin: 0 auto;vertical-align: middle;" src="${img_base64}" ></img>` let img = `<img id="${nodeIdName.name}-img" class="shouqian-img" style="width:60px;margin: 0 auto;vertical-align: middle;" src="${img_base64}" ></img>`
// 动态插入img // 动态插入img

Loading…
Cancel
Save