no message

This commit is contained in:
DESKTOP-369JRHT\12997 2024-07-12 17:30:15 +08:00
parent 1669c9150e
commit 33a7490e9b
10 changed files with 68 additions and 16 deletions

View File

@ -106,6 +106,7 @@ import ScreenData from '@/components/ScreenData'
import {getCountdownApi} from "@/api/store";
import {ljStoreInfo} from "@/api/staff/store";
import screenfull from "screenfull";
import {getToken} from "@/utils/auth";
export default {
data() {
@ -160,7 +161,7 @@ export default {
},
goToWebsite() {
// window.open('https://cashier.youkerr.com/')
window.open(this.cashierUrl)
window.open(this.cashierUrl+"?token="+getToken())
this.toggleFullscreen()
},
toggleFullscreen() {

View File

@ -28,9 +28,14 @@ router.beforeEach(async (to, from, next) => {
}
}
if (to.path === '/resource_oilstore') {
if (Cookies.get("IS_BK_LOGIN")) {
setToken(JSON.parse(Cookies.get("IS_BK_LOGIN")).token);
}
// if (Cookies.get("IS_BK_LOGIN")) {
// setToken(JSON.parse(Cookies.get("IS_BK_LOGIN")).token);
// }
const urlParams = new URLSearchParams(window.location.search);
const data = urlParams.get('token');
console.log(data); // 输出: "value"
setToken(data);
}
if (getToken()) {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)

View File

@ -58,15 +58,27 @@ const user = {
// dutyRoleCode
Cookies.remove('DUTY_ROLE_CODE');
// sessionStorage.removeItem('DUTY_ROLE_CODE');
Cookies.set("DUTY_ROLE_CODE", res.data.dutyRoleCode);
// sessionStorage.setItem("DUTY_ROLE_CODE", res.data.dutyRoleCode);
//
// sessionStorage.removeItem('IS_BK_LOGIN');
if (res.data.ownerId == "3") {
setToken(res.data.token)
commit('SET_TOKEN', res.data.token)
Cookies.remove('IS_ZT_LOGIN');
// sessionStorage.removeItem('IS_ZT_LOGIN');
}else {
// Cookies.set("IS_ZT_LOGIN", JSON.stringify(res.data));
Cookies.set("IS_ZT_LOGIN", JSON.stringify(res.data));
console.log("IS_ZT_LOGIN", Cookies.get("IS_ZT_LOGIN"))
// sessionStorage.setItem("IS_ZT_LOGIN", JSON.stringify(res.data));
// sessionStorage.getItem('IS_ZT_LOGIN')
// console.log("sessionStorage.getItem('IS_BK_LOGIN')",sessionStorage.getItem('IS_ZT_LOGIN'))
}
resolve()
}).catch(error => {

View File

@ -282,11 +282,13 @@ export default {
// Cookies.set("DUTY_ROLE_CODE", res.data.dutyRoleCode);
if (Cookies.get("DUTY_ROLE_CODE") && Cookies.get("DUTY_ROLE_CODE") == 2) {
console.log("123")
location.replace(this.cashierUrl);
// if (sessionStorage.getItem('IS_ZT_LOGIN')&& sessionStorage.getItem('IS_ZT_LOGIN') == 2) {
location.replace(this.cashierUrl);
}else {
if (Cookies.get("IS_ZT_LOGIN")) {
location.replace(this.ztUrl+"resource_oilbank");
const data = JSON.parse(Cookies.get("IS_ZT_LOGIN"))
console.log("dataJSON",data)
location.replace(this.ztUrl+"resource_oilbank?token="+data.token);
}else {
app.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}

View File

@ -9,7 +9,8 @@ const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '百业兴智慧油站系统' // 网页标题
const port = process.env.port || process.env.npm_config_port || 81 // 端口
const port = 81 // 端口
// const port = process.env.port || process.env.npm_config_port || 81 // 端口
const serverUrl = process.env.VUE_APP_SERVER_URL || 'https://www.fuint.cn'

View File

@ -15,7 +15,20 @@ const whiteList = ['/login', '/auth-redirect']
router.beforeEach((to, from, next) => {
NProgress.start()
if (to.path === '/resource_oilbank') {
setToken(JSON.parse(Cookies.get("IS_ZT_LOGIN")).token);
console.log("111111111111111111111")
const urlParams = new URLSearchParams(window.location.search);
const data = urlParams.get('token');
console.log(data); // 输出: "value"
// if (Cookies.get("IS_ZT_LOGIN") && JSON.parse(Cookies.get("IS_ZT_LOGIN"))) {
// setToken(JSON.parse(Cookies.get("IS_ZT_LOGIN")).token);
// console.log("IS_ZT_LOGIN",sessionStorage.getItem('IS_ZT_LOGIN'));
// sessionStorage.getItem('IS_ZT_LOGIN')
// sessionStorage.getItem('IS_ZT_LOGIN')
// console.log("IS_ZT_LOGIN",JSON.parse(sessionStorage.getItem('IS_ZT_LOGIN')).token)
setToken(data);
//
// }
}
if (getToken()) {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)

View File

@ -60,9 +60,14 @@ const user = {
if (res.data.ownerId !== "3") {
setToken(res.data.token)
commit('SET_TOKEN', res.data.token)
Cookies.remove('IS_BK_LOGIN');
// Cookies.remove('IS_BK_LOGIN');
sessionStorage.removeItem('IS_BK_LOGIN');
}else {
Cookies.set("IS_BK_LOGIN", JSON.stringify(res.data));
// Cookies.set("IS_BK_LOGIN", JSON.stringify(res.data));
sessionStorage.setItem("IS_BK_LOGIN", JSON.stringify(res.data));
const storedValue = sessionStorage.getItem('IS_BK_LOGIN');
console.log(storedValue); // 输出: "value"
}

View File

@ -281,11 +281,12 @@ export default {
}
app.$store.dispatch("Login", this.loginForm).then(() => {
if (Cookies.get("IS_BK_LOGIN")) {
location.replace(this.bkUrl+"resource_oilstore");
if (sessionStorage.getItem('IS_BK_LOGIN')) {
const data = JSON.parse(Cookies.get("IS_BK_LOGIN"))
console.log("dataJSON",data)
location.replace(this.bkUrl+"resource_oilstore?token="+data.token);
}else {
// app.$router.push({ path: "/Service/index" }).catch(()=>{});
app.$router.push({ path: "/Service/index" }).catch(()=>{});
}
app.$router.push({ path: this.redirect || "/" }).catch(()=>{});

View File

@ -9,7 +9,8 @@ const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '百业兴智慧油站系统' // 网页标题
const port = process.env.port || process.env.npm_config_port || 81 // 端口
// const port = process.env.port || process.env.npm_config_port || 81 // 端口
const port = 82 // 端口
const serverUrl = process.env.VUE_APP_SERVER_URL || 'https://www.fuint.cn'

View File

@ -12,6 +12,17 @@ const whiteList = ['/login', '/auth-redirect']
router.beforeEach((to, from, next) => {
NProgress.start()
const urlParams = new URLSearchParams(window.location.search);
const data = urlParams.get('token');
console.log(data); // 输出: "value"
if(data) {
console.log(data); // 输出: "value"
setToken(data);
}
if (getToken()) {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/