Browse Source

请求前缀;区分pc/pda

master
[li_she] 5 years ago
parent
commit
d9958cd2bd
  1. 2
      config/index.js
  2. 3
      src/router/index.js
  3. 4
      src/views/main-sidebar.vue
  4. 11
      src/views/modules/sys/menu-add-or-update.vue

2
config/index.js

@ -13,7 +13,7 @@ module.exports = {
// 代理列表, 是否开启代理通过[./dev.env.js]配置 // 代理列表, 是否开启代理通过[./dev.env.js]配置
proxyTable: devEnv.OPEN_PROXY === false ? {} : { proxyTable: devEnv.OPEN_PROXY === false ? {} : {
'/proxyApi': { '/proxyApi': {
target: 'http://127.0.0.1:9090/xujie-fast/',
target: 'http://127.0.0.1:9090',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
// 把 /proxyApi 替换成 / // 把 /proxyApi 替换成 /

3
src/router/index.js

@ -67,7 +67,8 @@ router.beforeEach((to, from, next) => {
url: http.adornUrl('/sys/menu/nav'), url: http.adornUrl('/sys/menu/nav'),
method: 'get', method: 'get',
params: { params: {
'l': i18n.locale //i18n.locale
'l': i18n.locale, //i18n.locale
menuType: "pc"
} }
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {

4
src/views/main-sidebar.vue

@ -132,7 +132,9 @@ export default {
languageCode:this.$i18n.locale languageCode:this.$i18n.locale
} }
userFavoriteList(query).then(({data})=> { userFavoriteList(query).then(({data})=> {
this.favoriteList[0].list = data.list
if (data.list.length>0){
this.favoriteList[0].list = data.list
}
}) })
}, },
// 1 start // 1 start

11
src/views/modules/sys/menu-add-or-update.vue

@ -39,6 +39,12 @@
<el-form-item v-if="dataForm.type !== 2" label="排序号" prop="orderNum"> <el-form-item v-if="dataForm.type !== 2" label="排序号" prop="orderNum">
<el-input-number v-model="dataForm.orderNum" controls-position="right" :min="0" label="排序号"></el-input-number> <el-input-number v-model="dataForm.orderNum" controls-position="right" :min="0" label="排序号"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="菜单类型" prop="menuType">
<el-select v-model="dataForm.menuType">
<el-option label="pc" value="pc"></el-option>
<el-option label="pda" value="pda"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="dataForm.type !== 2" label="菜单图标" prop="icon"> <el-form-item v-if="dataForm.type !== 2" label="菜单图标" prop="icon">
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
@ -102,7 +108,8 @@
perms: '', perms: '',
orderNum: 0, orderNum: 0,
icon: '', icon: '',
iconList: []
iconList: [],
menuType: ''
}, },
dataRule: { dataRule: {
name: [ name: [
@ -134,6 +141,7 @@
params: this.$http.adornParams() params: this.$http.adornParams()
}).then(({data}) => { }).then(({data}) => {
this.menuList = treeDataTranslate(data.menuList, 'menuId') this.menuList = treeDataTranslate(data.menuList, 'menuId')
console.log( this.menuList)
}).then(() => { }).then(() => {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
@ -158,6 +166,7 @@
this.dataForm.perms = data.menu.perms this.dataForm.perms = data.menu.perms
this.dataForm.orderNum = data.menu.orderNum this.dataForm.orderNum = data.menu.orderNum
this.dataForm.icon = data.menu.icon this.dataForm.icon = data.menu.icon
this.dataForm.menuType = data.menu.menuType
this.menuListTreeSetCurrentNode() this.menuListTreeSetCurrentNode()
}) })
} }

Loading…
Cancel
Save