Browse Source

登录优化

master
yxq 5 months ago
parent
commit
c214d82167
6 changed files with 49 additions and 10 deletions
  1. +6
    -1
      SafeCampus.WEB/components.d.ts
  2. +12
    -0
      monitorMobile/api/building/index.js
  3. +3
    -3
      monitorMobile/http/api.js
  4. +5
    -1
      monitorMobile/pages/work/passengerFlow/index.vue
  5. +8
    -4
      monitorMobile/pages/work/returnBed/index.vue
  6. +15
    -1
      monitorMobile/store/index.js

+ 6
- 1
SafeCampus.WEB/components.d.ts View File

@@ -27,6 +27,7 @@ declare module 'vue' {
ElCol: typeof import('element-plus/es')['ElCol']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -39,17 +40,20 @@ declare module 'vue' {
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElLink: typeof import('element-plus/es')['ElLink']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSlider: typeof import('element-plus/es')['ElSlider']
ElSpace: typeof import('element-plus/es')['ElSpace']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
@@ -58,6 +62,7 @@ declare module 'vue' {
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElText: typeof import('element-plus/es')['ElText']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ESign: typeof import('./src/components/ESign/index.vue')['default']


+ 12
- 0
monitorMobile/api/building/index.js View File

@@ -0,0 +1,12 @@
import http from '@/http/api.js'
const url = '/api/business/building'


// 获取不分页列表
export const list = (params) => {
return http.request({
url: url + '/getNoPageList',
method: 'get',
params
})
}

+ 3
- 3
monitorMobile/http/api.js View File

@@ -13,7 +13,7 @@ http.interceptors.request.use((config) => { // 可使用async await 做异步操
const jwt = decryptJWT(token);
const exp = getJWTDate(jwt.exp);
// token 已经过期
if (new Date() <= exp) {
if (new Date() >= exp) {
let refreshToken = store.state.refreshToken;
// 携带刷新 token
if (refreshToken) {
@@ -94,11 +94,11 @@ const checkAndStoreAuthentication = (res) => {
let refreshToken = res.header['x-access-token'];
// 判断是否是无效 token
if (token === "invalid_token") {
stroe.dispatch('clearToken')
store.dispatch('clearToken')
}
// 判断是否存在刷新 token,如果存在则存储在本地
else if (refreshToken && token && token !== "invalid_token") {
stroe.dispatch('setToken',{token,refreshToken})
store.dispatch('setToken',{token,refreshToken})
}
}
export default http;

+ 5
- 1
monitorMobile/pages/work/passengerFlow/index.vue View File

@@ -47,7 +47,7 @@
page: {
pageNum: 1,
pageSize: 10,
}
},
}
},
methods: {
@@ -82,6 +82,10 @@
onLoad() {
this.loadmore()
},
onPullDownRefresh(){
uni.stopPullDownRefresh()
this.refresh()
}
}
</script>



+ 8
- 4
monitorMobile/pages/work/returnBed/index.vue View File

@@ -50,10 +50,10 @@
loudong: 1,
qinshi: ''
},
page:{
size:8,
page:8,
}
page: {
pageNum: 1,
pageSize: 10,
},
}
},
methods: {
@@ -88,6 +88,10 @@
onLoad() {
this.loadmore()
},
onPullDownRefresh(){
uni.stopPullDownRefresh()
this.refresh()
}
}
</script>



+ 15
- 1
monitorMobile/store/index.js View File

@@ -7,6 +7,9 @@ import {
import {
list as monitorList
} from '@/api/monitor/index.js'
import {
list as buildingList
} from '@/api/building/index.js'

let lifeData = {};

@@ -69,7 +72,7 @@ const store = new Vuex.Store({
value: payload.token
})
context.commit('$uStore', {
name: 'token',
name: 'refreshToken',
value: payload.refreshToken || ''
})
},
@@ -96,6 +99,17 @@ const store = new Vuex.Store({
return e
})
})
// 楼栋列表
await buildingList({
pageSize: 1000
}).then(res => {
if (res.code != 200) return
allOptions.monitorList = res.data.list.map(e => {
e.value = e.sensorId
e.label = e.sensorName
return e
})
})
context.commit('$uStore', {
name: 'allOptions',
value: allOptions


Loading…
Cancel
Save