mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
fix:修复okr路由解析错误
This commit is contained in:
parent
7b2b026bad
commit
a38fa4625f
@ -176,7 +176,7 @@ services:
|
||||
|
||||
okr:
|
||||
container_name: "dootask-okr-${APP_ID}"
|
||||
image: "kuaifan/doookr:0.0.6"
|
||||
image: "kuaifan/doookr:0.0.7"
|
||||
environment:
|
||||
TZ: "${TIMEZONE:-PRC}"
|
||||
DOO_TASK_URL: "http://${APP_IPPR}.3"
|
||||
|
||||
5
resources/assets/js/app.js
vendored
5
resources/assets/js/app.js
vendored
@ -2,8 +2,6 @@ const isElectron = !!(window && window.process && window.process.type);
|
||||
const isEEUiApp = window && window.navigator && /eeui/i.test(window.navigator.userAgent);
|
||||
|
||||
import microappInit from "./microapp"
|
||||
microappInit()
|
||||
|
||||
import {switchLanguage as $L} from "./language";
|
||||
|
||||
import './functions/common'
|
||||
@ -210,6 +208,9 @@ Vue.mixin(mixin)
|
||||
|
||||
let app;
|
||||
store.dispatch("init").then(action => {
|
||||
|
||||
microappInit();
|
||||
|
||||
app = new Vue({
|
||||
router,
|
||||
store,
|
||||
|
||||
@ -96,7 +96,7 @@ export default {
|
||||
handler(to) {
|
||||
if(to.name == 'manage-apps'){
|
||||
this.appData = {
|
||||
path: to.hash
|
||||
path: to.hash || to.fullPath
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -120,6 +120,7 @@ export default {
|
||||
getAppData(){
|
||||
return {
|
||||
type: 'init',
|
||||
url: this.url,
|
||||
vues: {
|
||||
Vue,
|
||||
store,
|
||||
|
||||
12
resources/assets/js/microapp.js
vendored
12
resources/assets/js/microapp.js
vendored
@ -1,11 +1,7 @@
|
||||
import microApp from '@micro-zoe/micro-app'
|
||||
|
||||
const getUrl = (s) => {
|
||||
let url = $A.apiUrl('../' + s)
|
||||
if (url.indexOf('http') == -1) {
|
||||
url = window.location.origin + url
|
||||
}
|
||||
return import.meta.env.VITE_OKR_WEB_URL || url;
|
||||
const getUrl = (url) => {
|
||||
return import.meta.env.VITE_OKR_WEB_URL || $A.apiUrl(url);
|
||||
}
|
||||
|
||||
export default function() {
|
||||
@ -21,7 +17,7 @@ export default function() {
|
||||
route = urls.replace(match[0].replace("@vite/client",""),"");
|
||||
}
|
||||
// 这里 /basename/ 需要和子应用vite.config.js中base的配置保持一致
|
||||
code = code.replace( eval(`/(from|import)(\\s*['"])(${route.replace(/\//g,"\\/")})/g`) , all => {
|
||||
code = code.replace(new RegExp(`(from|import)(\\s*['"])(${route.replace(/\//g,"\\/")})`,'g') , all => {
|
||||
return all.replace(route, urls)
|
||||
})
|
||||
}
|
||||
@ -44,7 +40,7 @@ export default function() {
|
||||
microApp.preFetch([
|
||||
{
|
||||
name: 'micro-app',
|
||||
url: getUrl("/apps/okr"),
|
||||
url: getUrl("../apps/okr"),
|
||||
disableSandbox: true
|
||||
}
|
||||
])
|
||||
|
||||
@ -474,11 +474,7 @@ export default {
|
||||
|
||||
// okr路由
|
||||
okrUrl() {
|
||||
let url = $A.apiUrl("../apps/okr")
|
||||
if (url.indexOf('http') == -1) {
|
||||
url = window.location.origin + url
|
||||
}
|
||||
return import.meta.env.VITE_OKR_WEB_URL || url
|
||||
return import.meta.env.VITE_OKR_WEB_URL || $A.apiUrl("../apps/okr")
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -356,7 +356,7 @@ export default {
|
||||
case 'okr':
|
||||
case 'okrAnalyze':
|
||||
this.goForward({
|
||||
path: '/manage/apps/' + (item.value == 'okr' ? '/#/list' : '/#/analysis'),
|
||||
path: '/manage/apps/okr/' + (item.value == 'okr' ? 'list' : 'analysis'),
|
||||
});
|
||||
break;
|
||||
case 'report':
|
||||
|
||||
@ -26,11 +26,7 @@ export default {
|
||||
if (to.name == 'manage-apps') {
|
||||
this.$nextTick(() => {
|
||||
this.loading = false;
|
||||
let url = $A.apiUrl("../apps/okr")
|
||||
if (url.indexOf('http') == -1) {
|
||||
url = window.location.origin + url
|
||||
}
|
||||
this.appUrl = import.meta.env.VITE_OKR_WEB_URL || url
|
||||
this.appUrl = import.meta.env.VITE_OKR_WEB_URL || $A.apiUrl("../apps/okr")
|
||||
this.path = this.$route.query.path || '';
|
||||
})
|
||||
}
|
||||
|
||||
2
resources/assets/js/store/actions.js
vendored
2
resources/assets/js/store/actions.js
vendored
@ -3639,7 +3639,7 @@ export default {
|
||||
if (link_id > 0) {
|
||||
if (window.innerWidth < 910) {
|
||||
$A.goForward({
|
||||
path:'/manage/apps/#/okrDetails?data='+link_id,
|
||||
path:'/manage/apps/okr/okrDetails?data=' + link_id,
|
||||
});
|
||||
}else{
|
||||
state.okrWindow = {
|
||||
|
||||
8
vite.config.js
vendored
8
vite.config.js
vendored
@ -68,7 +68,13 @@ export default defineConfig(({command, mode}) => {
|
||||
chunkSizeWarningLimit: 3000,
|
||||
},
|
||||
plugins: [
|
||||
createVuePlugin(),
|
||||
createVuePlugin({
|
||||
template: {
|
||||
compilerOptions: {
|
||||
isCustomElement: (tag) => tag.includes('micro-app') ,
|
||||
}
|
||||
}
|
||||
}),
|
||||
vitePluginRequire(),
|
||||
vitePluginFileCopy([{
|
||||
src: resolve(__dirname, 'resources/assets/statics/public'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user