Browse Source

【接口看板+store+job】解决链接有登录名称,token不刷新问题处理

faster_AG_grid
安虹睿 1 year ago
parent
commit
bb010f9ff0
  1. 6
      PC/InterFace.Dash/src/components/commonTabel-drawer/index.vue
  2. 12
      PC/InterFace.Dash/src/permission.js
  3. 6
      PC/UI.WinIn.FasterZ.Job/src/components/commonTabel-drawer/index.vue
  4. 12
      PC/UI.WinIn.FasterZ.Job/src/permission.js
  5. 6
      PC/UI.WinIn.FasterZ.Store/src/components/commonTabel-drawer/index.vue
  6. 12
      PC/UI.WinIn.FasterZ.Store/src/permission.js
  7. 6
      PC/UI.WinIn.FasterZ.Store/src/utils/baseData/urlOption.js

6
PC/InterFace.Dash/src/components/commonTabel-drawer/index.vue

@ -9,7 +9,7 @@
:modal="false" :modal="false"
size="100%" size="100%"
> >
<div class="drawer-heder"> <!-- <div class="drawer-heder">
<div class="heder-left"> <div class="heder-left">
<div class="header-text"> <div class="header-text">
<span>{{ propsData[title[0].prop] }}</span> <span>{{ propsData[title[0].prop] }}</span>
@ -40,7 +40,7 @@
</template> </template>
</curren-Button> </curren-Button>
</div> </div>
</div> </div> -->
<div class="drawer-main"> <div class="drawer-main">
<curren-tabs <curren-tabs
:tabsData="dropdownTabs" :tabsData="dropdownTabs"
@ -66,7 +66,7 @@
:currenButtonData="detailHeaderButton" :currenButtonData="detailHeaderButton"
:tableData="propsData.details" :tableData="propsData.details"
:tableColumns="tableColumns" :tableColumns="tableColumns"
:setUTableHeight="showDetailColumnsSet && showDetailFilters ? 300 : 260" :setUTableHeight="showDetailColumnsSet || showDetailFilters ? 220 : 180"
@rowDrop="rowDrop" @rowDrop="rowDrop"
:searchOverallCoverHeight="'calc(100vh - 345px)'" :searchOverallCoverHeight="'calc(100vh - 345px)'"
:rowSource="'detail_api'" :rowSource="'detail_api'"

12
PC/InterFace.Dash/src/permission.js

@ -84,6 +84,18 @@ const getErrHandle = (to, from, next) => {
const toNextHandle = async (to, from, next) => { const toNextHandle = async (to, from, next) => {
let isFresh = false let isFresh = false
// 如果有登录特殊配置,重新获取token
let isAutoLogin = JSON.parse(localStorage.getItem('isConfigLogin')) || to.query.loginName
if(isAutoLogin){
let _username = localStorage.getItem("isConfigLogin") && localStorage.getItem("isConfigLogin") != 'false' ? localStorage.getItem("configLoginName") : to.query.loginName
await store.dispatch('user/login', {
username:_username,
password:localStorage.getItem("configLoginPass")
}).catch(()=>{
getErrHandle(to, from, next)
})
}
// 获取表头转义 // 获取表头转义
if(!store.getters.columZHList){ if(!store.getters.columZHList){
await store.dispatch('definition/getColumZHList').catch(()=>{ await store.dispatch('definition/getColumZHList').catch(()=>{

6
PC/UI.WinIn.FasterZ.Job/src/components/commonTabel-drawer/index.vue

@ -9,7 +9,7 @@
:modal="false" :modal="false"
size="100%" size="100%"
> >
<div class="drawer-heder"> <!-- <div class="drawer-heder">
<div class="heder-left"> <div class="heder-left">
<div class="header-text"> <div class="header-text">
<span>{{ propsData[title[0].prop] }}</span> <span>{{ propsData[title[0].prop] }}</span>
@ -40,7 +40,7 @@
</template> </template>
</curren-Button> </curren-Button>
</div> </div>
</div> </div> -->
<div class="drawer-main"> <div class="drawer-main">
<curren-tabs <curren-tabs
:tabsData="dropdownTabs" :tabsData="dropdownTabs"
@ -66,7 +66,7 @@
:currenButtonData="detailHeaderButton" :currenButtonData="detailHeaderButton"
:tableData="propsData.details" :tableData="propsData.details"
:tableColumns="tableColumns" :tableColumns="tableColumns"
:setUTableHeight="showDetailColumnsSet && showDetailFilters ? 300 : 260" :setUTableHeight="showDetailColumnsSet || showDetailFilters ? 220 : 180"
@rowDrop="rowDrop" @rowDrop="rowDrop"
:searchOverallCoverHeight="'calc(100vh - 345px)'" :searchOverallCoverHeight="'calc(100vh - 345px)'"
:rowSource="'detail_api'" :rowSource="'detail_api'"

12
PC/UI.WinIn.FasterZ.Job/src/permission.js

@ -84,6 +84,18 @@ const getErrHandle = (to, from, next) => {
const toNextHandle = async (to, from, next) => { const toNextHandle = async (to, from, next) => {
let isFresh = false let isFresh = false
// 如果有登录特殊配置,重新获取token
let isAutoLogin = JSON.parse(localStorage.getItem('isConfigLogin')) || to.query.loginName
if(isAutoLogin){
let _username = localStorage.getItem("isConfigLogin") && localStorage.getItem("isConfigLogin") != 'false' ? localStorage.getItem("configLoginName") : to.query.loginName
await store.dispatch('user/login', {
username:_username,
password:localStorage.getItem("configLoginPass")
}).catch(()=>{
getErrHandle(to, from, next)
})
}
// 获取表头转义 // 获取表头转义
if(!store.getters.columZHList){ if(!store.getters.columZHList){
await store.dispatch('definition/getColumZHList').catch(()=>{ await store.dispatch('definition/getColumZHList').catch(()=>{

6
PC/UI.WinIn.FasterZ.Store/src/components/commonTabel-drawer/index.vue

@ -9,7 +9,7 @@
:modal="false" :modal="false"
size="100%" size="100%"
> >
<div class="drawer-heder"> <!-- <div class="drawer-heder">
<div class="heder-left"> <div class="heder-left">
<div class="header-text"> <div class="header-text">
<span>{{ propsData[title[0].prop] }}</span> <span>{{ propsData[title[0].prop] }}</span>
@ -40,7 +40,7 @@
</template> </template>
</curren-Button> </curren-Button>
</div> </div>
</div> </div> -->
<div class="drawer-main"> <div class="drawer-main">
<curren-tabs <curren-tabs
:tabsData="dropdownTabs" :tabsData="dropdownTabs"
@ -66,7 +66,7 @@
:currenButtonData="detailHeaderButton" :currenButtonData="detailHeaderButton"
:tableData="propsData.details" :tableData="propsData.details"
:tableColumns="tableColumns" :tableColumns="tableColumns"
:setUTableHeight="showDetailColumnsSet && showDetailFilters ? 300 : 260" :setUTableHeight="showDetailColumnsSet || showDetailFilters ? 220 : 180"
@rowDrop="rowDrop" @rowDrop="rowDrop"
:searchOverallCoverHeight="'calc(100vh - 345px)'" :searchOverallCoverHeight="'calc(100vh - 345px)'"
:rowSource="'detail_api'" :rowSource="'detail_api'"

12
PC/UI.WinIn.FasterZ.Store/src/permission.js

@ -84,6 +84,18 @@ const getErrHandle = (to, from, next) => {
const toNextHandle = async (to, from, next) => { const toNextHandle = async (to, from, next) => {
let isFresh = false let isFresh = false
// 如果有登录特殊配置,重新获取token
let isAutoLogin = JSON.parse(localStorage.getItem('isConfigLogin')) || to.query.loginName
if(isAutoLogin){
let _username = localStorage.getItem("isConfigLogin") && localStorage.getItem("isConfigLogin") != 'false' ? localStorage.getItem("configLoginName") : to.query.loginName
await store.dispatch('user/login', {
username:_username,
password:localStorage.getItem("configLoginPass")
}).catch(()=>{
getErrHandle(to, from, next)
})
}
// 获取表头转义 // 获取表头转义
if(!store.getters.columZHList){ if(!store.getters.columZHList){
await store.dispatch('definition/getColumZHList').catch(()=>{ await store.dispatch('definition/getColumZHList').catch(()=>{

6
PC/UI.WinIn.FasterZ.Store/src/utils/baseData/urlOption.js

@ -111,7 +111,7 @@ export const DeliverNote = {
} }
export const DeliverNoteDetail = { export const DeliverNoteDetail = {
baseURL:'DeliverNote/base',//主表-列表 baseURL:'DeliverNoteDetail/base',//主表-列表
detailURL:'app/deliver-note-detail',//主表-明细 + 明细-查看主表 detailURL:'app/deliver-note-detail',//主表-明细 + 明细-查看主表
} }
@ -123,7 +123,7 @@ export const DeliverPlan = {
} }
export const DeliverPlanDetail = { export const DeliverPlanDetail = {
baseURL:'DeliverPlan/base',//主表-列表 baseURL:'DeliverPlanDetail/base',//主表-列表
detailURL:'app/deliver-plan-detail',//主表-明细 + 明细-查看主表 detailURL:'app/deliver-plan-detail',//主表-明细 + 明细-查看主表
} }
@ -152,7 +152,7 @@ export const InspectAbnormalNote = {
} }
export const InspectAbnormalNoteDetail = { export const InspectAbnormalNoteDetail = {
baseURL:'InspectAbnormalNote/base',//主表-列表 baseURL:'InspectAbnormalNoteDetail/base',//主表-列表
detailURL:'app/inspect-abnormal-note-detail',//主表-明细 + 明细-查看主表 detailURL:'app/inspect-abnormal-note-detail',//主表-明细 + 明细-查看主表
} }

Loading…
Cancel
Save