From 8af873e25abb7bca89693618d6ae32ebb2cf093e Mon Sep 17 00:00:00 2001 From: ky_sunl Date: Sun, 25 Apr 2021 03:29:40 +0000 Subject: [PATCH] --- Api/Dilon.Core/Entity/SysUserDataScope.cs | 2 +- Web/src/common/api/index.js | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Api/Dilon.Core/Entity/SysUserDataScope.cs b/Api/Dilon.Core/Entity/SysUserDataScope.cs index 41acc80..8e6b1a6 100644 --- a/Api/Dilon.Core/Entity/SysUserDataScope.cs +++ b/Api/Dilon.Core/Entity/SysUserDataScope.cs @@ -27,7 +27,7 @@ namespace Dilon.Core /// 机构Id /// [Comment("机构Id")] - [Column("SysUserId", TypeName = "varchar(36)")] + [Column("SysOrgId", TypeName = "varchar(36)")] public string SysOrgId { get; set; } /// diff --git a/Web/src/common/api/index.js b/Web/src/common/api/index.js index a84bd28..602411a 100644 --- a/Web/src/common/api/index.js +++ b/Web/src/common/api/index.js @@ -6,6 +6,7 @@ import axios from 'axios' import { token } from '@/common/token' import status from './status' +const STATUS = status import app from '@/main' axios.defaults.baseURL = '/api' @@ -28,7 +29,7 @@ const initInstance = (options) => { }) instance.interceptors.response.use((res) => { - if (res.data.status === status.Unauthorized) { + if (res.data.status === STATUS.Unauthorized) { handlerUnauthorized() } return res @@ -38,7 +39,7 @@ const initInstance = (options) => { return instance } -const errerCodes = [status.BadRequest, status.InternalServerError, status.Forbidden] +const errerCodes = [STATUS.BadRequest, STATUS.InternalServerError, STATUS.Forbidden] const errorNotification = ({ code, message }) => { switch (message.constructor) { @@ -111,7 +112,7 @@ for (let key in urls) { if (errerCodes.indexOf(data.code) >= 0) { errorNotification(data) reject([ArrayBuffer, Blob].indexOf(data.constructor) > -1 ? res : data) - } else if (data.code === status.Unauthorized) { + } else if (data.code === STATUS.Unauthorized) { handlerUnauthorized() } else { reslove([ArrayBuffer, Blob].indexOf(data.constructor) > -1 ? res : data) @@ -128,10 +129,10 @@ for (let key in urls) { } else { errorNotification(data) } - reject(data) - if (data.code === status.Unauthorized) { + if (data.code === STATUS.Unauthorized) { handlerUnauthorized() } + reject(data) } else { errorNotification({ message: '系统发生错误,请联系管理员' @@ -160,5 +161,5 @@ api.$queue = function (queue) { export { axios, api, - status + STATUS }