Browse Source

0919

master
xuhuajiao 2 years ago
parent
commit
34cef867a8
  1. 40
      src/views/accessToLibrary/index.vue

40
src/views/accessToLibrary/index.vue

@ -66,26 +66,31 @@ export default {
getInitIntoNum() {
// this.otherDoorOther = window.location.href.split('?')[1]?.split('=')[1]
const currentURL = window.location.href
const query = currentURL.split('?')[1]
console.log(query)
console.log(query.indexOf('startTime'))
if (query.indexOf('startTime') !== -1 || query.indexOf('endTime') !== -1) {
const paramsUrl = query.split('&')
console.log(paramsUrl)
let startTimeIndex = -1
for (let i = 0; i < paramsUrl.length; i++) {
const [key] = paramsUrl[i].split('=')
if (key === 'startTime' || key === 'endTime') {
startTimeIndex = i
break
console.log(currentURL)
if (currentURL.indexOf('?') !== -1) {
const query = currentURL.split('?')[1]
console.log(query)
console.log(query.indexOf('startTime'))
if (query.indexOf('startTime') !== -1 || query.indexOf('endTime') !== -1) {
const paramsUrl = query.split('&')
console.log(paramsUrl)
let startTimeIndex = -1
for (let i = 0; i < paramsUrl.length; i++) {
const [key] = paramsUrl[i].split('=')
if (key === 'startTime' || key === 'endTime') {
startTimeIndex = i
break
}
}
// startTime
const filteredParams = startTimeIndex >= 0 ? paramsUrl.slice(0, startTimeIndex) : params
const newQueryString = filteredParams.join('&')
this.otherDoorOther = newQueryString.split('=')[1]
} else {
this.otherDoorOther = query.split('=')[1]
}
// startTime
const filteredParams = startTimeIndex >= 0 ? paramsUrl.slice(0, startTimeIndex) : params
const newQueryString = filteredParams.join('&')
this.otherDoorOther = newQueryString.split('=')[1]
} else {
this.otherDoorOther = query.split('=')[1]
this.otherDoorOther = null
}
const startTime = this.$route.query.startTime
@ -96,6 +101,7 @@ export default {
} else {
this.otherDoorOther = null
}
let params
if (!this.isSelfService) {
params = {

Loading…
Cancel
Save