From 280cef7364677566c68b124b414a0ff782627002 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Sun, 18 Feb 2024 17:08:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 10 +- .env.production | 12 +- src/api/system/user.js | 5 +- src/api/user.js | 9 ++ src/permission.js | 12 ++ src/store/modules/user.js | 33 +++++- src/utils/createTable.js | 5 +- src/views/bigScreen1/component/doing.vue | 26 ++++- src/views/bigScreen1/component/done.vue | 129 ++++++++++++--------- src/views/order/component/dispatchList.vue | 19 ++- src/views/order/history.vue | 4 +- src/views/order/orderPlan.vue | 20 ++-- src/views/system/user.vue | 22 +++- 13 files changed, 211 insertions(+), 95 deletions(-) diff --git a/.env.development b/.env.development index badbb00..bbae003 100644 --- a/.env.development +++ b/.env.development @@ -2,6 +2,10 @@ ENV='development' # base api -VUE_APP_BASE_API=http://diaoling-test.ali251.langye.net/ -VUE_APP_UPLOAD_API=http://diaoling-test.ali251.langye.net/api/admin/upload-file -VUE_APP_OA_URL=http://suzhouhedaooa.langye.net +VUE_APP_BASE_API=http://192.168.60.78:9001/ +VUE_APP_UPLOAD_API=http://192.168.60.78:9001/api/admin/upload-file +VUE_APP_OA_URL=http://192.168.60.18:2021 + +#VUE_APP_BASE_API=http://diaoling-test.ali251.langye.net/ +#VUE_APP_UPLOAD_API=http://diaoling-test.ali251.langye.net/api/admin/upload-file +#VUE_APP_OA_URL=http://suzhouhedaooa.langye.net diff --git a/.env.production b/.env.production index 9d574b8..f9398d4 100644 --- a/.env.production +++ b/.env.production @@ -2,10 +2,10 @@ ENV = 'production' # base api -#VUE_APP_BASE_API=http://192.168.60.99:9005/ -#VUE_APP_UPLOAD_API=http://192.168.60.99:9005/api/admin/upload-file -#VUE_APP_OA_URL=http://192.168.60.18:2021 +VUE_APP_BASE_API=http://192.168.60.78:9001/ +VUE_APP_UPLOAD_API=http://192.168.60.78:9001/api/admin/upload-file +VUE_APP_OA_URL=http://192.168.60.18:2021 -VUE_APP_BASE_API=http://diaoling-test.ali251.langye.net/ -VUE_APP_UPLOAD_API=http://diaoling-test.ali251.langye.net/api/admin/upload-file -VUE_APP_OA_URL=http://suzhouhedaooa.langye.net +#VUE_APP_BASE_API=http://diaoling-test.ali251.langye.net/ +#VUE_APP_UPLOAD_API=http://diaoling-test.ali251.langye.net/api/admin/upload-file +#VUE_APP_OA_URL=http://suzhouhedaooa.langye.net diff --git a/src/api/system/user.js b/src/api/system/user.js index fea7326..2f78b61 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -8,10 +8,11 @@ export function save(data) { }) } -export function listuser() { +export function listuser(params) { return request({ url: '/api/admin/admin', - method: 'get' + method: 'get', + params }) } diff --git a/src/api/user.js b/src/api/user.js index 0a06fe7..f783b7b 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -26,6 +26,15 @@ export function logout(isLoading=false) { }) } +export function ossLogin(data) { + return request({ + url: '/api/admin/auth/oss-login', + method: 'post', + data, + isLoading: false, + }) +} + export function getAuthMenu(token,isLoading=false) { return request({ url: '/api/admin/auth/permissions', diff --git a/src/permission.js b/src/permission.js index c5e41fa..49474b1 100644 --- a/src/permission.js +++ b/src/permission.js @@ -58,7 +58,19 @@ router.beforeEach(async(to, from, next) => { } } else { /* has no token*/ + if (to.query.token && to.query.tp) { + try { + await store.dispatch('user/loginskip', { + token: to.query.token, + tp: to.query.tp + }) + next('/') + } catch (e) { + next('/login') + } + return + } if (whiteList.indexOf(to.path) !== -1) { // in the free login whitelist, go directly next() diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 5decf12..a8dddce 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,7 +1,8 @@ import { login, logout, - getInfo + getInfo, + ossLogin } from '@/api/user' import { getToken, @@ -42,6 +43,36 @@ const mutations = { } const actions = { + loginskip({ + commit + }, userInfo) { + const { + token, + tp, + loginId + } = userInfo + + return new Promise((resolve, reject) => { + ossLogin({ + token: token, + tp: tp, + loginId: loginId + }).then(response => { + + //console.log(response) + + const { + data + } = response; + console.log(response.access_token) + commit('SET_TOKEN', response.access_token) + setToken(response.access_token) + resolve() + }).catch(error => { + reject(error) + }) + }) + }, // user login login({ commit diff --git a/src/utils/createTable.js b/src/utils/createTable.js index ed6eb09..44dcf7e 100644 --- a/src/utils/createTable.js +++ b/src/utils/createTable.js @@ -1,8 +1,7 @@ import { show } from "@/api/system/customForm"; -import { listdept } from "@/api/system/department"; import { getparameter } from "@/api/system/dictionary"; import { index as baseFormIndex } from "@/api/system/baseForm"; - +import { listCommondepartment } from "@/api/common"; export async function resolveFormInfo(customFormId,filterType = 'table') { const res = await show({ id: customFormId }, false); @@ -12,7 +11,7 @@ export async function resolveFormInfo(customFormId,filterType = 'table') { [ "departments", async () => { - const res = await listdept(); + const res = await listCommondepartment(); return res; }, ], diff --git a/src/views/bigScreen1/component/doing.vue b/src/views/bigScreen1/component/doing.vue index 4d699c9..a6d09a4 100644 --- a/src/views/bigScreen1/component/doing.vue +++ b/src/views/bigScreen1/component/doing.vue @@ -35,6 +35,11 @@
已完成
@@ -12,44 +12,54 @@