zhaoke 1 жил өмнө
parent
commit
b1089e6ce4

+ 21 - 1
src/api/apiAuthority.ts

@@ -7,9 +7,10 @@
  * @FilePath: \Foshan4A2.0\src\api\apiAuthority.js
  */
 import request from '@/utils/axiosReq'
-
+import { getToken } from '@/utils/auth'
 //权限树查询
 export function GetAuthTree(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/GetAuthTree/v1',
     method: 'post',
@@ -19,6 +20,7 @@ export function GetAuthTree(params) {
 
 //应用新增保存
 export function SaveApp(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/SaveApp/v1',
     method: 'post',
@@ -28,6 +30,7 @@ export function SaveApp(params) {
 
 //应用详情查询
 export function GetAppDetails(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/GetAppDetails/v1',
     method: 'post',
@@ -37,6 +40,7 @@ export function GetAppDetails(params) {
 
 //应用修改保存
 export function EditApp(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/EditApp/v1',
     method: 'post',
@@ -46,6 +50,7 @@ export function EditApp(params) {
 
 //应用状态变更
 export function UpdateAppStatus(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/UpdateAppStatus/v1',
     method: 'post',
@@ -55,6 +60,7 @@ export function UpdateAppStatus(params) {
 
 //应用删除
 export function DeleteApp(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/DeleteApp/v1',
     method: 'post',
@@ -64,6 +70,7 @@ export function DeleteApp(params) {
 
 //权限项修改保存
 export function EditAuth(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/EditAuth/v1',
     method: 'post',
@@ -73,6 +80,7 @@ export function EditAuth(params) {
 
 //权限详情查询
 export function GetAuthDetails(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/GetAuthDetails/v1',
     method: 'post',
@@ -82,6 +90,7 @@ export function GetAuthDetails(params) {
 
 //根据权限获取授权规则
 export function GetAuthTo(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/GetAuthTo/v1',
     method: 'post',
@@ -91,6 +100,7 @@ export function GetAuthTo(params) {
 
 //权限项新增保存
 export function SaveAuth(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/SaveAuth/v1',
     method: 'post',
@@ -100,6 +110,7 @@ export function SaveAuth(params) {
 
 //权限项删除
 export function DeleteAuth(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/DeleteAuth/v1',
     method: 'post',
@@ -109,6 +120,7 @@ export function DeleteAuth(params) {
 
 //权限状态变更
 export function UpdateAuthStatus(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/UpdateAuthStatus/v1',
     method: 'post',
@@ -118,6 +130,7 @@ export function UpdateAuthStatus(params) {
 
 //角色新增保存
 export function SaveRole(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/SaveRole/v1',
     method: 'post',
@@ -127,6 +140,7 @@ export function SaveRole(params) {
 
 //角色列表查询
 export function QueryRole(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/QueryRole/v1',
     method: 'post',
@@ -136,6 +150,7 @@ export function QueryRole(params) {
 
 //账号列表查询
 export function GetUserList(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/GetUserList/v1',
     method: 'post',
@@ -145,6 +160,7 @@ export function GetUserList(params) {
 
 //角色明细查询
 export function RoleDetails(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/RoleDetails/v1',
     method: 'post',
@@ -154,6 +170,7 @@ export function RoleDetails(params) {
 
 //角色权限列表
 export function RoleAuths(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/RoleAuths/v1',
     method: 'post',
@@ -163,6 +180,7 @@ export function RoleAuths(params) {
 
 //角色删除
 export function DeleteRole(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/DeleteRole/v1',
     method: 'post',
@@ -172,6 +190,7 @@ export function DeleteRole(params) {
 
 //角色编辑保存
 export function EditRole(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/EditRole/v1',
     method: 'post',
@@ -181,6 +200,7 @@ export function EditRole(params) {
 
 //角色状态变更
 export function UpdateStatus(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/api/fs4a/UpdateStatus/v1',
     method: 'post',

+ 8 - 1
src/api/dataIntegration.ts

@@ -9,8 +9,10 @@
 
 import request from '@/utils/axiosReq'
 import { ElMessage } from 'element-plus'
+import { getToken } from '@/utils/auth'
 
 export function GeneralDataReception(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/openApi/generalDataReception',
     method: 'post',
@@ -22,6 +24,7 @@ export function GeneralDataReception(params) {
 }
 
 export function Query(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   if (NEW_DATACONTENT_ID.includes(params.id)) {
     return NewQuery(params)
   }
@@ -36,6 +39,7 @@ export function Query(params) {
 }
 
 function NewQuery(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/newOpenApi/search',
     method: 'post',
@@ -48,6 +52,7 @@ function NewQuery(params) {
 
 //服务管理-启动
 export function Start(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/openApi/start',
     method: 'post',
@@ -60,6 +65,7 @@ export function Start(params) {
 
 //服务管理-停止
 export function Stop(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/openApi/stop',
     method: 'post',
@@ -74,6 +80,7 @@ export async function myQuery(id, ...dataContent) {
   const params = {
     id,
     dataContent,
+    userid: getToken('userid') || null,
   }
   try {
     const result = await Query(params)
@@ -86,4 +93,4 @@ export async function myQuery(id, ...dataContent) {
   } catch (error) {
     return Promise.reject(error)
   }
-}
+}

+ 6 - 4
src/api/user.ts

@@ -1,5 +1,6 @@
 import request from '@/utils/axiosReq'
 import { ObjTy } from '~/common'
+import { getToken } from '@/utils/auth'
 
 export function loginReq(data: ObjTy) {
   return request({
@@ -8,7 +9,7 @@ export function loginReq(data: ObjTy) {
     method: 'post',
     bfLoading: false,
     isParams: true,
-    isAlertErrorMsg: false
+    isAlertErrorMsg: false,
   })
 }
 
@@ -17,21 +18,22 @@ export function getInfoReq() {
     url: '/integration-front/user/getUserInfo',
     bfLoading: false,
     method: 'post',
-    isAlertErrorMsg: false
+    isAlertErrorMsg: false,
   })
 }
 
 export function logoutReq() {
   return request({
     url: '/integration-front/user/loginOut',
-    method: 'post'
+    method: 'post',
   })
 }
 
 export function Query(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/openApi/query',
     method: 'post',
-    data: params
+    data: params,
   })
 }

+ 7 - 0
src/api/webApi.ts

@@ -1,7 +1,9 @@
 import request from '@/utils/axiosReq'
 import { CommonQueryResult } from '~/common'
+import { getToken } from '@/utils/auth'
 
 export function Query<T = any>(params): Promise<CommonQueryResult<T>> {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   if (NEW_DATACONTENT_ID.includes(params.id)) {
     return NewQuery<T>(params)
   }
@@ -117,6 +119,7 @@ export async function dataToChange(
       serviceId: id,
       dataContent: formatChange(data, event, key),
       event: `${event}`,
+      userid: getToken('userid') || null,
       // authId: this.AauthId
     }
     const { code, message } = await sendData(params)
@@ -127,6 +130,7 @@ export async function dataToChange(
 }
 
 function sendData(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/externalApi/openApi/sendData',
     method: 'post',
@@ -136,6 +140,7 @@ function sendData(params) {
 
 //新增
 export function newData(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/externalApi/openApi/sendData',
     method: 'post',
@@ -145,6 +150,7 @@ export function newData(params) {
 
 //修改
 export function modifyData(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/externalApi/openApi/sendData',
     method: 'post',
@@ -154,6 +160,7 @@ export function modifyData(params) {
 
 //删除movedata
 export function moveData(params) {
+  params = Object.assign(params, { userid: getToken('userid') || null })
   return request({
     url: '/externalApi/openApi/sendData',
     method: 'post',