diff --git a/examples/App.vue b/examples/App.vue index 14fab565..e0591145 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -22,7 +22,7 @@ import SliderNav from "./components/sliderNav"; import MainContent from "./components/mainContent"; import HeaderNav from "./components/headerNav"; -import {mapMutations, mapState} from "vuex"; +import {mapActions, mapMutations, mapState} from "vuex"; export default { name: 'app', @@ -42,7 +42,8 @@ export default { } }, methods: { - ...mapMutations(['setToken']), + ...mapMutations(['setToken', 'setFinanceUser']), + ...mapActions(['getUserInfo']), getToken(params) { if (params.access_token) { this.setToken([params.token_type, params.access_token].join(' ')) @@ -52,16 +53,6 @@ export default { } 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() { this.$axios.delete("/auth/token/logout").finally(() => { this.dialog = true @@ -69,8 +60,12 @@ export default { }, }, created() { - if (this.user.token) this.getUserInfo() wx = jWeixin + if (this.user.token) this.getUserInfo().then(() => { + if (/^\/project\/xiushan/.test(location.pathname)) { + this.setFinanceUser() + } + }) } } diff --git a/examples/store/index.js b/examples/store/index.js index fb58e995..ef9e5f4d 100644 --- a/examples/store/index.js +++ b/examples/store/index.js @@ -2,56 +2,28 @@ import Vue from 'vue' import Vuex from 'vuex' import preState from 'vuex-persistedstate' import request from '../router/axios' +import * as modules from "dvcp-ui/lib/js/modules" 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({ state: { dicts: [], apps: [] }, 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) { state.apps.push(app) }, cleanApps(state) { state.apps = [] - } + }, + setFinanceUser(state) { + request.post("appfinancialorganizationuser/checkUser").then(res => { + state.user.financeUser = res.data + }) + }, }, - modules: {user}, + modules, plugins: [preState()] }) diff --git a/project/sass/apps/Announce/AppAnnounce/components/Add.vue b/project/sass/apps/Announce/AppAnnounce/components/Add.vue index 5a5d0a9f..4d8901f2 100644 --- a/project/sass/apps/Announce/AppAnnounce/components/Add.vue +++ b/project/sass/apps/Announce/AppAnnounce/components/Add.vue @@ -36,13 +36,13 @@ - - + +
- + {{ item.name }}
删除 @@ -67,7 +67,7 @@ :limit="9" action="/app/wxcp/upload/uploadFile" accept=".jpg,.png,.jpeg" - :http-request="v => submitUpload(v, 'image')"> + :http-request="v => submitUpload(v, '1')">

图片

@@ -82,17 +82,28 @@ :limit="9" action="/app/wxcp/upload/uploadFile" accept=".mp4" - :http-request="v => submitUpload(v, 'video')"> + :http-request="v => submitUpload(v, '2')">

视频

-
+ +
-

文件

-
-
+

文件

+
+
+

网页

@@ -133,6 +144,41 @@
+ + +
+ + + + + + + + + + + + + + + +
+
+