Commit 08f85003 by 李伟康

commit

1 parent cf65ca36
...@@ -167,14 +167,6 @@ export default { ...@@ -167,14 +167,6 @@ export default {
this.setLocalStorage('dj_scrm_userInfo', data) this.setLocalStorage('dj_scrm_userInfo', data)
console.log(data) console.log(data)
this.init() 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 { } else {
Notify(message) Notify(message)
} }
...@@ -182,7 +174,7 @@ export default { ...@@ -182,7 +174,7 @@ export default {
} }
}, },
click(e) { click(e) {
let { status, taskId, id , taskType} = e let { status, taskId, id, taskType } = e
if (status == 2) return if (status == 2) return
wwbenchApi.updateTasks({ id }).then(res => { wwbenchApi.updateTasks({ id }).then(res => {
if (taskType == 3 || taskType == 4) { if (taskType == 3 || taskType == 4) {
......
...@@ -98,18 +98,7 @@ const actions = { ...@@ -98,18 +98,7 @@ const actions = {
util.removeLocalStorage('dj_scrm_redirect_uri') util.removeLocalStorage('dj_scrm_redirect_uri')
// 只有一个账号 history.back() // 只有一个账号 history.back()
if (redirect_uri) window.location.href = decodeURIComponent(`${redirect_uri}?sessionId=${userInfo.sessionId}&corpId=${corpId}`) if (redirect_uri) window.location.href = decodeURIComponent(`${redirect_uri}?sessionId=${userInfo.sessionId}&corpId=${corpId}`)
else { else window.location.replace(`${url}${route}`)
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 { } else {
/**没有账号 */ /**没有账号 */
...@@ -168,8 +157,8 @@ const login = ({ dispatch, to }) => { ...@@ -168,8 +157,8 @@ const login = ({ dispatch, to }) => {
let loginToken = util.getLocalStorage('dj_scrm_loginToken') let loginToken = util.getLocalStorage('dj_scrm_loginToken')
let userInfo = util.getLocalStorage('dj_scrm_userInfo') let userInfo = util.getLocalStorage('dj_scrm_userInfo')
let sessionId = util.getSessionId() let sessionId = util.getSessionId()
if (!userInfo || !sessionId) {
dispatch('registerHttp', sessionId || '') dispatch('registerHttp', sessionId || '')
if (!userInfo || !sessionId) {
if (loginToken) { if (loginToken) {
state.showWindow = true state.showWindow = true
if (to && to.name != 'common.accountList') router.replace({ name: 'common.accountList' }) if (to && to.name != 'common.accountList') router.replace({ name: 'common.accountList' })
......
...@@ -71,17 +71,7 @@ export default { ...@@ -71,17 +71,7 @@ export default {
this.showLoading('登录成功', () => { this.showLoading('登录成功', () => {
this.hideLoading() this.hideLoading()
if (redirect_uri) window.location.href = decodeURIComponent(`${redirect_uri}?sessionId=${data.sessionId}&corpId=${corpId}`) if (redirect_uri) window.location.href = decodeURIComponent(`${redirect_uri}?sessionId=${data.sessionId}&corpId=${corpId}`)
else { else this.$router.replace({ name: lastPath || 'home' })
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 { } else {
......
<template> <template>
<div class="layout"> <div class="layout">
<template v-if="flag">
<template v-if="list.length">
<template v-for="item in list"> <template v-for="item in list">
<template v-if="item.children && item.children.length"> <template v-if="item.children && item.children.length">
<div :key="item.id"> <div :key="item.id">
...@@ -21,6 +23,11 @@ ...@@ -21,6 +23,11 @@
</div> </div>
</template> </template>
</template> </template>
</template>
<template v-else>
<van-empty description="暂无内容" />
</template>
</template>
<!-- <div class="title">统计分析</div> <!-- <div class="title">统计分析</div>
<div class="box"> <div class="box">
<div class="item"> <div class="item">
...@@ -33,15 +40,20 @@ ...@@ -33,15 +40,20 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
const { subsystemInfo } = window.$fetchConfig const { subsystemInfo } = window.$fetchConfig
import { ssoApi } from '@/api'
import { Notify } from 'vant'
export default { export default {
name: '', name: '',
data() { data() {
return { return {
list: [] list: [],
flag: false
} }
}, },
activated(){ activated() {
let list = this.getLocalStorage('dj_scrm_permissionList') ssoApi.getPermission().then(({ code, data, message }) => {
if (code == 0) {
let list = data[0].products[0].merchantProTreeResponses[0].children
if (list && list.length) { if (list && list.length) {
list.map(e => { list.map(e => {
if (e.children) { if (e.children) {
...@@ -54,11 +66,16 @@ export default { ...@@ -54,11 +66,16 @@ export default {
} }
}) })
this.list = list this.list = list
this.flag = true
} else {
this.flag = true
} }
} else {
Notify(message)
}
})
}, },
mounted() { mounted() {},
},
methods: { methods: {
jump(e) { jump(e) {
let sessionId = this.getSessionId() 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!