# auth-page

> import { Auth, // vite AuthV2, // webpack watchToken, // vite watchTokenV2, // webpack addToken // 通用 } from 'auth-page'

Latest version **1.0.7** (published 2022-08-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install auth-page
pnpm add auth-page
yarn add auth-page
bun add auth-page
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2022-08-19 |
| First published | 2022-08-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | lizhenjie |
| Maintainers | lizhenjie |

## Links

- npm: https://www.npmjs.com/package/auth-page
- npm.io page: https://npm.io/package/auth-page

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.27.2

## Recent versions

- 1.0.7 (latest) — 2022-08-19
- 1.0.6 — 2022-08-19
- 1.0.5 — 2022-08-18
- 1.0.4 — 2022-08-18
- 1.0.3 — 2022-08-18
- 1.0.2 — 2022-08-18
- 1.0.1 — 2022-08-18
- 1.0.0 — 2022-08-18

## README

# package不同工程使用不同的资源

  import { 
    Auth,             // vite
    AuthV2,           // webpack
    watchToken,       // vite
    watchTokenV2,     // webpack
    addToken          // 通用
  } from 'auth-page'

## 1.配置router
  · 在路由中配置 `/auth` 
  · 引入 Auth 组件, vue2+webpack引入 AuthV2

      import { Auth } from 'auth-page'
      import { AuthV2 } from 'auth-page'

      {
        path: '/auth',
        component: Auth
      }


## 2.配置axios拦截器
  import { watchToken, watchTokenV2, addToken } from 'auth-page'

  请求拦截  addToken(config)
  响应拦截  watchToken(response)
    注：vue2+webpack    watchTokenV2(response)

## 3.配置代理
  proxy配置 `/client` 指向后端地址

    '/client': {
      target: 'http://192.168.10.89:8080/'
    }


## 4.配置环境变量
  1. 5a-认证code回调地址

      VUE_APP_AUTH_CODE_CALLBACK = '/client/callback'
    注：vite配置环境变量
      VITE_APP_AUTH_CODE_CALLBACK = '/client/callback'

  2. 5a-认证地址

      VUE_APP_AUTHENTICATION = '/client/authentication'
    注：vite配置环境变量
      VITE_APP_AUTHENTICATION = '/client/authentication'

---
_Source: https://npm.io/package/auth-page · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
