Merge branch 'dev' into vite
# Conflicts: # examples/router/autoRoutes.js # package.json # packages/bigscreen/designer/components/Add.vue # project/dv/apps/AppGridDV.vue # vue.config.js
This commit is contained in:
@@ -14,15 +14,15 @@ export default {
|
||||
return this.loadApps()
|
||||
},
|
||||
loadApps() {
|
||||
//锁屏loading
|
||||
waiting.init({innerHTML: '应用加载中..'})
|
||||
let apps = require.context('../../', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, "lazy")
|
||||
Promise.all(apps.keys().map(path => apps(path).then(file => {
|
||||
//新App的自动化格式
|
||||
let apps = require.context('../../packages/', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy'),
|
||||
projects = require.context('../../project/', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy')
|
||||
const promise = (mods, base) => Promise.all(mods.keys().map(path => mods(path).then(file => {
|
||||
if (file.default) {
|
||||
let {name, label} = file.default,
|
||||
addApp = {
|
||||
name: path.replace(/\.\/?(vue)?/g, '')?.split("/").join("_"), label: label || name,
|
||||
path: path.replace(/\.(\/.+\/App.+)\.vue$/, '$1'),
|
||||
path: `/${base}${path.replace(/\.(\/.+\/App.+)\.vue$/, '$1')}`,
|
||||
component: appEntry,
|
||||
module: file.default
|
||||
}
|
||||
@@ -31,7 +31,12 @@ export default {
|
||||
//命名规范入口文件必须以App开头
|
||||
return store.commit("addApp", addApp)
|
||||
} else return 0
|
||||
}))).then(() => {
|
||||
})))
|
||||
waiting.init({innerHTML: '应用加载中..'})
|
||||
Promise.all([
|
||||
promise(apps, "packages"),
|
||||
promise(projects, "project")
|
||||
]).then(() => {
|
||||
axios.post("/node/wechatapps/addOrUpdate", {
|
||||
type: "web",
|
||||
list: this.routes().map(({path: libPath, label, module: {name}, name: id}) => ({
|
||||
|
||||
@@ -3,8 +3,7 @@ import {Message} from 'element-ui'
|
||||
|
||||
let baseURLs = {
|
||||
production: "/",
|
||||
development: '/lan',
|
||||
oms: '/oms'
|
||||
development: '/lan'
|
||||
}
|
||||
instance.defaults.baseURL = baseURLs[process.env.NODE_ENV]
|
||||
instance.interceptors.request.use(config => {
|
||||
@@ -16,15 +15,13 @@ instance.interceptors.request.use(config => {
|
||||
config.baseURL = "/saas"
|
||||
} else 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)\//, "")
|
||||
} else if (/#url-/.test(location.hash)) {
|
||||
config.baseURL = location.hash.replace(/#url-/, '/')
|
||||
if (["/xsjr", "/omsapi"].includes(config.baseURL)) {
|
||||
config.url = config.url.replace(/(app|auth|admin)\//, "")
|
||||
}
|
||||
}
|
||||
if (["/xsjr", "/omsapi"].includes(config.baseURL)) {
|
||||
config.url = config.url.replace(/(app|auth|admin)\//, "")
|
||||
}
|
||||
return config
|
||||
}, error => Message.error(error))
|
||||
|
||||
Reference in New Issue
Block a user