Merge branch 'dev' of gitee.com:liqianglog/django-vue-admin into dev
commit
a77237ee40
|
@ -2,4 +2,5 @@
|
||||||
# python manage.py makemigrations
|
# python manage.py makemigrations
|
||||||
# python manage.py migrate
|
# python manage.py migrate
|
||||||
# python manage.py init -y
|
# python manage.py init -y
|
||||||
gunicorn -c gunicorn_conf.py application.asgi:application
|
#gunicorn -c gunicorn_conf.py application.asgi:application
|
||||||
|
uvicorn application.asgi:application --port 8000 --host 0.0.0.0 --workers 4
|
||||||
|
|
|
@ -277,6 +277,6 @@ class InitSettingsViewSet(APIView):
|
||||||
SystemConfig.objects.filter(status=False, parent_id__isnull=False).values('parent__key',
|
SystemConfig.objects.filter(status=False, parent_id__isnull=False).values('parent__key',
|
||||||
'key')]
|
'key')]
|
||||||
data = dict(filter(lambda x: x[0] not in backend_config, data.items()))
|
data = dict(filter(lambda x: x[0] not in backend_config, data.items()))
|
||||||
data = self.filter_system_config_values(data=data)
|
if hasattr(connection, 'tenant'):
|
||||||
data['schema_name'] = connection.tenant.schema_name
|
data['schema_name'] = connection.tenant.schema_name
|
||||||
return DetailResponse(data=data)
|
return DetailResponse(data=data)
|
||||||
|
|
|
@ -3,7 +3,7 @@ certifi==2021.5.30
|
||||||
chardet==4.0.0
|
chardet==4.0.0
|
||||||
coreapi==2.3.3
|
coreapi==2.3.3
|
||||||
coreschema==0.0.4
|
coreschema==0.0.4
|
||||||
Django==3.2.12
|
Django==3.2.19
|
||||||
django-comment-migrate==0.1.7
|
django-comment-migrate==0.1.7
|
||||||
django-cors-headers==3.10.1
|
django-cors-headers==3.10.1
|
||||||
django-filter==22.1
|
django-filter==22.1
|
||||||
|
@ -11,8 +11,8 @@ django-ranged-response==0.2.0
|
||||||
django-redis==5.2.0
|
django-redis==5.2.0
|
||||||
django-restql==0.15.3
|
django-restql==0.15.3
|
||||||
django-simple-captcha==0.5.17
|
django-simple-captcha==0.5.17
|
||||||
django-tenants==3.4.8
|
django-tenants==3.5.0
|
||||||
django-timezone-field==4.2.3
|
django-timezone-field==5.0
|
||||||
djangorestframework==3.14.0
|
djangorestframework==3.14.0
|
||||||
djangorestframework-simplejwt==5.2.2
|
djangorestframework-simplejwt==5.2.2
|
||||||
packaging==23.0
|
packaging==23.0
|
||||||
|
@ -29,7 +29,7 @@ pyparsing==2.4.7
|
||||||
pyPEG2==2.15.2
|
pyPEG2==2.15.2
|
||||||
pypinyin==0.48.0
|
pypinyin==0.48.0
|
||||||
pytz==2021.1
|
pytz==2021.1
|
||||||
requests==2.28.2
|
requests==2.28.0
|
||||||
ruamel.yaml==0.17.10
|
ruamel.yaml==0.17.10
|
||||||
ruamel.yaml.clib==0.2.4
|
ruamel.yaml.clib==0.2.4
|
||||||
six==1.16.0
|
six==1.16.0
|
||||||
|
|
|
@ -56,6 +56,9 @@
|
||||||
<div style="text-align: center" v-if="_elProps.listType === 'avatar'">
|
<div style="text-align: center" v-if="_elProps.listType === 'avatar'">
|
||||||
<img style="max-width: 100%;" :src="dialogImageUrl" alt="">
|
<img style="max-width: 100%;" :src="dialogImageUrl" alt="">
|
||||||
</div>
|
</div>
|
||||||
|
<div style="text-align: center" v-else-if="_elProps.listType === 'picture-card'">
|
||||||
|
<img style="max-width: 100%;" :src="dialogImageUrl" alt="">
|
||||||
|
</div>
|
||||||
<div style="text-align: center" v-else>
|
<div style="text-align: center" v-else>
|
||||||
<div id="player" v-if="dialogVisible">
|
<div id="player" v-if="dialogVisible">
|
||||||
<div class="player-container">
|
<div class="player-container">
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
:rules="[
|
:rules="[
|
||||||
{ required: elProps.fields[key].required, message: '不能为空', trigger: 'blur' },
|
{ required: elProps.fields[key].required, message: '不能为空', trigger: 'blur' },
|
||||||
]"
|
]"
|
||||||
|
style="text-align: center"
|
||||||
>
|
>
|
||||||
<el-select v-model="field[key]" v-if="elProps.fields[key].type === 'select'" placeholder="请选择">
|
<el-select v-model="field[key]" v-if="elProps.fields[key].type === 'select'" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -33,21 +34,35 @@
|
||||||
:value="item.value">
|
:value="item.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input-number style="width: 100%" v-else-if="elProps.fields[key].type === 'number'" controls-position="right" v-model="field[key]"></el-input-number>
|
<el-input-number style="width: 100%" v-else-if="elProps.fields[key].type === 'number'"
|
||||||
<div v-else-if="elProps.fields[key].type === 'image'" style="height: 50px;width: 50px;">
|
controls-position="right" v-model="field[key]"></el-input-number>
|
||||||
<d2p-file-uploader v-model="field[key]" :elProps="elProps.fields[key].elProps || { listType: 'picture-card', accept: '.png,.jpeg,.jpg,.ico,.bmp,.gif', limit: 1 }"></d2p-file-uploader>
|
<div class="d2p-images" v-else-if="elProps.fields[key].type === 'image'">
|
||||||
|
<d2p-file-uploader v-model="field[key]"
|
||||||
|
:elProps="elProps.fields[key].elProps || { listType: 'picture-card', accept: '.png,.jpeg,.jpg,.ico,.bmp,.gif', limit: 1 }"></d2p-file-uploader>
|
||||||
</div>
|
</div>
|
||||||
<!-- 富文本 -->
|
<!-- 富文本 -->
|
||||||
<span v-else-if="elProps.fields[key].type === 'ueditor'">
|
<span v-else-if="elProps.fields[key].type === 'ueditor'">
|
||||||
<values-popover v-model="field[key]" :elProps="{ type: 'ueditor' }" @previewClick="previewClick(index,key)"></values-popover>
|
<values-popover v-model="field[key]" :elProps="{ type: 'ueditor' }"
|
||||||
|
@previewClick="previewClick(index,key)"></values-popover>
|
||||||
|
</span>
|
||||||
|
<!-- 多对多 -->
|
||||||
|
<span v-else-if="elProps.fields[key].type === 'many_to_many'">
|
||||||
|
<values-popover
|
||||||
|
v-model="field[key]"
|
||||||
|
:dict="elProps.fields[key].dict"
|
||||||
|
:elProps="{ type: elProps.fields[key].value?.type || 'manyToMany', rowKey: elProps.fields[key].value?.rowKey || 'title', label: elProps.value?.title || '答复选项内容' }"
|
||||||
|
@listClick="manyToManyClick(index,key)">
|
||||||
|
</values-popover>
|
||||||
</span>
|
</span>
|
||||||
<el-input v-model="field[key]" v-else placeholder="请输入"></el-input>
|
<el-input v-model="field[key]" v-else placeholder="请输入"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click.prevent="topDomain(index)" :disabled="index === 0" type="primary" circle icon="el-icon-top"></el-button>
|
<el-button @click.prevent="topDomain(index)" :disabled="index === 0" type="primary" circle
|
||||||
<el-button @click.prevent="bottomDomain(index)" :disabled="index === currentForm.data.length - 1" type="primary" circle icon="el-icon-bottom"></el-button>
|
icon="el-icon-top"></el-button>
|
||||||
|
<el-button @click.prevent="bottomDomain(index)" :disabled="index === currentForm.data.length - 1"
|
||||||
|
type="primary" circle icon="el-icon-bottom"></el-button>
|
||||||
<el-button @click.prevent="removeDomain(index)" type="danger" circle icon="el-icon-delete"></el-button>
|
<el-button @click.prevent="removeDomain(index)" type="danger" circle icon="el-icon-delete"></el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -64,7 +79,7 @@
|
||||||
append-to-body
|
append-to-body
|
||||||
width="900">
|
width="900">
|
||||||
<d2p-ueditor
|
<d2p-ueditor
|
||||||
v-if="currentForm.data && currentForm.data[ueditorIndex]"
|
v-if="currentForm.data && currentForm.data[ueditorIndex] && ueditorKey"
|
||||||
v-model="currentForm.data[ueditorIndex][ueditorKey]"
|
v-model="currentForm.data[ueditorIndex][ueditorKey]"
|
||||||
:config="ueditorConfig">
|
:config="ueditorConfig">
|
||||||
</d2p-ueditor>
|
</d2p-ueditor>
|
||||||
|
@ -72,10 +87,27 @@
|
||||||
<el-button type="primary" @click="previewVisible = false">完成</el-button>
|
<el-button type="primary" @click="previewVisible = false">完成</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog
|
||||||
|
title="编辑"
|
||||||
|
:visible.sync="manyToManyVisible"
|
||||||
|
append-to-body
|
||||||
|
v-if="currentForm.data && currentForm.data[manyToManyIndex] && manyToManyKey"
|
||||||
|
:width="elProps.fields[manyToManyKey].dialogWidth">
|
||||||
|
<foreign-key-crud-form
|
||||||
|
v-model="currentForm.data[manyToManyIndex][manyToManyKey]"
|
||||||
|
:isInitRows="elProps.fields[manyToManyKey].isInitRows"
|
||||||
|
:elProps="elProps.fields[manyToManyKey].elProps"
|
||||||
|
@change="foreignChange"
|
||||||
|
></foreign-key-crud-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="manyToManyVisible = false">保存</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import util from '@/libs/util.js'
|
import util from '@/libs/util.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'foreignKeyCrudForm',
|
name: 'foreignKeyCrudForm',
|
||||||
model: {
|
model: {
|
||||||
|
@ -128,6 +160,50 @@ export default {
|
||||||
required: true,
|
required: true,
|
||||||
min: 0,
|
min: 0,
|
||||||
max: null
|
max: null
|
||||||
|
},
|
||||||
|
option_data: {
|
||||||
|
name: '选项题目',
|
||||||
|
type: 'many_to_many',
|
||||||
|
span: 2,
|
||||||
|
default: [],
|
||||||
|
required: false,
|
||||||
|
unit: '个',
|
||||||
|
value: {
|
||||||
|
type: 'strList',
|
||||||
|
rowKey: 'name',
|
||||||
|
title: '选项内容'
|
||||||
|
},
|
||||||
|
// 子级多对多
|
||||||
|
isInitRows: true,
|
||||||
|
dialogWidth: '700',
|
||||||
|
dict: {
|
||||||
|
value: 'id', // 数据字典中value字段的属性名
|
||||||
|
label: 'name' // 数据字典中label字段的属性名
|
||||||
|
},
|
||||||
|
elProps: {
|
||||||
|
index: {
|
||||||
|
name: '序号',
|
||||||
|
span: 2
|
||||||
|
},
|
||||||
|
fields: {
|
||||||
|
name: {
|
||||||
|
name: '题目选项内容',
|
||||||
|
type: 'input',
|
||||||
|
span: 10,
|
||||||
|
default: null,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
sort: {
|
||||||
|
name: '排序',
|
||||||
|
type: 'number',
|
||||||
|
span: 8,
|
||||||
|
default: 0,
|
||||||
|
required: true,
|
||||||
|
min: 0,
|
||||||
|
max: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +240,11 @@ export default {
|
||||||
// 富文本弹窗编辑框
|
// 富文本弹窗编辑框
|
||||||
previewVisible: false,
|
previewVisible: false,
|
||||||
ueditorIndex: 0,
|
ueditorIndex: 0,
|
||||||
ueditorKey: null
|
ueditorKey: null,
|
||||||
|
// 多对多弹窗
|
||||||
|
manyToManyIndex: 0,
|
||||||
|
manyToManyKey: null,
|
||||||
|
manyToManyVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -254,11 +334,54 @@ export default {
|
||||||
this.ueditorKey = key
|
this.ueditorKey = key
|
||||||
this.previewVisible = true
|
this.previewVisible = true
|
||||||
console.log('previewClick', index, key)
|
console.log('previewClick', index, key)
|
||||||
|
},
|
||||||
|
// 多对多点击事件
|
||||||
|
manyToManyClick (index, key) {
|
||||||
|
this.manyToManyIndex = index
|
||||||
|
this.manyToManyKey = key
|
||||||
|
this.manyToManyVisible = true
|
||||||
|
if (!this.currentForm.data[this.manyToManyIndex][this.manyToManyKey]) {
|
||||||
|
this.currentForm.data[this.manyToManyIndex][this.manyToManyKey] = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
foreignChange (res) {
|
||||||
|
if (this.manyToManyKey) {
|
||||||
|
this.currentForm.data[this.manyToManyIndex][this.manyToManyKey] = res
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style lang="scss">
|
||||||
|
.d2p-images {
|
||||||
|
height: 30px;
|
||||||
|
width: 30px;
|
||||||
|
|
||||||
|
.el-upload-list__item-thumbnail {
|
||||||
|
height: 60px !important;
|
||||||
|
width: 60px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-upload-list__item {
|
||||||
|
width: 60px !important;
|
||||||
|
height: 60px !important;
|
||||||
|
line-height: 0 !important;
|
||||||
|
|
||||||
|
img {
|
||||||
|
height: 60px !important;
|
||||||
|
width: 60px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-upload-list__item-actions {
|
||||||
|
height: 60px !important;
|
||||||
|
width: 60px !important;
|
||||||
|
line-height: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
::v-deep .d2p-file-uploader .el-upload--picture-card {
|
::v-deep .d2p-file-uploader .el-upload--picture-card {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
|
|
|
@ -18,10 +18,10 @@
|
||||||
{{ item[dict.label] }}
|
{{ item[dict.label] }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<el-button type="primary" plain size="mini" slot="reference"><span> {{ value.length }} {{ elProps.unit }}</span>
|
<el-button type="primary" plain size="mini" slot="reference" @click="listClick"><span> {{ value.length }} {{ elProps.unit }}</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-button v-else type="primary" plain size="mini" slot="reference"><span> {{
|
<el-button v-else type="primary" plain size="mini" slot="reference" @click="listClick"><span> {{
|
||||||
value.length
|
value.length
|
||||||
}} {{ elProps.unit }}</span>
|
}} {{ elProps.unit }}</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -36,6 +36,30 @@
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="elProps.type === 'manyToMany'">
|
||||||
|
<el-popover
|
||||||
|
placement="right"
|
||||||
|
width="300"
|
||||||
|
trigger="hover"
|
||||||
|
v-if="value.length > 0"
|
||||||
|
@show="showEvents"
|
||||||
|
@hide="show=false">
|
||||||
|
<el-descriptions class="margin-top" :column="1" size="mini" border>
|
||||||
|
<el-descriptions-item v-for="(item,index) in value" :key="index" labelStyle="width: 60px;">
|
||||||
|
<template slot="label">
|
||||||
|
选项{{ index + 1 }}
|
||||||
|
</template>
|
||||||
|
{{ item[dict.label] }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-button type="primary" plain size="mini" slot="reference" @click="listClick"><span> {{ value.length }} {{ elProps.unit }}</span>
|
||||||
|
</el-button>
|
||||||
|
</el-popover>
|
||||||
|
<el-button v-else type="primary" plain size="mini" slot="reference" @click="listClick"><span> {{
|
||||||
|
value.length
|
||||||
|
}} {{ elProps.unit }}</span>
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
<div v-else-if="elProps.type === 'ueditor'">
|
<div v-else-if="elProps.type === 'ueditor'">
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
|
@ -46,10 +70,10 @@
|
||||||
@show="showEvents"
|
@show="showEvents"
|
||||||
@hide="show=false">
|
@hide="show=false">
|
||||||
<div v-html="value" v-if="show"></div>
|
<div v-html="value" v-if="show"></div>
|
||||||
<el-button type="primary" plain size="mini" slot="reference"><span>预览</span>
|
<el-button type="primary" plain size="mini" slot="reference" @click="previewClick"><span>预览</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-button v-else type="primary" plain size="mini" slot="reference"><span>预览</span>
|
<el-button v-else type="primary" plain size="mini" slot="reference" @click="previewClick"><span>预览</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -125,7 +149,9 @@ export default {
|
||||||
if (this.value.constructor === Array) {
|
if (this.value.constructor === Array) {
|
||||||
const ids = []
|
const ids = []
|
||||||
this.value.map(res => {
|
this.value.map(res => {
|
||||||
|
if (res) {
|
||||||
ids.push(res[this.dict.value])
|
ids.push(res[this.dict.value])
|
||||||
|
}
|
||||||
})
|
})
|
||||||
params[this.dict.value] = ids
|
params[this.dict.value] = ids
|
||||||
} else {
|
} else {
|
||||||
|
@ -135,6 +161,12 @@ export default {
|
||||||
request({ url: this.dict.url, params: params }).then(ret => {
|
request({ url: this.dict.url, params: params }).then(ret => {
|
||||||
this.data = ret.data.data || ret.data
|
this.data = ret.data.data || ret.data
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
previewClick () {
|
||||||
|
this.$emit('previewClick')
|
||||||
|
},
|
||||||
|
listClick () {
|
||||||
|
this.$emit('listClick')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,6 @@ new Vue({
|
||||||
// 初始化配置
|
// 初始化配置
|
||||||
this.$store.dispatch('d2admin/settings/load')
|
this.$store.dispatch('d2admin/settings/load')
|
||||||
this.$store.dispatch('d2admin/dictionary/load')
|
this.$store.dispatch('d2admin/dictionary/load')
|
||||||
this.$store.dispatch('d2admin/permission/load')
|
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
/*
|
|
||||||
* @创建文件时间: 2021-06-01 22:41:21
|
|
||||||
* @Auther: 猿小天
|
|
||||||
* @最后修改人: 猿小天
|
|
||||||
* @最后修改时间: 2021-11-19 21:35:56
|
|
||||||
* 联系Qq:1638245306
|
|
||||||
* @文件介绍: 菜单获取
|
|
||||||
*/
|
|
||||||
import { uniqueId } from 'lodash'
|
import { uniqueId } from 'lodash'
|
||||||
import { request } from '@/api/service'
|
import { request } from '@/api/service'
|
||||||
import XEUtils from 'xe-utils'
|
import XEUtils from 'xe-utils'
|
||||||
|
@ -76,7 +68,8 @@ export const handleRouter = function (menuData) {
|
||||||
meta: {
|
meta: {
|
||||||
title: item.name,
|
title: item.name,
|
||||||
auth: true,
|
auth: true,
|
||||||
cache: item.cache
|
cache: item.cache,
|
||||||
|
openInNewWindow: item.frame_out
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.frame_out) {
|
if (item.frame_out) {
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
/*
|
|
||||||
* @创建文件时间: 2021-06-01 22:41:21
|
|
||||||
* @Auther: 猿小天
|
|
||||||
* @最后修改人: 猿小天
|
|
||||||
* @最后修改时间: 2021-11-19 21:49:43
|
|
||||||
* 联系Qq:1638245306
|
|
||||||
* @文件介绍:
|
|
||||||
*/
|
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import VueRouter from 'vue-router'
|
import VueRouter from 'vue-router'
|
||||||
// 进度条
|
// 进度条
|
||||||
|
@ -42,7 +34,7 @@ const router = new VueRouter({
|
||||||
*/
|
*/
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
// 白名单
|
// 白名单
|
||||||
const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/oauth2']
|
const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/clientRenew', '/oauth2']
|
||||||
// 确认已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
|
// 确认已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
|
||||||
await store.dispatch('d2admin/page/isLoaded')
|
await store.dispatch('d2admin/page/isLoaded')
|
||||||
// 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198
|
// 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198
|
||||||
|
@ -64,6 +56,7 @@ router.beforeEach(async (to, from, next) => {
|
||||||
})
|
})
|
||||||
await store.dispatch('d2admin/user/set', res.data, { root: true })
|
await store.dispatch('d2admin/user/set', res.data, { root: true })
|
||||||
await store.dispatch('d2admin/account/load')
|
await store.dispatch('d2admin/account/load')
|
||||||
|
await store.dispatch('d2admin/permission/load', routes)
|
||||||
store.dispatch('d2admin/dept/load')
|
store.dispatch('d2admin/dept/load')
|
||||||
store.dispatch('d2admin/settings/init')
|
store.dispatch('d2admin/settings/init')
|
||||||
}
|
}
|
||||||
|
@ -92,11 +85,21 @@ router.beforeEach(async (to, from, next) => {
|
||||||
next({ path: to.fullPath, replace: true, params: to.params })
|
next({ path: to.fullPath, replace: true, params: to.params })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
next()
|
|
||||||
const childrenPath = window.qiankunActiveRule || []
|
const childrenPath = window.qiankunActiveRule || []
|
||||||
if (to.name) {
|
if (to.name) {
|
||||||
// 有 name 属性,说明是主应用的路由
|
// 有 name 属性,说明是主应用的路由
|
||||||
|
if (to.meta.openInNewWindow && !to.query.newWindow) {
|
||||||
|
// 在新窗口中打开路由
|
||||||
|
const { href } = router.resolve({
|
||||||
|
path: to.path + '?newWindow=1'
|
||||||
|
})
|
||||||
|
window.open(href, '_blank')
|
||||||
|
// 取消当前导航
|
||||||
|
NProgress.done()
|
||||||
|
next(false)
|
||||||
|
} else {
|
||||||
next()
|
next()
|
||||||
|
}
|
||||||
} else if (childrenPath.some((item) => to.path.includes(item))) {
|
} else if (childrenPath.some((item) => to.path.includes(item))) {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue