更新
This commit is contained in:
@@ -50,10 +50,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="domain">
|
<view class="domain">
|
||||||
<view class="item" v-for="item,index in menuList" :key="index">
|
<template v-for="item,index in menuList">
|
||||||
|
<view class="item" v-if="isHaveAuth(item.submenu)" :key="index">
|
||||||
<view class="title">{{item.name}}</view>
|
<view class="title">{{item.name}}</view>
|
||||||
<view class="options-frame" >
|
<view class="options-frame" >
|
||||||
<view class="option" v-for="optionItme,optionIndex in item.submenu" :key="optionIndex" @tap.stop="jump(optionItme)">
|
<template v-for="optionItme,optionIndex in item.submenu">
|
||||||
|
<view class="option" v-if="user.authList.includes(optionItme.lable)" :key="optionIndex" @tap.stop="jump(optionItme)">
|
||||||
<view class="star" @tap.stop="collectionFn(optionItme)">
|
<view class="star" @tap.stop="collectionFn(optionItme)">
|
||||||
<uni-icons :color="iconFn(optionItme)" custom-prefix="iconfont" type="iconshoucang-yishoucang" size="18"></uni-icons>
|
<uni-icons :color="iconFn(optionItme)" custom-prefix="iconfont" type="iconshoucang-yishoucang" size="18"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
@@ -62,8 +64,11 @@
|
|||||||
<uni-icons color="#fff" custom-prefix="iconfont" :type="optionItme.icon" size="50"></uni-icons>
|
<uni-icons color="#fff" custom-prefix="iconfont" :type="optionItme.icon" size="50"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@@ -136,6 +141,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isHaveAuth(submenu) {
|
||||||
|
return submenu.some(item => this.user.authList.includes(item.lable))
|
||||||
|
},
|
||||||
close() {
|
close() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -150,7 +158,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
jump(e) {
|
jump(e) {
|
||||||
if (this.user.authList.includes(e.lable)) {
|
if (this.user.authList.includes(e.lable)) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import axios from 'axios'
|
|||||||
import utils from '@/utils/encode'
|
import utils from '@/utils/encode'
|
||||||
// const env = process.env.NODE_ENV
|
// const env = process.env.NODE_ENV
|
||||||
// const env = 'test'
|
// const env = 'test'
|
||||||
const env = 'production'
|
const env = 'test'
|
||||||
const testUrl = 'http://192.168.110.10:38080'
|
const testUrl = 'http://192.168.110.10:38080'
|
||||||
// const productUrl = 'https://www.xingoil.com/adminapi'
|
// const productUrl = 'https://www.xingoil.com/adminapi'
|
||||||
// const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
// const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
||||||
@@ -36,7 +36,7 @@ service.interceptors.request.use(
|
|||||||
config.headers['dataSources'] = 'MP'
|
config.headers['dataSources'] = 'MP'
|
||||||
|
|
||||||
if (env === 'production') {
|
if (env === 'production') {
|
||||||
console.log("这里是生产")
|
// console.log("这里是生产")
|
||||||
// 生产环境,加密,不输出任何东西
|
// 生产环境,加密,不输出任何东西
|
||||||
// 设置jsessionid和token
|
// 设置jsessionid和token
|
||||||
const JSESSIONID = utils.uuid()
|
const JSESSIONID = utils.uuid()
|
||||||
@@ -50,13 +50,13 @@ service.interceptors.request.use(
|
|||||||
}
|
}
|
||||||
// 要加密
|
// 要加密
|
||||||
data.params = utils.encrypt(JSON.stringify(config.data))
|
data.params = utils.encrypt(JSON.stringify(config.data))
|
||||||
console.log('参数', config.url, '参数加密前', config.data, '加密:', data)
|
// console.log('参数', config.url, '参数加密前', config.data, '加密:', data)
|
||||||
config.data = data
|
config.data = data
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
console.log("这里是测试")
|
// console.log("这里是测试")
|
||||||
console.log('\n\n-----------------------')
|
// console.log('\n\n-----------------------')
|
||||||
console.log('参数', config.url, '参数加密前', config.data)
|
// console.log('参数', config.url, '参数加密前', config.data)
|
||||||
url = config.url
|
url = config.url
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
@@ -73,7 +73,7 @@ service.interceptors.request.use(
|
|||||||
|
|
||||||
service.interceptors.response.use(
|
service.interceptors.response.use(
|
||||||
response => {
|
response => {
|
||||||
console.log(response.data,'-------------------')
|
// console.log(response.data,'-------------------')
|
||||||
const res = response.data
|
const res = response.data
|
||||||
if (env === 'production') {
|
if (env === 'production') {
|
||||||
// 生产环境,进行加密解密,不输出日志
|
// 生产环境,进行加密解密,不输出日志
|
||||||
@@ -81,17 +81,17 @@ service.interceptors.response.use(
|
|||||||
// 加密的数据,需要解密
|
// 加密的数据,需要解密
|
||||||
const dataParam = JSON.parse(utils.decrypt(res.data))
|
const dataParam = JSON.parse(utils.decrypt(res.data))
|
||||||
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
|
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
|
||||||
console.log(res.data)
|
// console.log(res.data)
|
||||||
// console.log('返回', response.config.url, '返回结果',res)
|
// console.log('返回', response.config.url, '返回结果',res)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('返回', response.config.url, '返回结果未加密', res)
|
// console.log('返回', response.config.url, '返回结果未加密', res)
|
||||||
// console.log('-------------------------------------------\n\n')
|
// console.log('-------------------------------------------\n\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
if (response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1) {
|
if (response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1) {
|
||||||
console.log(res, '----------------------------------')
|
// console.log(res, '----------------------------------')
|
||||||
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改,请重新登录' && res.msg !=
|
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改,请重新登录' && res.msg !=
|
||||||
'登录与操作设备不同') {
|
'登录与操作设备不同') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -127,7 +127,7 @@ service.interceptors.response.use(
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.getNetworkType({
|
uni.getNetworkType({
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
console.log(res.networkType);
|
// console.log(res.networkType);
|
||||||
if (res.networkType === 'none') {
|
if (res.networkType === 'none') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '没有网啦!',
|
title: '没有网啦!',
|
||||||
|
|||||||
Reference in New Issue
Block a user