Merge remote-tracking branch 'origin/dev-nx' into dev-nx

This commit is contained in:
liang.chao 2024-09-19 16:22:32 +08:00
commit b70753ec60
9 changed files with 234 additions and 212 deletions

View File

@ -21,7 +21,7 @@ var proxyUrl = (module.exports = {
// target: 'http://112.29.103.165:21626',//重庆 // target: 'http://112.29.103.165:21626',//重庆
// target: 'http://192.168.0.14:21624',//测试 // target: 'http://192.168.0.14:21624',//测试
// target: 'http://112.29.103.165:21624/', //宁夏 // target: 'http://112.29.103.165:21624/', //宁夏
target: 'http://192.168.2.136:28080', target: 'http://192.168.2.127:28080',
changeOrigin: true, changeOrigin: true,
// secure: true, //如果是https接口需要配置这个参数 // secure: true, //如果是https接口需要配置这个参数
pathRewrite: { pathRewrite: {

View File

@ -26,6 +26,18 @@ export default {
resize: true, resize: true,
}) })
}, },
watch: {
$route: {
handler(newValue) {
console.log(newValue, '路由监听--')
if (newValue.query.token) {
localStorage.setItem('token', newValue.query.token)
}
},
deep: true,
},
},
} }
</script> </script>
<style lang="less"> <style lang="less">

View File

@ -2,6 +2,7 @@
* axios全局配置 * axios全局配置
*/ */
import axios from 'axios' import axios from 'axios'
import { Message } from 'element-ui'
axios.defaults.timeout = 30000 axios.defaults.timeout = 30000
// 默认配置 // 默认配置
@ -29,6 +30,9 @@ axios.interceptors.response.use(
(response) => { (response) => {
if (response.data) { if (response.data) {
if (response.data.code === 401) { if (response.data.code === 401) {
Message({ message: '当前登录状态已过期,请重新登录', type: 'error' })
localStorage.clear()
location.href = '/bigScrap/login/index'
} else if (response.data.code === 200) { } else if (response.data.code === 200) {
return Promise.resolve(response.data) return Promise.resolve(response.data)
} else { } else {

View File

@ -685,12 +685,12 @@ export default {
this.mapEcharts.on('click', function (params) { this.mapEcharts.on('click', function (params) {
if (params.data && params.data.a > 0) { if (params.data && params.data.a > 0) {
_this.$router.push({ _this.$router.push({
path: '/home-new', path: '/bigScrap/home-new',
query: { province: params.data.name, location: params.data.value }, query: { province: params.data.name, location: params.data.value },
}) })
} else if (params.region.count > 0) { } else if (params.region.count > 0) {
_this.$router.push({ _this.$router.push({
path: '/home-new', path: '/bigScrap/home-new',
query: { province: params.name, location: params.region.value }, query: { province: params.name, location: params.region.value },
}) })
} else { } else {

View File

@ -12,12 +12,12 @@ const Layout = () => import('@/views/layout')
const Home = () => import('@/views/Home/index') const Home = () => import('@/views/Home/index')
const Login = () => import('@/views/new-login/index.vue') const Login = () => import('@/views/new-login/index.vue')
const routes = [ const routes = [
// {
// path: '*',
// redirect: '/home-old',
// },
{ {
path: '*', path: '/bigScrap/login/index',
redirect: '/home-old',
},
{
path: '/login/index',
component: Login, component: Login,
name: 'Login', name: 'Login',
meta: { meta: {
@ -26,12 +26,12 @@ const routes = [
}, },
}, },
{ {
path: '/home-new', path: '/bigScrap/home-new',
name: 'home-new', name: 'home-new',
component: () => import('@/views/newHome/index.vue'), component: () => import('@/views/newHome/index.vue'),
}, },
{ {
path: '/home-old', path: '/bigScrap/home-old',
name: 'home-old', name: 'home-old',
component: () => import('@/views/oldHome/index.vue'), component: () => import('@/views/oldHome/index.vue'),
}, },
@ -83,7 +83,7 @@ const routes = [
const router = new Router({ const router = new Router({
mode: 'history', mode: 'history',
routes, routes,
base: '/bigScrap', // base: '/bigScrap',
}) })
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {

View File

@ -208,7 +208,7 @@ export default {
loginCodeApi(params).then((res) => { loginCodeApi(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
localStorage.setItem('token', res.data.access_token) localStorage.setItem('token', res.data.access_token)
this.$router.push('./Home/index') this.$router.push('/bigScrap/home-old')
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
} }

View File

@ -26,9 +26,9 @@ export default {
methods: { methods: {
openNewWindow() { openNewWindow() {
window.open( window.open(
`${ `${this.jumpUrl}/bigScrap/home-old?token=${localStorage.getItem(
this.jumpUrl 'token',
}/bigScrap/index01.html?token=${localStorage.getItem('token')}`, )}`,
'_blank', '_blank',
) )
}, },

View File

@ -12,20 +12,20 @@ export default {
props: { props: {
className: { className: {
type: String, type: String,
default: 'chart' default: 'chart',
}, },
width: { width: {
type: String, type: String,
default: '100%' default: '100%',
}, },
height: { height: {
type: String, type: String,
default: '300px' default: '300px',
} },
}, },
data() { data() {
return { return {
chart: null chart: null,
} }
}, },
mounted() { mounted() {
@ -47,12 +47,18 @@ export default {
this.chart.setOption({ this.chart.setOption({
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)' formatter: '{a} <br/>{b} : {c} ({d}%)',
}, },
legend: { legend: {
left: 'center', left: 'center',
bottom: '10', bottom: '10',
data: ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts'] data: [
'Industries',
'Technology',
'Forex',
'Gold',
'Forecasts',
],
}, },
series: [ series: [
{ {
@ -66,14 +72,14 @@ export default {
{ value: 240, name: 'Technology' }, { value: 240, name: 'Technology' },
{ value: 149, name: 'Forex' }, { value: 149, name: 'Forex' },
{ value: 100, name: 'Gold' }, { value: 100, name: 'Gold' },
{ value: 59, name: 'Forecasts' } { value: 59, name: 'Forecasts' },
], ],
animationEasing: 'cubicInOut', animationEasing: 'cubicInOut',
animationDuration: 2600 animationDuration: 2600,
} },
] ],
}) })
} },
} },
} }
</script> </script>

View File

@ -43,7 +43,7 @@ module.exports = {
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网 // target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`, // target: `https://z.csgmall.com.cn`,
target: `http://192.168.2.152:28080`, //超 target: `http://192.168.2.127:28080`, //超
// target: `http://10.40.92.81:28080`, //韩/ // target: `http://10.40.92.81:28080`, //韩/
// target: `http://192.168.2.82:28080`,//旭/ // target: `http://192.168.2.82:28080`,//旭/
// target: `http://192.168.2.248:28080`, //帅 // target: `http://192.168.2.248:28080`, //帅
@ -112,7 +112,7 @@ module.exports = {
}) })
.end() .end()
config.when(process.env.NODE_ENV !== 'development', config => { config.when(process.env.NODE_ENV !== 'development', (config) => {
config config
.plugin('ScriptExtHtmlWebpackPlugin') .plugin('ScriptExtHtmlWebpackPlugin')
.after('html') .after('html')