@_tc/template-core 0.2.0-bate.5 → 0.2.0-bate.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENT_README.md CHANGED
@@ -415,6 +415,7 @@ import { Button, DataTable, Form, Input, Modal, Select } from '@_tc/template-cor
415
415
  - RAF 计时器:`rafSetTimeout`、`rafSetInterval`、`rafClearTimeout`、`rafClearInterval`、`clearRafTimer`。
416
416
  - 请求类型:`BaseResponse`、`PageParams`、`PageResponse`、`RequestConfig`、`ResponseConfig`、`AxiosError`。
417
417
  - 请求 header:自动添加 `s_t`、`s_sign`、`projk`;存在短 token 时添加 `Authorization: Bearer ${token}`。
418
+ - 默认会先设置 `Content-Type: application/json`;如果是上传文件、`FormData` 或其他内容类型,请在请求配置里显式覆盖。
418
419
  - Token 工具:`getAuthToken()`、`setAuthToken()`、`clearAuthToken()`、`localKeyMap`;`getAuthToken()` 是同步函数,读取前无需 `await`。
419
420
  - 本地 key:短 token 是 `localStorage.auth_token`,项目 key 是 `localStorage.p_J_k`;刷新 token header 默认名是 `RT`。
420
421
  - 组件加载辅助:`renderImportComponent(import('./Page'))` 会用 `React.lazy` + `Suspense` 渲染动态组件。
package/README.md CHANGED
@@ -573,6 +573,7 @@ applyThemeMode('dark', true)
573
573
  - `timeout`:15000ms(15秒)
574
574
  - `credentials`:`'include'`,支持跨域携带 cookie
575
575
  - `window._signKey`:由服务端页面模板从 `app.config.signKey` 注入
576
+ - 默认会先设置 `Content-Type: application/json`;如果是上传文件、`FormData` 或其他内容类型,请在请求配置里显式覆盖
576
577
 
577
578
  **请求拦截器**:
578
579
 
@@ -100,6 +100,7 @@ api.interceptors.request.use(async (config) => {
100
100
  const aauto = getApiAuth();
101
101
  const time = (/* @__PURE__ */ new Date()).getTime();
102
102
  config.headers = {
103
+ "Content-Type": "application/json",
103
104
  ...config.headers,
104
105
  s_t: time + "",
105
106
  s_sign: md5(`${window["_signKey"]}_${time}`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_tc/template-core",
3
- "version": "0.2.0-bate.5",
3
+ "version": "0.2.0-bate.6",
4
4
  "description": "A full-stack TypeScript admin framework powered by Koa, React, and Vite - monorepo root",
5
5
  "types": "./types/index.d.ts",
6
6
  "exports": {