整合通讯录组件渲染
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
import SliderNav from "./components/sliderNav";
|
import SliderNav from "./components/sliderNav";
|
||||||
import MainContent from "./components/mainContent";
|
import MainContent from "./components/mainContent";
|
||||||
import HeaderNav from "./components/headerNav";
|
import HeaderNav from "./components/headerNav";
|
||||||
import {mapMutations, mapState} from "vuex";
|
import {mapActions, mapMutations, mapState} from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
@@ -42,7 +42,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setToken']),
|
...mapMutations(['setToken', 'setFinanceUser']),
|
||||||
|
...mapActions(['getUserInfo']),
|
||||||
getToken(params) {
|
getToken(params) {
|
||||||
if (params.access_token) {
|
if (params.access_token) {
|
||||||
this.setToken([params.token_type, params.access_token].join(' '))
|
this.setToken([params.token_type, params.access_token].join(' '))
|
||||||
@@ -52,16 +53,6 @@ export default {
|
|||||||
} else this.$message.error(params.msg || "登录失败!")
|
} else this.$message.error(params.msg || "登录失败!")
|
||||||
|
|
||||||
},
|
},
|
||||||
getUserInfo() {
|
|
||||||
this.$axios.post("/admin/user/detail-phone").then(res => {
|
|
||||||
if (res?.data) {
|
|
||||||
this.$store.commit("setUserInfo", res.data)
|
|
||||||
if (/^\/project\/xiushan/.test(location.pathname)) {
|
|
||||||
this.$store.commit("setFinanceUser")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleLogin() {
|
handleLogin() {
|
||||||
this.$axios.delete("/auth/token/logout").finally(() => {
|
this.$axios.delete("/auth/token/logout").finally(() => {
|
||||||
this.dialog = true
|
this.dialog = true
|
||||||
@@ -69,8 +60,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.user.token) this.getUserInfo()
|
|
||||||
wx = jWeixin
|
wx = jWeixin
|
||||||
|
if (this.user.token) this.getUserInfo().then(() => {
|
||||||
|
if (/^\/project\/xiushan/.test(location.pathname)) {
|
||||||
|
this.setFinanceUser()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,56 +2,28 @@ import Vue from 'vue'
|
|||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import preState from 'vuex-persistedstate'
|
import preState from 'vuex-persistedstate'
|
||||||
import request from '../router/axios'
|
import request from '../router/axios'
|
||||||
|
import * as modules from "dvcp-ui/lib/js/modules"
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
|
||||||
const user = {
|
|
||||||
state: {
|
|
||||||
info: {},
|
|
||||||
token: '',
|
|
||||||
financeUser: {}
|
|
||||||
},
|
|
||||||
mutations: {
|
|
||||||
setFinanceUser(state) {
|
|
||||||
request.post("appfinancialorganizationuser/checkUser").then(res => {
|
|
||||||
state.financeUser = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setUserInfo(state, userInfo) {
|
|
||||||
state.info = userInfo
|
|
||||||
},
|
|
||||||
setToken(state, token) {
|
|
||||||
state.token = token
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
state: {
|
state: {
|
||||||
dicts: [],
|
dicts: [],
|
||||||
apps: []
|
apps: []
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
setDicts(state, payload) {
|
|
||||||
if (payload) {
|
|
||||||
payload.map(p => {
|
|
||||||
if (state.dicts.some(d => d.key == p.key)) {
|
|
||||||
const index = state.dicts.findIndex(d => d.key == p.key)
|
|
||||||
state.dicts.splice(index, 1)
|
|
||||||
state.dicts.push(p)
|
|
||||||
} else {
|
|
||||||
state.dicts.push(p)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
addApp(state, app) {
|
addApp(state, app) {
|
||||||
state.apps.push(app)
|
state.apps.push(app)
|
||||||
},
|
},
|
||||||
cleanApps(state) {
|
cleanApps(state) {
|
||||||
state.apps = []
|
state.apps = []
|
||||||
}
|
},
|
||||||
|
setFinanceUser(state) {
|
||||||
|
request.post("appfinancialorganizationuser/checkUser").then(res => {
|
||||||
|
state.user.financeUser = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
modules: {user},
|
modules,
|
||||||
plugins: [preState()]
|
plugins: [preState()]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ module.exports = {
|
|||||||
filename: 'index.html'
|
filename: 'index.html'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
transpileDependencies: [/node_modules[/\\]dvcp-ui(.+)utils.js/],
|
transpileDependencies: [/node_modules[/\\]dvcp-ui(.+)utils.js/, /node_modules[/\\]dvcp-ui(.+)modules.js/],
|
||||||
chainWebpack: (config) => {
|
chainWebpack: (config) => {
|
||||||
config.module
|
config.module
|
||||||
.rule('js')
|
.rule('js')
|
||||||
|
|||||||
Reference in New Issue
Block a user