zhangtao
吕天方 1 year ago
parent 3f579b819d
commit 06eeff205e

@ -2,7 +2,7 @@
# @Author: 张涛 # @Author: 张涛
# @Date: 2023-07-18 13:04:50 # @Date: 2023-07-18 13:04:50
# @LastEditors: JC9527 # @LastEditors: JC9527
# @LastEditTime: 2023-10-11 10:38:17 # @LastEditTime: 2023-10-11 13:29:25
# @FilePath: \Mudu2PC\.env.development # @FilePath: \Mudu2PC\.env.development
### ###
# 页面标题 # 页面标题
@ -12,10 +12,11 @@ VUE_APP_TITLE = 苏州应急执法计划管理系统
ENV = 'development' ENV = 'development'
# 苏州应急执法计划管理系统/开发环境 # 苏州应急执法计划管理系统/开发环境
VUE_APP_BASE_API = 'http://39.101.188.84:9033' # VUE_APP_BASE_API = 'http://39.101.188.84:9033'
# VUE_APP_BASE_API = 'http://192.168.0.105:9033' # VUE_APP_BASE_API = 'http://192.168.0.105:9033'
# VUE_APP_BASE_API = 'http://180.108.205.123:13002' VUE_APP_BASE_API = 'http://180.108.205.123:13002'
# VUE_APP_BASE_API = '/api' # VUE_APP_BASE_API = '/api'
VUE_APP_LOCATION = 'http://2.46.4.197:8090'
# 路由懒加载 # 路由懒加载

@ -6,8 +6,10 @@ ENV = 'production'
# 苏州应急执法计划管理系统/生产环境 # 苏州应急执法计划管理系统/生产环境
# VUE_APP_BASE_API = 'http://192.168.0.105:9033' # VUE_APP_BASE_API = 'http://192.168.0.105:9033'
VUE_APP_BASE_API = 'http://39.101.188.84:9033' # VUE_APP_BASE_API = 'http://39.101.188.84:9033'
# VUE_APP_BASE_API = 'http://180.108.205.123:13002' VUE_APP_BASE_API = 'http://180.108.205.123:13002'
VUE_APP_LOCATION = 'http://2.46.4.197:8090'
# 路由懒加载 # 路由懒加载

@ -138,20 +138,20 @@ export default {
}) })
.then(() => { .then(() => {
this.$store.dispatch("LogOut").then(() => { this.$store.dispatch("LogOut").then(() => {
location.href = process.env.NODE_ENV === "production" // location.href = process.env.NODE_ENV === "production"
? "/demo/suzhouyingjiPC/" // ? "/demo/suzhouyingjiPC/"
: "/"; // : "/";
// let isGovernmentAffairsNetwork = localStorage.getItem('isGovernmentAffairsNetwork') let isGovernmentAffairsNetwork = localStorage.getItem('isGovernmentAffairsNetwork')
// if(process.env.NODE_ENV === "production") { if(process.env.NODE_ENV === "production") {
// if(isGovernmentAffairsNetwork == '1') { if(isGovernmentAffairsNetwork == '1') {
// location.href = 'http://180.108.205.123:8090/sso-server/oauth2/login?aid=17847210&cbu=http%3A%2F%2F180.108.205.123%3A13001%2F' location.href = process.env.VUE_APP_LOCATION + '/sso-server/oauth2/login?aid=17847210&cbu=http%3A%2F%2F180.108.205.123%3A13001%2F'
// } else { } else {
// location.href = "/" location.href = "/"
// } }
// } else { } else {
// location.href = "/" location.href = "/"
// } }
}); });
}) })
.catch(() => {}); .catch(() => {});

@ -112,21 +112,21 @@ export default {
}) })
.then(() => { .then(() => {
this.$store.dispatch("LogOut").then(() => { this.$store.dispatch("LogOut").then(() => {
location.href = process.env.NODE_ENV === "production" // location.href = process.env.NODE_ENV === "production"
? "/demo/suzhouyingjiPC/" // ? "/demo/suzhouyingjiPC/"
: "/"; // : "/";
// let isGovernmentAffairsNetwork = localStorage.getItem('isGovernmentAffairsNetwork') let isGovernmentAffairsNetwork = localStorage.getItem('isGovernmentAffairsNetwork')
// if(process.env.NODE_ENV === "production") { if(process.env.NODE_ENV === "production") {
// console.log('production') console.log('production')
// if(isGovernmentAffairsNetwork == '1') { if(isGovernmentAffairsNetwork == '1') {
// console.log('') console.log('进入跳转政务网的登录页')
// location.href = 'http://180.108.205.123:8090/sso-server/oauth2/login?aid=17847210&cbu=http%3A%2F%2F180.108.205.123%3A13001%2F' location.href = process.env.VUE_APP_LOCATION + '/sso-server/oauth2/login?aid=17847210&cbu=http%3A%2F%2F180.108.205.123%3A13001%2F'
// } else { } else {
// location.href = "/" location.href = "/"
// } }
// } else { } else {
// location.href = "/" location.href = "/"
// } }
}); });
}) })
.catch(() => {}); .catch(() => {});

@ -76,14 +76,21 @@ router.beforeEach((to, from, next) => {
} else { } else {
// 没有token // 没有token
if(window.location.href.includes('?code')){ if(window.location.href.includes('?code')){
// console.log(window.location.href)
var reg = new RegExp(/[?&]code=([^&#]+)/)
var r = window.location.href.match(reg)
// console.log('有code') // console.log('有code')
const code = window.location.href.split("?")[1].split('=')[1]; // const code = window.location.href.split("?")[1].split('=')[1];
const code = r && r[1]
// console.log(code)
getUseInfo({code:code}).then(user=>{ getUseInfo({code:code}).then(user=>{
console.log(user,'用户信息') console.log(user,'用户信息')
localStorage.setItem('isGovernmentAffairsNetwork','1') localStorage.setItem('isGovernmentAffairsNetwork','1')
store.dispatch('LoginNoCaptcha',{username:'admin',password:'admin@123Jichuang'}).then((res) => { store.dispatch('LoginNoCaptcha',{username:'admin',password:'admin@123Jichuang'}).then((res) => {
next('/home') next('/home')
}) })
}).catch(err=>{
location.href = process.env.VUE_APP_LOCATION + '/sso-server/oauth2/login?aid=17847210&cbu=http%3A%2F%2F180.108.205.123%3A13001%2F'
}) })
} else { } else {
// console.log('没code') // console.log('没code')
@ -97,7 +104,7 @@ router.beforeEach((to, from, next) => {
} else { } else {
console.log('路由拦截跳转登录页') console.log('路由拦截跳转登录页')
// next() // next()
location.href = 'http://180.108.205.123:8090/sso-server/oauth2/login?aid=17847210&cbu=http%3A%2F%2F180.108.205.123%3A13001%2F' location.href = process.env.VUE_APP_LOCATION + '/sso-server/oauth2/login?aid=17847210&cbu=http%3A%2F%2F180.108.205.123%3A13001%2F'
} }
NProgress.done() NProgress.done()
} }

@ -210,8 +210,8 @@ Router.prototype.replace = function push(location) {
}; };
export default new Router({ export default new Router({
// mode: "history", // 去掉url中的# mode: "history", // 去掉url中的#
// base: "/", base: "/",
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes, routes: constantRoutes,
}); });

@ -25,8 +25,8 @@ module.exports = {
// 部署生产环境和开发环境下的URL。 // 部署生产环境和开发环境下的URL。
// 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/demo/suzhouyingjiPC/" : "/", // publicPath: process.env.NODE_ENV === "production" ? "/demo/suzhouyingjiPC/" : "/",
// publicPath: process.env.NODE_ENV === "production" ? "/" : "/", publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
// 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist // 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist
outputDir: "dist", outputDir: "dist",
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)

Loading…
Cancel
Save