• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

Network Requests:Detailed Explanation of OioProvider (Custom Request Error Interception)


Ⅰ、OioProvider

OioProvider serves as the initialization entry point of the platform.

(Ⅰ) Example Entry main.ts

import { VueOioProvider } from '@oinone/kunlun-dependencies';

VueOioProvider();

Ⅱ、Network Request/Response Configuration http

The platform uniformly uses Apollo as the unified HTTP request initiation service and adopts the GraphQL protocol as the front-end to back-end protocol.

Reference documents:

  • apollo-client
  • graphql

(Ⅰ) Configuration Method

VueOioProvider({
  http?: OioHttpConfig
});

(Ⅱ) OioHttpConfig

/**
 * OioHttp configuration
 */
export interface OioHttpConfig {
  /**
   * Base URL
   */
  url: string;

  /**
   * Interceptor configuration
   */
  interceptor?: Partial<InterceptorOptions>;

  /**
   * Middleware configuration (takes precedence over interceptors)
   */
  middleware?: NetworkMiddlewareHandler | NetworkMiddlewareHandler[];
}

(Ⅲ) Built-in Interceptor Options InterceptorOptions

/**
 * Interceptor options
 */
export interface InterceptorOptions {
  /**
   * Network error interceptor
   */
  networkError: NetworkInterceptor;

  /**
   * Request success interceptor (success)
   */
  requestSuccess: NetworkInterceptor;

  /**
   * Redirection interceptor (success)
   */
  actionRedirect: NetworkInterceptor;

  /**
   * Login redirection interceptor (error)
   */
  loginRedirect: NetworkInterceptor;

  /**
   * Request error interceptor (error)
   */
  requestError: NetworkInterceptor;

  /**
   * MessageHub interceptor (success/error)
   */
  messageHub: NetworkInterceptor;

  /**
   * Pre-interceptors
   */
  beforeInterceptors: NetworkInterceptor | NetworkInterceptor[];

  /**
   * Post-interceptors
   */
  afterInterceptors: NetworkInterceptor | NetworkInterceptor[];
}

Execution order of built-in interceptors:

  • beforeInterceptors: Pre-interceptors
  • networkError: Network errors
  • actionRedirect: Redirection
  • requestSuccess: Request success
  • loginRedirect: Login redirection
  • requestError: Request errors
  • messageHub: MessageHub
  • afterInterceptors: Post-interceptors

(Ⅳ) NetworkInterceptor

/**
 * <h3>Network request interceptor</h3>
 * <ul>
 *   <li>Interceptors will execute sequentially in the registered order</li>
 *   <li>When any interceptor returns false, interceptor execution will be interrupted</li>
 *   <li>Built-in interceptors always execute before custom interceptors</li>
 * </ul>
 *
 */
export interface NetworkInterceptor {
  /**
   * Success interception
   * @param response Response result
   */
  success?(response: IResponseResult): ReturnPromise<boolean>;

  /**
   * Error interception
   * @param response Response result
   */
  error?(response: IResponseErrorResult): ReturnPromise<boolean>;
}

Ⅲ、Custom Routing Configuration router

(Ⅰ) Configuration Method

VueOioProvider({
  router?: RouterPath[]
});

(Ⅱ) RouterPath

/**
 * Routing configuration
 */
export interface RouterPath {
  /**
   * Access path
   */
  path: string;
  /**
   * Routing component name
   */
  widget: string;
}

(Ⅲ) Built-in Routing Configuration

[
  {
    path: '/login',
    widget: 'Login'
  },
  {
    path: '/forget',
    widget: 'ForgetPassword'
  },
  {
    path: '/first',
    widget: 'FirstResetPassword'
  }
]
  • login: Login page route
  • forget: Forgot password page route (non-login state)
  • first: First login page route

Ⅳ、Appearance Configuration

(Ⅰ) Configuration Method

VueOioProvider({
  copyrightStatus?: boolean;
  loginTheme?: OioLoginThemeConfig;
  browser?: OioProviderBrowserProps;
  theme?: ThemeName[];
});

(Ⅱ) copyrightStatus

Whether to display copyright information, default is display (true)

(Ⅲ) OioLoginThemeConfig

/**
 * Login theme configuration
 */
export interface OioLoginThemeConfig {
  /**
   * Name of built-in login theme
   */
  name?: OioLoginThemeName;
  /**
   * Background image URL
   */
  backgroundImage?: string;
  /**
   * Background color
   */
  backgroundColor?: string;
  /**
   * Logo URL
   */
  logo?: string;
  /**
   * Display position of login page logo
   */
  logoPosition?: OioLoginLogoPosition;
}

/**
 * Names of built-in login themes
 */
export enum OioLoginThemeName {
  /**
   * Large background with login on left
   */
  LEFT_STICK = 'LEFT_STICK',
  /**
   * Large background with login on right
   */
  RIGHT_STICK = 'RIGHT_STICK',
  /**
   * Large background with login in center
   */
  CENTER_STICK = 'CENTER_STICK',
  /**
   * Large background with login in center, logo inside login page
   */
  CENTER_STICK_LOGO = 'CENTER_STICK_LOGO',
  /**
   * Login on left
   */
  STAND_LEFT = 'STAND_LEFT',
  /**
   * Login on right
   */
  STAND_RIGHT = 'STAND_RIGHT'
}

/**
 * Display positions of login page logo
 */
export enum OioLoginLogoPosition {
  /**
   * Left
   */
  LEFT = 'LEFT',
  /**
   * Right
   */
  RIGHT = 'RIGHT',
  /**
   * Center
   */
  CENTER = 'CENTER'
}

(Ⅳ) OioProviderBrowserProps

/**
 * Browser configuration
 */
export interface OioProviderBrowserProps {
  /**
   * Browser tab icon
   */
  favicon?: string;
  /**
   * Default browser title (only for non-home pages)
   */
  title?: string;
}

(Ⅴ) ThemeName

type ThemeName =
  | 'default-large'
  | 'default-medium'
  | 'default-small'
  | 'dark-large'
  | 'dark-medium'
  | 'dark-small'
  | string;
  • default-large: Default large theme
  • default-medium: Default medium theme (default)
  • default-small: Default small theme
  • dark-large: Dark large theme
  • dark-medium: Dark medium theme
  • dark-small: Dark small theme
  • Others: Custom themes

(Ⅵ) Define Custom Theme

export const themeName = 'customTheme';

export const themeCssVars = {
  ......
};

Theme variable reference document: [OioThemeCssVars] (document missing)

(Ⅶ) Apply Custom Theme

import { registerTheme } from '@oinone/kunlun-dependencies';
import { themeName, themeCssVars } from './theme';

registerTheme(themeName, themeCssVars);

VueOioProvider({
  theme: [themeName]
});

Ⅴ、Low-Code Dependencies Configuration dependencies

(Ⅰ) Configuration Method

VueOioProvider({
  dependencies?: PluginLoadDependencies
});

(Ⅱ) PluginLoadDependencies

/**
 * Plugin load dependencies
 */
export type PluginLoadDependencies = Record<string, unknown> | PluginLoadDependency[];

/**
 * Plugin load type
 */
export type PluginLoadType = 'esm' | 'cjs' | 'umd' | 'iife' | 'css';

/**
 * Plugin load dependency
 */
export type PluginLoadDependency = {
  /**
   * Plugin load type
   */
  type: PluginLoadType;
  /**
   * Dependencies
   */
  dependencies: Record<string, unknown>;
};
Edit this page
Last Updated:1/15/26, 4:02 AM
Prev
Button:Passing Extra Parameters Across Pages
Next
Network Requests:Request Encryption
默认页脚
Copyright © 2026 Mr.Hope