Commit 08f85003 by 李伟康

commit

1 parent cf65ca36
......@@ -167,14 +167,6 @@ export default {
this.setLocalStorage('dj_scrm_userInfo', data)
console.log(data)
this.init()
ssoApi.getPermission().then(response => {
if (response.code == 0) {
let { children } = response.data[0].products[0].merchantProTreeResponses[0]
if (children) this.setLocalStorage('dj_scrm_permissionList', children)
} else {
Notify(response.message)
}
})
} else {
Notify(message)
}
......@@ -182,7 +174,7 @@ export default {
}
},
click(e) {
let { status, taskId, id , taskType} = e
let { status, taskId, id, taskType } = e
if (status == 2) return
wwbenchApi.updateTasks({ id }).then(res => {
if (taskType == 3 || taskType == 4) {
......
......@@ -98,18 +98,7 @@ const actions = {
util.removeLocalStorage('dj_scrm_redirect_uri')
// 只有一个账号 history.back()
if (redirect_uri) window.location.href = decodeURIComponent(`${redirect_uri}?sessionId=${userInfo.sessionId}&corpId=${corpId}`)
else {
ssoApi.getPermission().then(response => {
if (response.code == 0) {
console.log(response)
let { children } = response.data[0].products[0].merchantProTreeResponses[0]
if (children) util.setLocalStorage('dj_scrm_permissionList', children)
window.location.replace(`${url}${route}`)
} else {
Notify(response.message)
}
})
}
else window.location.replace(`${url}${route}`)
}
} else {
/**没有账号 */
......@@ -168,8 +157,8 @@ const login = ({ dispatch, to }) => {
let loginToken = util.getLocalStorage('dj_scrm_loginToken')
let userInfo = util.getLocalStorage('dj_scrm_userInfo')
let sessionId = util.getSessionId()
dispatch('registerHttp', sessionId || '')
if (!userInfo || !sessionId) {
dispatch('registerHttp', sessionId || '')
if (loginToken) {
state.showWindow = true
if (to && to.name != 'common.accountList') router.replace({ name: 'common.accountList' })
......
......@@ -71,17 +71,7 @@ export default {
this.showLoading('登录成功', () => {
this.hideLoading()
if (redirect_uri) window.location.href = decodeURIComponent(`${redirect_uri}?sessionId=${data.sessionId}&corpId=${corpId}`)
else {
ssoApi.getPermission().then(response => {
if (response.code == 0) {
let { children } = response.data[0].products[0].merchantProTreeResponses[0]
if (children) this.setLocalStorage('dj_scrm_permissionList', children)
this.$router.replace({ name: lastPath || 'home' })
} else {
Notify(response.message)
}
})
}
else this.$router.replace({ name: lastPath || 'home' })
})
}
} else {
......
<template>
<div class="layout">
<template v-for="item in list">
<template v-if="item.children && item.children.length">
<div :key="item.id">
<template v-if="item.label != '工作台'">
<div class="title">{{item.label}}</div>
</template>
<div class="box">
<template v-for="i in item.children">
<div
:key="i.id"
class="item"
@click="jump(i)"
>
<div :class="['sprite-icon',`icon-${i.icon}`]"></div>
{{i.label}}
<template v-if="flag">
<template v-if="list.length">
<template v-for="item in list">
<template v-if="item.children && item.children.length">
<div :key="item.id">
<template v-if="item.label != '工作台'">
<div class="title">{{item.label}}</div>
</template>
<div class="box">
<template v-for="i in item.children">
<div
:key="i.id"
class="item"
@click="jump(i)"
>
<div :class="['sprite-icon',`icon-${i.icon}`]"></div>
{{i.label}}
</div>
</template>
</div>
</template>
</div>
</div>
</div>
</template>
</template>
</template>
<template v-else>
<van-empty description="暂无内容" />
</template>
</template>
<!-- <div class="title">统计分析</div>
......@@ -33,32 +40,42 @@
<script type='text/ecmascript-6'>
const { subsystemInfo } = window.$fetchConfig
import { ssoApi } from '@/api'
import { Notify } from 'vant'
export default {
name: '',
data() {
return {
list: []
list: [],
flag: false
}
},
activated(){
let list = this.getLocalStorage('dj_scrm_permissionList')
if (list && list.length) {
list.map(e => {
if (e.children) {
e.children.map(i => {
let [link, target] = i.menuUrl.split('@')
i.icon = link.replace(/\//g, '_')
i.link = link
i.target = target
activated() {
ssoApi.getPermission().then(({ code, data, message }) => {
if (code == 0) {
let list = data[0].products[0].merchantProTreeResponses[0].children
if (list && list.length) {
list.map(e => {
if (e.children) {
e.children.map(i => {
let [link, target] = i.menuUrl.split('@')
i.icon = link.replace(/\//g, '_')
i.link = link
i.target = target
})
}
})
this.list = list
this.flag = true
} else {
this.flag = true
}
})
this.list = list
}
},
mounted() {
} else {
Notify(message)
}
})
},
mounted() {},
methods: {
jump(e) {
let sessionId = this.getSessionId()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!