This commit is contained in:
ky_sunl
2021-04-25 03:29:40 +00:00
parent 57047b221e
commit 8af873e25a
2 changed files with 8 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ namespace Dilon.Core
/// 机构Id /// 机构Id
/// </summary> /// </summary>
[Comment("机构Id")] [Comment("机构Id")]
[Column("SysUserId", TypeName = "varchar(36)")] [Column("SysOrgId", TypeName = "varchar(36)")]
public string SysOrgId { get; set; } public string SysOrgId { get; set; }
/// <summary> /// <summary>

View File

@@ -6,6 +6,7 @@
import axios from 'axios' import axios from 'axios'
import { token } from '@/common/token' import { token } from '@/common/token'
import status from './status' import status from './status'
const STATUS = status
import app from '@/main' import app from '@/main'
axios.defaults.baseURL = '/api' axios.defaults.baseURL = '/api'
@@ -28,7 +29,7 @@ const initInstance = (options) => {
}) })
instance.interceptors.response.use((res) => { instance.interceptors.response.use((res) => {
if (res.data.status === status.Unauthorized) { if (res.data.status === STATUS.Unauthorized) {
handlerUnauthorized() handlerUnauthorized()
} }
return res return res
@@ -38,7 +39,7 @@ const initInstance = (options) => {
return instance return instance
} }
const errerCodes = [status.BadRequest, status.InternalServerError, status.Forbidden] const errerCodes = [STATUS.BadRequest, STATUS.InternalServerError, STATUS.Forbidden]
const errorNotification = ({ code, message }) => { const errorNotification = ({ code, message }) => {
switch (message.constructor) { switch (message.constructor) {
@@ -111,7 +112,7 @@ for (let key in urls) {
if (errerCodes.indexOf(data.code) >= 0) { if (errerCodes.indexOf(data.code) >= 0) {
errorNotification(data) errorNotification(data)
reject([ArrayBuffer, Blob].indexOf(data.constructor) > -1 ? res : data) reject([ArrayBuffer, Blob].indexOf(data.constructor) > -1 ? res : data)
} else if (data.code === status.Unauthorized) { } else if (data.code === STATUS.Unauthorized) {
handlerUnauthorized() handlerUnauthorized()
} else { } else {
reslove([ArrayBuffer, Blob].indexOf(data.constructor) > -1 ? res : data) reslove([ArrayBuffer, Blob].indexOf(data.constructor) > -1 ? res : data)
@@ -128,10 +129,10 @@ for (let key in urls) {
} else { } else {
errorNotification(data) errorNotification(data)
} }
reject(data) if (data.code === STATUS.Unauthorized) {
if (data.code === status.Unauthorized) {
handlerUnauthorized() handlerUnauthorized()
} }
reject(data)
} else { } else {
errorNotification({ errorNotification({
message: '系统发生错误,请联系管理员' message: '系统发生错误,请联系管理员'
@@ -160,5 +161,5 @@ api.$queue = function (queue) {
export { export {
axios, axios,
api, api,
status STATUS
} }