后台管理
This commit is contained in:
@ -654,10 +654,10 @@ const toggleGroup = (type: string) => {
|
||||
|
||||
var backButShow: any = ref(false)
|
||||
//根据角色权限控制后台管理按钮显隐
|
||||
let option = JSON.parse(localStorage.getItem('frontFunctionArr'))
|
||||
let option = JSON.parse(localStorage.getItem('frontFunctionArr') || '{}')
|
||||
option = Object.keys(option)
|
||||
//数据权限
|
||||
let data = JSON.parse(localStorage.getItem('frontDataArr'))
|
||||
let data = JSON.parse(localStorage.getItem('frontDataArr') || '[]')
|
||||
if (option.length == 0 && data.length == 0) {
|
||||
//管理员
|
||||
backButShow.value = true
|
||||
@ -677,6 +677,12 @@ const intoBack = async () => {
|
||||
const electron = require('electron')
|
||||
const { ipcRenderer } = require('electron')
|
||||
|
||||
const token = localStorage.getItem('Authorization')
|
||||
if (!token) {
|
||||
ElMessage({ message: '请先登录后再进入后台管理', type: 'error' })
|
||||
return
|
||||
}
|
||||
|
||||
let availablePort = await ipcRenderer.invoke('get-available-port')
|
||||
|
||||
let baseURL = localStorage.getItem('ip')
|
||||
@ -710,7 +716,7 @@ const intoBack = async () => {
|
||||
},
|
||||
// `http://localhost:${availablePort}/backManage/index.html#/login?timestamp=${Date.now()}`,
|
||||
`${baseURL}/index.html#/login?timestamp=${Date.now()}`,
|
||||
{},
|
||||
{ Authorization: token },
|
||||
id
|
||||
)
|
||||
} catch (error) {
|
||||
|
||||
@ -81,7 +81,7 @@ export const useLogin = () => {
|
||||
})
|
||||
localStorage.setItem('frontFunctionArr', JSON.stringify(obj))
|
||||
//数据权限
|
||||
let dataArr = []
|
||||
let dataArr: any[] = []
|
||||
res.data.roleOperates.forEach(item => {
|
||||
dataArr.push(item.operate)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user