Commit 53871823 authored by mxm-web-develop's avatar mxm-web-develop

321

parent 981ef60b
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
\ No newline at end of file
[mxm-fzm-service](../README.md) / [Exports](../modules.md) / browserApi
# Class: browserApi
## Table of contents
### Constructors
- [constructor](browserApi.md#constructor)
### Methods
- [kill](browserApi.md#kill)
## Constructors
### constructor
**new browserApi**(`url`, `config?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `url` | `string` |
| `config?` | `any` |
#### Defined in
browser/index.ts:3
## Methods
### kill
**kill**(): `void`
#### Returns
`void`
#### Defined in
browser/index.ts:6
[mxm-fzm-service](../README.md) / [Exports](../modules.md) / commonApi
# Class: commonApi
## Table of contents
### Constructors
- [constructor](commonApi.md#constructor)
### Methods
- [dosome](commonApi.md#dosome)
## Constructors
### constructor
**new commonApi**(`url`, `config?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `url` | `string` |
| `config?` | `any` |
#### Defined in
common/index.ts:3
## Methods
### dosome
**dosome**(): `void`
#### Returns
`void`
#### Defined in
common/index.ts:6
[mxm-fzm-service](../README.md) / [Exports](../modules.md) / default
# Class: default
## Table of contents
### Constructors
- [constructor](default.md#constructor)
### Properties
- [Browser](default.md#browser)
- [Common](default.md#common)
- [Suyuan](default.md#suyuan)
- [config](default.md#config)
## Constructors
### constructor
**new default**(`url`, `config?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `url` | `string` |
| `config?` | `Coinfg` |
#### Defined in
[index.ts:13](https://github.com/mxm-web-develop/mxm-fzm-service/blob/178de5b/src/index.ts#L13)
## Properties
### Browser
**Browser**: [`browserApi`](browserApi.md)
#### Defined in
[index.ts:11](https://github.com/mxm-web-develop/mxm-fzm-service/blob/178de5b/src/index.ts#L11)
___
### Common
**Common**: [`commonApi`](commonApi.md)
#### Defined in
[index.ts:9](https://github.com/mxm-web-develop/mxm-fzm-service/blob/178de5b/src/index.ts#L9)
___
### Suyuan
**Suyuan**: [`suyuanApi`](suyuanApi.md)
#### Defined in
[index.ts:10](https://github.com/mxm-web-develop/mxm-fzm-service/blob/178de5b/src/index.ts#L10)
___
### config
`Protected` **config**: `undefined` \| `Coinfg`
#### Defined in
[index.ts:12](https://github.com/mxm-web-develop/mxm-fzm-service/blob/178de5b/src/index.ts#L12)
[mxm-fzm-service](../README.md) / [Exports](../modules.md) / suyuanApi
# Class: suyuanApi
## Table of contents
### Constructors
- [constructor](suyuanApi.md#constructor)
### Properties
- [\_axios](suyuanApi.md#_axios)
- [\_config](suyuanApi.md#_config)
- [\_url](suyuanApi.md#_url)
### Methods
- [userModule](suyuanApi.md#usermodule)
## Constructors
### constructor
**new suyuanApi**(`url`, `config?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `url` | `string` |
| `config?` | `any` |
#### Defined in
suyuan/index.ts:18
## Properties
### \_axios
`Protected` **\_axios**: `AxiosInstance`
#### Defined in
suyuan/index.ts:15
___
### \_config
`Protected` **\_config**: `any`
#### Defined in
suyuan/index.ts:17
___
### \_url
`Protected` **\_url**: `any`
#### Defined in
suyuan/index.ts:16
## Methods
### userModule
**userModule**(): `User`
#### Returns
`User`
#### Defined in
suyuan/index.ts:43
[mxm-fzm-service](../README.md) / Exports
# mxm-fzm-service
## Table of contents
### Classes
- [browserApi](classes/browserApi.md)
- [commonApi](classes/commonApi.md)
- [default](classes/default.md)
- [suyuanApi](classes/suyuanApi.md)
......@@ -5,7 +5,7 @@
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"doc:gen":"",
"doc:gen": "",
"build": "yarn rollup -c"
},
"author": "",
......@@ -23,7 +23,6 @@
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"typedoc": "^0.22.13",
"typedoc-plugin-markdown": "^3.11.14",
"typescript": "^4.5.5",
"vuepress": "^1.9.7"
}
......
......@@ -26,7 +26,6 @@ function createEntry(options){
extensions
}),
commonjs(),
rollupTypescript({
tsconfigOverride:{
compilerOptions:{
......
import axios, { AxiosInstance } from "axios";
import { response_interceptor } from "../suyuan/helps";
class Common {
constructor(url:string,config?:any){
}
dosome(){
console.log(111);
class Common {
protected _axios: AxiosInstance;
protected _url;
protected _config;
constructor(url: string, config?: any) {
if (config && config.url) {
this._url = config.url;
this._axios = axios.create({
baseURL: config.url,
...config,
});
} else {
this._url = url;
this._axios = axios.create({
baseURL: url,
...config,
});
}
this._config = config;
this._axios.interceptors.response.use(
(response) => {
let res = response_interceptor(response);
return res;
},
(err) => {
return Promise.reject(err);
}
);
}
}
export default Common
\ No newline at end of file
export default Common;
\ No newline at end of file
......@@ -6,16 +6,21 @@ interface Coinfg {
options?: any;
}
class FZMAPI {
Common: Common;
Suyuan: Suyuan;
Browser: Browser
protected config: Coinfg | undefined;
// Common: Common;
// Suyuan: Suyuan;
// Browser: Browser
_url: string;
_config : Coinfg | undefined;
// protected config: Coinfg | undefined;
constructor(url: string, config?: Coinfg | undefined) {
this.config = config;
this.Common = new Common(url,this.config);
this.Browser = new Browser(url,this.config);
this.Suyuan = new Suyuan(url,this.config);
this._url = url;
this._config = config;
// this.Common = new Common(url,this.config);
// this.Browser = new Browser(url,this.config);
// this.Suyuan = new Suyuan(url,this.config);
}
SuyuanModlue = ()=> new Suyuan(this._url,this._config);
}
export {
......
// import FZMAPI from "./index";
// const api = new FZMAPI("http://121.37.141.165:46790").Suyuan.userModule();
import FZMAPI from "./index";
const api = new FZMAPI("http://121.37.141.165:46790")
// api.userModule.login()
// api.keyAdd()
// api.UserModule.login(
// {
......
import Suyuan from ".";
import axios, { AxiosInstance, AxiosResponse } from "axios";
import { LocLogin, test_dec } from "../decorators/usrGurad";
import { IsSetPwd_REQ, KeyAdd_REQ, Login_REQ, KeyList_REQ } from "./req.types";
import { response_interceptor } from "./helps";
import { setStore } from "mxm-usrstorage";
import {
KeyAdd_RES,
keyList_RES,
Login_RES,
ResConstruction,
} from "./res.types";
import constants from "./constants";
import Common from "../common";
//用户模块
class User extends Common {
constructor(url, config?) {
super(url, config);
}
/**
* 用户登录
* @property id:某个东西
*
* @param {Login_REQ}
* @returns {Login_RES}
*/
async login(data: Login_REQ): Promise<Login_RES> {
const res = await this._axios.post<unknown, Login_RES>(
constants.user.login,
data
);
if (res) {
setStore({
app: this.constructor.name,
});
}
return res;
}
/**
* 是否设置过密码
* @typeParam
* @returns {is_set_pwd: number}
*/
async isSetPwd(data: IsSetPwd_REQ): Promise<{ is_set_pwd: number }> {
return await this._axios.post<unknown, { is_set_pwd: number }>(
constants.user.isSetPwd,
data
);
}
/**
* 添加用户接口密钥
* ```ts
* const res = await keyAdd({
"app_id": "string",
"app_key": "string"
})
* ```
* @param data {@link KeyAdd_REQ}
* @return
* ```json
* {
"id": 0,
"user_id": 0,
"app_id": "string",
"app_key": "string",
"app_secret": "string"
}
*
* ```
*/
async keyAdd(data: KeyAdd_REQ): Promise<KeyAdd_RES> {
return await this._axios.post<unknown, KeyAdd_RES>(
constants.user.keyAdd,
data
);
}
/**
* 删除用户接口密钥
* @param id number
* @returns
*/
async keyDelete(id: number): Promise<{ id: number }> {
return await this._axios.delete<unknown, { id: number }>(
constants.user.keyDelete,
{
params: id,
}
);
}
/**
* 查询用户接口密钥列表
* @param keyList_REQ.page 设置页数
* @returns
*/
async keyList(data: KeyList_REQ): Promise<keyList_RES> {
return await this._axios.post<unknown, keyList_RES>(
constants.user.keyList,
data
);
}
}
export default User
\ No newline at end of file
......@@ -4400,18 +4400,6 @@ handle-thing@^2.0.0:
resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e"
integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==
handlebars@^4.7.7:
version "4.7.7"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
dependencies:
minimist "^1.2.5"
neo-async "^2.6.0"
source-map "^0.6.1"
wordwrap "^1.0.0"
optionalDependencies:
uglify-js "^3.1.4"
har-schema@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
......@@ -5987,7 +5975,7 @@ negotiator@0.6.3:
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd"
integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==
neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1:
neo-async@^2.5.0, neo-async@^2.6.1:
version "2.6.2"
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
......@@ -8392,13 +8380,6 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
typedoc-plugin-markdown@^3.11.14:
version "3.11.14"
resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.14.tgz#2a7a04abd50b8f1e5d46793061d70229d504d2cd"
integrity sha512-lh47OQvl0079nB18YL9wuTRRhMpjo300SZKfx/xpQY8qG+GINeSxTod95QBELeI0NP81sNtUbemRDrn5nyef4Q==
dependencies:
handlebars "^4.7.7"
typedoc@^0.22.13:
version "0.22.13"
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.22.13.tgz#d061f8f0fb7c9d686e48814f245bddeea4564e66"
......@@ -8428,11 +8409,6 @@ uglify-js@3.4.x:
commander "~2.19.0"
source-map "~0.6.1"
uglify-js@^3.1.4:
version "3.15.2"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.2.tgz#1ed2c976f448063b1f87adb68c741be79959f951"
integrity sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==
unbox-primitive@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"
......@@ -9031,11 +9007,6 @@ word-wrap@~1.2.3:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
wordwrap@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=
worker-farm@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment