This commit is contained in:
liuye
2022-03-24 08:44:14 +08:00
234 changed files with 12373 additions and 4746 deletions

View File

@@ -18,7 +18,7 @@
<ai-empty v-else>请选择应用</ai-empty>
</el-row>
<div v-if="dialog" class="sign-box">
<ai-sign style="margin: auto" :instance="$axios" :action="{login:'/auth/oauth/token?corpId=ww596787bb70f08288'}"
<ai-sign style="margin: auto" :instance="$axios" :action="{login}"
visible @login="getToken" :showScanLogin="false"/>
</div>
<el-button type="info" v-if="!showTools" class="fixedBtn" @click="showTools=true">显示工具栏</el-button>
@@ -45,6 +45,11 @@ export default {
},
selectedApp() {
return this.$route.matched.length > 0
},
login() {
let url = '/auth/oauth/token';
/project\/sass/g.test(location.pathname) && (url += "?corpId=ww596787bb70f08288")
return url
}
},
data() {
@@ -70,7 +75,7 @@ export default {
this.$axios.post("/admin/user/detail-phone").then(res => {
if (res && res.data) {
this.$store.commit("setUserInfo", res.data)
if (/^\/xiushan/.test(location.pathname)) {
if (/^\/project\/xiushan/.test(location.pathname)) {
this.$store.commit("setFinanceUser")
}
}

View File

@@ -2,7 +2,6 @@ import Vue from 'vue';
import App from './App.vue';
import ui from 'element-ui';
import router from './router/router';
import apps from './entries';
import axios from './router/axios';
import utils from './utils';
import vcUI from 'dvcp-ui';
@@ -14,7 +13,6 @@ import dataV from '@jiaminghi/data-view';
Vue.use(dataV);
Vue.use(apps);
Vue.use(ui);
Vue.use(vcUI);
Vue.use(dvUI);
@@ -25,7 +23,7 @@ Vue.prototype.formatContent = (val) => val.replace(/(\r\n)|(\n)/g, '<br>');
Object.keys(utils).map((e) => (Vue.prototype[e] = utils[e]));
utils.$store.init(store);
new Vue({
router,
store,
render: (h) => h(App)
router,
store,
render: (h) => h(App)
}).$mount('#app');

View File

@@ -21,8 +21,9 @@ export default {
let {name, label} = files(path).default,
addApp = {
name, label: label || name,
path: path.replace(/\.(\/.+\/App.+)\.vue$/, '$1'),
entry: 'appEntry'
path: path.replace(/\.(\/.+\/App.+)\.vue$/, '/packages$1'),
entry: 'appEntry',
module: files(path).default
}
//命名规范入口文件必须以App开头
store.commit("addApp", addApp)
@@ -34,8 +35,9 @@ export default {
let {name, label} = cores(path).default,
addApp = {
name, label: label || name,
path: path.replace(/\.(\/.+\/App.+)\.vue$/, '$1'),
entry: 'appEntry'
path: path.replace(/\.(\/.+\/App.+)\.vue$/, '/core$1'),
entry: 'appEntry',
module: cores(path).default
}
//命名规范入口文件必须以App开头
store.commit("addApp", addApp)
@@ -46,9 +48,10 @@ export default {
if (project(path).default) {
let {name, label} = project(path).default,
addApp = {
name, label: label || name,
path: path.replace(/\.(\/.+\/App.+)\.vue$/, '$1'),
entry: 'appEntry'
name: [path.replace(/\.\/([^\/]+)\/.*/, '$1'), name].join("_"), label: label || name,
path: path.replace(/\.(\/.+\/App.+)\.vue$/, '/project$1'),
entry: 'appEntry',
module: project(path).default
}
//命名规范入口文件必须以App开头
store.commit("addApp", addApp)

View File

@@ -9,9 +9,12 @@ let baseURLs = {
instance.defaults.baseURL = baseURLs[process.env.NODE_ENV]
instance.interceptors.request.eject(0);
instance.interceptors.request.use(config => {
if (/^\/xiushan/.test(location.pathname)) {
if (/\/xiushan/.test(location.pathname)) {
config.baseURL = "/xsjr"
config.url = config.url.replace(/(app|auth|admin)\//, "")
}else if (/project\/oms/.test(location.pathname)) {
config.baseURL = "/omsapi"
config.url = config.url.replace(/(app|auth|admin)\//, "")
}
if (!config.withoutToken && localStorage.getItem("ui-token")) {
config.headers['Authorization'] = ["Bearer", localStorage.getItem("ui-token")].join(" ")

View File

@@ -7,12 +7,16 @@
<script>
import {mapState} from "vuex";
export default {
name: "appEntry",
label: "应用库-应用",
computed: {
...mapState(['apps']),
app() {
return this.$route.name
let app = this.apps.find(e => e.name == this.$route.name)
return app ? app.module : ""
}
}
}