fix 代码生成部门id处理,自动刷新token处理
This commit is contained in:
parent
f15377546e
commit
b071104e17
@ -25,4 +25,9 @@ export function resetPwdPersonal(data:object) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function refreshToken() {
|
||||
return request({
|
||||
url: '/api/v1/system/personal/refreshToken',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
import {getToken} from "/@/utils/gfast"
|
||||
import {getToken, getUpFileUrl} from "/@/utils/gfast"
|
||||
import {noticeStore} from "/@/stores/noticeStore";
|
||||
import {refreshToken} from "/@/api/system/personal";
|
||||
import {Session} from "/@/utils/storage";
|
||||
import {useUserInfo} from "/@/stores/userInfo";
|
||||
const noticeStoreAct = noticeStore()
|
||||
const webSocketURL = import.meta.env.VITE_WEBSOCKET_URL
|
||||
let socket: WebSocket;
|
||||
@ -139,6 +142,19 @@ export default (onMessage: Function) => {
|
||||
noticeStoreAct.setMessages(message.data)
|
||||
return;
|
||||
}
|
||||
//更新token
|
||||
if(message.event == 'tokenUpdated'){
|
||||
refreshToken().then((res:any)=>{
|
||||
const userInfo = res.data.userInfo
|
||||
userInfo.avatar = getUpFileUrl(userInfo.avatar)
|
||||
// 存储 token 到浏览器缓存
|
||||
Session.set('token', res.data.token);
|
||||
// 存储用户信息到浏览器缓存
|
||||
Session.set('userInfo', userInfo);
|
||||
useUserInfo().setUserInfos();
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (onMessage && !isHeart) {
|
||||
onMessage.call(null, event);
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
<template #header>
|
||||
<el-radio-group v-model="optionsActionValue" @change="setOptionsActionValueHandle">
|
||||
<template v-for="item in dataScopeOptions" :key="item.value">
|
||||
<el-radio v-if="item.value!='2'" :label="item.value" >{{item.label}}</el-radio>
|
||||
<el-radio v-if="item.value!='2'" :value="item.value" >{{item.label}}</el-radio>
|
||||
</template>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
@ -41,7 +41,7 @@
|
||||
<div class="option-con">
|
||||
<el-radio-group v-model="menuAuthData[scope.row.id]">
|
||||
<template v-for="item in dataScopeOptions" :key="item.value">
|
||||
<el-radio :label="item.value" @change="setOptionsItemHandle(item.value,scope.row.id)">
|
||||
<el-radio :value="item.value" @change="setOptionsItemHandle(item.value,scope.row.id)">
|
||||
<el-badge v-if="item.value=='2' && menuAuthData[scope.row.id]=='2'" type="success" :value="getDeptLen(scope.row.id)" :max="99" class="item" :show-zero="false">{{item.label}}</el-badge>
|
||||
<span v-else>{{item.label}}</span>
|
||||
</el-radio>
|
||||
|
@ -59,6 +59,7 @@
|
||||
:disabled="
|
||||
scope.row.isPk == '1' ||
|
||||
scope.row.columnName == 'created_at' ||
|
||||
scope.row.columnName == 'dept_id' ||
|
||||
scope.row.columnName == 'created_by' ||
|
||||
scope.row.columnName == 'updated_by'
|
||||
"
|
||||
@ -164,7 +165,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="详情起新行" width="50">
|
||||
<template #default="scope">
|
||||
<el-checkbox true-label="1" v-model="scope.row.isRowStart"></el-checkbox>
|
||||
<el-checkbox true-value="1" v-model="scope.row.isRowStart"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字典类型" width="160">
|
||||
|
Loading…
x
Reference in New Issue
Block a user