From 087ce92cbfab29a1b0fcab71d2a1c27922835f1d Mon Sep 17 00:00:00 2001 From: wangh <9483> Date: Fri, 22 Dec 2023 15:33:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E5=8F=B0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fuintAdmin/src/api/login.js | 10 + fuintAdmin/src/permission.js | 28 +- fuintAdmin/src/router/index.js | 21 +- fuintAdmin/src/store/modules/user.js | 7 +- fuintAdmin/src/utils/auth.js | 2 +- .../src/views/indexcomponents/bottomindex.vue | 33 +- .../views/indexcomponents/centenrindex.vue | 35 +- fuintAdmin/src/views/integral/gift/index.vue | 52 +- fuintAdmin_zt/package.json | 1 + .../src/api/payConfig/merchantconfig.js | 18 + fuintAdmin_zt/src/api/payConfig/oilconfig.js | 52 ++ fuintAdmin_zt/src/api/service/service.js | 29 + fuintAdmin_zt/src/api/staff/user/user.js | 78 +++ fuintAdmin_zt/src/api/system/Site/site.js | 18 +- fuintAdmin_zt/src/permission.js | 10 +- fuintAdmin_zt/src/store/index.js | 4 +- fuintAdmin_zt/src/store/modules/token.js | 29 + fuintAdmin_zt/src/utils/auth.js | 53 +- fuintAdmin_zt/src/views/Service/details.vue | 11 +- fuintAdmin_zt/src/views/Service/index.vue | 44 +- fuintAdmin_zt/src/views/Site/index.vue | 202 +++++-- .../src/views/components/Service/index.vue | 498 +++++++++++++++++- .../src/views/components/Service/payment.vue | 430 +++++++++++++++ .../order/mapper/xml/OilOrderMapper.xml | 2 +- .../controller/BackendStoreController.java | 38 ++ .../fuint/business/store/entity/MtStore.java | 4 + .../business/store/mapper/MtStoreMapper.java | 3 + .../store/mapper/xml/ExportExcelService.xml | 14 + .../business/store/service/StoreService.java | 4 + .../store/service/impl/StoreServiceImpl.java | 107 ++++ .../com/fuint/common/config/WebConfig.java | 1 + .../java/com/fuint/common/dto/RoleDto.java | 12 + .../java/com/fuint/common/dto/StoreDto.java | 26 + .../fuint/common/service/AccountService.java | 2 +- .../service/impl/AccountServiceImpl.java | 12 +- .../fuint/common/shiroConfig/ShiroConfig.java | 1 + .../controller/BackendDutyController.java | 1 + .../com/fuint/system/role/entity/TDuty.java | 3 + .../controller/BackendAccountController.java | 53 +- .../main/resources/mapper/TAccountMapper.xml | 4 + 40 files changed, 1783 insertions(+), 169 deletions(-) create mode 100644 fuintAdmin_zt/src/api/payConfig/merchantconfig.js create mode 100644 fuintAdmin_zt/src/api/payConfig/oilconfig.js create mode 100644 fuintAdmin_zt/src/api/staff/user/user.js create mode 100644 fuintAdmin_zt/src/store/modules/token.js create mode 100644 fuintAdmin_zt/src/views/components/Service/payment.vue diff --git a/fuintAdmin/src/api/login.js b/fuintAdmin/src/api/login.js index 3809ffe2c..06b263893 100644 --- a/fuintAdmin/src/api/login.js +++ b/fuintAdmin/src/api/login.js @@ -60,3 +60,13 @@ export function getCodeImg() { method: 'get' }) } + + +// 单点登录 +export function loginVerificationApi(data) { + return request({ + url: 'backendApi/store/loginVerification', + method: 'post', + data:data + }) +} diff --git a/fuintAdmin/src/permission.js b/fuintAdmin/src/permission.js index 0e2cc4107..924ff0389 100644 --- a/fuintAdmin/src/permission.js +++ b/fuintAdmin/src/permission.js @@ -3,28 +3,50 @@ import store from './store' import { Message } from 'element-ui' import NProgress from 'nprogress' import 'nprogress/nprogress.css' -import { getToken } from '@/utils/auth' +import {getToken, removeToken, setToken} from '@/utils/auth' import { isRelogin } from '@/utils/request' +import { loginVerificationApi } from '@/api/login' +// import BigNumber from 'bignumber.js'; NProgress.configure({ showSpinner: false }) const whiteList = ['/login', '/auth-redirect'] -router.beforeEach((to, from, next) => { +router.beforeEach(async (to, from, next) => { NProgress.start() + console.log(to,from,next) + if (to.query.entrance) { + try { + const res = await loginVerificationApi(to.query.entrance); + if (res.data.token) { + setToken(res.data.token); + to.meta.title = "系统首页"; + } + } catch (error) { + console.error("An error occurred:", error); + } + } if (getToken()) { to.meta.title && store.dispatch('settings/setTitle', to.meta.title) /* has token*/ if (to.path === '/login') { + next({ path: '/' }) NProgress.done() - } else { + }else { + console.log("111113",store.getters.roles) + if (store.getters.roles.length === 0) { + console.log("111114") isRelogin.show = true // 判断当前用户是否已拉取完user_info信息 store.dispatch('GetInfo').then(() => { + console.log("111116") + isRelogin.show = false store.dispatch('GenerateRoutes').then(accessRoutes => { + console.log("111117") + // 根据roles权限生成可访问的路由表 router.addRoutes(accessRoutes) // 动态添加可访问路由表 next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 diff --git a/fuintAdmin/src/router/index.js b/fuintAdmin/src/router/index.js index 3fbc1454c..3a28994ea 100644 --- a/fuintAdmin/src/router/index.js +++ b/fuintAdmin/src/router/index.js @@ -46,6 +46,11 @@ export const constantRoutes = [ component: () => import('@/views/login'), hidden: true }, + // { + // path: '/jumpInTheMiddleOffice', + // component: () => import('@/views/index'), + // hidden: true + // }, { path: '/404', component: () => import('@/views/error/404'), @@ -56,6 +61,20 @@ export const constantRoutes = [ component: () => import('@/views/error/401'), hidden: true }, + // { + // path: '/jumpInTheMiddleOffice', + // component: Layout, + // redirect: 'index', + // children: [ + // { + // path: 'index', + // component: () => import('@/views/index'), + // name: 'Index', + // meta: { title: '系统首页', icon: 'dashboard', affix: true } + // } + // ] + // }, + { path: '', component: Layout, @@ -201,7 +220,7 @@ Router.prototype.push = function push(location) { } export default new Router({ - // mode: 'history', // 去掉url中的# + mode: 'history', // 去掉url中的# scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) diff --git a/fuintAdmin/src/store/modules/user.js b/fuintAdmin/src/store/modules/user.js index 17f870a49..42da8d47c 100644 --- a/fuintAdmin/src/store/modules/user.js +++ b/fuintAdmin/src/store/modules/user.js @@ -81,6 +81,8 @@ const user = { GetInfo({ commit, state }) { return new Promise((resolve, reject) => { getInfo().then(res => { + console.log("22222223") + const user = res.data.accountInfo const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/avatar.png") : process.env.VUE_APP_BASE_API + user.avatar; if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 @@ -96,9 +98,10 @@ const user = { commit('SET_STORE_ID', user.storeId) commit('SET_STORE_NAME', user.storeName) resolve(res) - }).catch(error => { - reject(error) }) + // .catch(error => { + // reject(error) + // }) }) }, diff --git a/fuintAdmin/src/utils/auth.js b/fuintAdmin/src/utils/auth.js index 4fb70fabb..85aef825b 100644 --- a/fuintAdmin/src/utils/auth.js +++ b/fuintAdmin/src/utils/auth.js @@ -11,7 +11,7 @@ export function setToken(token) { return Cookies.set(TokenKey, token) } -export function removeToken() { + export function removeToken() { return Cookies.remove(TokenKey) } diff --git a/fuintAdmin/src/views/indexcomponents/bottomindex.vue b/fuintAdmin/src/views/indexcomponents/bottomindex.vue index 500609672..831619c25 100644 --- a/fuintAdmin/src/views/indexcomponents/bottomindex.vue +++ b/fuintAdmin/src/views/indexcomponents/bottomindex.vue @@ -76,7 +76,7 @@ export default { this.getMerchandiseSales() this.getPrepaidCardSales() // this.getTunFuelCardSales() - + }, methods:{ @@ -91,17 +91,22 @@ export default { this.goodsSum = 0 let dataList = res.data if (this.goodsRadio === '7天' && dataList.length >= 7) { - dataList = dataList.slice(0, 7); + // dataList = dataList.slice(0, 7); + dataList = dataList.slice(-7); } else if (this.goodsRadio === '15天' && dataList.length >= 15) { - dataList = dataList.slice(0, 15); + // dataList = dataList.slice(0, 15); + dataList = dataList.slice(-15); } else if (this.goodsRadio === '30天' && dataList.length >= 30) { - dataList = dataList.slice(0, 30); + // dataList = dataList.slice(0, 30); + dataList = dataList.slice(-30); } dataList.forEach(element => { this.goodsTimeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}')); this.goodsDate.push(element.total_sales); this.goodsSum+=element.total_sales + this.goodsSum = parseFloat(this.goodsSum.toFixed(2)); + }); this.initChart() this.goodsLoading = false @@ -120,17 +125,22 @@ export default { this.cardSum = 0 let dataList = res.data if (this.cardRadio === '7天' && dataList.length >= 7) { - dataList = dataList.slice(0, 7); + dataList = dataList.slice(-7); + // dataList = dataList.slice(0, 7); } else if (this.cardRadio === '15天' && dataList.length >= 15) { - dataList = dataList.slice(0, 15); + dataList = dataList.slice(-15); + // dataList = dataList.slice(0, 15); } else if (this.cardRadio === '30天' && dataList.length >= 30) { - dataList = dataList.slice(0, 30); + dataList = dataList.slice(-30); + // dataList = dataList.slice(0, 30); } dataList.forEach(element => { this.cardTimeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}')); this.cardDate.push(element.total_sales); this.cardSum+=element.total_sales + this.cardSum = parseFloat(this.cardSum.toFixed(2)); + }); this.getTunFuelCardSales() // this.changeLabel(); @@ -146,11 +156,14 @@ export default { // this.cardSum = 0 let dataList = res.data if (this.cardRadio === '7天' && dataList.length >= 7) { - dataList = dataList.slice(0, 7); + // dataList = dataList.slice(0, 7); + dataList = dataList.slice(- 7); } else if (this.cardRadio === '15天' && dataList.length >= 15) { - dataList = dataList.slice(0, 15); + // dataList = dataList.slice(0, 15); + dataList = dataList.slice(-15); } else if (this.cardRadio === '30天' && dataList.length >= 30) { - dataList = dataList.slice(0, 30); + // dataList = dataList.slice(0, 30); + dataList = dataList.slice(- 30); } dataList.forEach(element => { diff --git a/fuintAdmin/src/views/indexcomponents/centenrindex.vue b/fuintAdmin/src/views/indexcomponents/centenrindex.vue index 7047df839..fa08e0930 100644 --- a/fuintAdmin/src/views/indexcomponents/centenrindex.vue +++ b/fuintAdmin/src/views/indexcomponents/centenrindex.vue @@ -46,7 +46,7 @@
{{item.totalSum}}
- + @@ -92,17 +92,25 @@ export default { this.sum = 0 let dataList = res.data if (this.radio === '7天' && dataList.length >= 7) { - dataList = dataList.slice(0, 7); + // dataList = dataList.slice(0, 7); + dataList = dataList.slice(-7); + } else if (this.radio === '15天' && dataList.length >= 15) { - dataList = dataList.slice(0, 15); + // dataList = dataList.slice(0, 15); + dataList = dataList.slice(-15); + } else if (this.radio === '30天' && dataList.length >= 30) { - dataList = dataList.slice(0, 30); + // dataList = dataList.slice(0, 30); + dataList = dataList.slice(-30); + } dataList.forEach(element => { this.timeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}')); this.oilDate.push(element.total_sales); this.sum+=element.total_sales + this.sum = parseFloat(this.sum.toFixed(2)); + }); this.initChart() // this.changeLabel(); @@ -130,14 +138,21 @@ export default { changeLabel() { if (this.radio === '7天' && this.timeDate.length >= 7) { - this.timeDate = this.timeDate.slice(0, 7); - this.oilDate = this.oilDate.slice(0, 7); + // this.timeDate = this.timeDate.slice(0, 7); + // this.oilDate = this.oilDate.slice(0, 7); + + this.timeDate = this.timeDate.slice(-7); + this.oilDate = this.oilDate.slice(-7); } else if (this.radio === '15天' && this.timeDate.length >= 15) { - this.timeDate = this.timeDate.slice(0, 15); - this.oilDate = this.oilDate.slice(0, 15); + // this.timeDate = this.timeDate.slice(0, 15); + // this.oilDate = this.oilDate.slice(0, 15); + this.timeDate = this.timeDate.slice(-15); + this.oilDate = this.oilDate.slice(-15); } else if (this.radio === '30天' && this.timeDate.length >= 30) { - this.timeDate = this.timeDate.slice(0, 30); - this.oilDate = this.oilDate.slice(0, 30); + // this.timeDate = this.timeDate.slice(0, 30); + // this.oilDate = this.oilDate.slice(0, 30); + this.timeDate = this.timeDate.slice(-30); + this.oilDate = this.oilDate.slice(-30); } this.initChart() }, diff --git a/fuintAdmin/src/views/integral/gift/index.vue b/fuintAdmin/src/views/integral/gift/index.vue index e0c238140..7f0f7eff4 100644 --- a/fuintAdmin/src/views/integral/gift/index.vue +++ b/fuintAdmin/src/views/integral/gift/index.vue @@ -1,6 +1,6 @@