Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SLG
web-service
Commits
e57972ae
Commit
e57972ae
authored
Mar 11, 2022
by
mxm-web-develop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1123123
parent
33a58a41
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
99 additions
and
51 deletions
+99
-51
index.d.ts
dist/common/index.d.ts
+4
-1
usrGurad.d.ts
dist/decorators/usrGurad.d.ts
+1
-1
index.d.ts
dist/index.d.ts
+3
-4
index.js
dist/index.js
+1
-15
User.d.ts
dist/suyuan/User.d.ts
+16
-0
constants.d.ts
dist/suyuan/constants.d.ts
+20
-0
index.d.ts
dist/suyuan/index.d.ts
+4
-13
req.types.d.ts
dist/suyuan/req.types.d.ts
+14
-1
res.types.d.ts
dist/suyuan/res.types.d.ts
+23
-0
play.ts
src/play.ts
+6
-15
constants.ts
src/slg/constants.ts
+4
-0
User.ts
src/suyuan/User.ts
+1
-0
index.ts
src/suyuan/index.ts
+2
-1
No files found.
dist/common/index.d.ts
View file @
e57972ae
import
{
AxiosInstance
}
from
"axios"
;
declare
class
Common
{
declare
class
Common
{
protected
_axios
:
AxiosInstance
;
protected
_url
:
any
;
protected
_config
:
any
;
constructor
(
url
:
string
,
config
?:
any
);
constructor
(
url
:
string
,
config
?:
any
);
dosome
():
void
;
}
}
export
default
Common
;
export
default
Common
;
dist/decorators/usrGurad.d.ts
View file @
e57972ae
export
declare
function
test_dec
(
appName
:
string
):
(
target
:
any
,
propertyKey
:
string
,
descriptor
:
PropertyDescriptor
)
=>
void
;
export
declare
function
test_dec
(
appName
:
string
):
(
target
:
any
,
propertyKey
:
string
,
descriptor
:
PropertyDescriptor
)
=>
void
;
export
declare
function
LocLogin
(
appName
:
string
):
(
target
:
any
,
propertyKey
:
string
,
descriptor
:
PropertyDescriptor
)
=>
void
;
export
declare
function
LocLogin
(
appName
:
string
):
(
target
:
any
,
propertyKey
:
string
,
descriptor
:
PropertyDescriptor
)
=>
Promise
<
void
>
;
dist/index.d.ts
View file @
e57972ae
...
@@ -5,11 +5,10 @@ interface Coinfg {
...
@@ -5,11 +5,10 @@ interface Coinfg {
options
?:
any
;
options
?:
any
;
}
}
declare
class
FZMAPI
{
declare
class
FZMAPI
{
Common
:
Common
;
_url
:
string
;
Suyuan
:
Suyuan
;
_config
:
Coinfg
|
undefined
;
Browser
:
Browser
;
protected
config
:
Coinfg
|
undefined
;
constructor
(
url
:
string
,
config
?:
Coinfg
|
undefined
);
constructor
(
url
:
string
,
config
?:
Coinfg
|
undefined
);
SuyuanModlue
:
()
=>
Suyuan
;
}
}
export
{
Common
as
commonApi
,
Suyuan
as
suyuanApi
,
Browser
as
browserApi
};
export
{
Common
as
commonApi
,
Suyuan
as
suyuanApi
,
Browser
as
browserApi
};
export
default
FZMAPI
;
export
default
FZMAPI
;
dist/index.js
View file @
e57972ae
import
t
from
"axios"
;
class
e
{
constructor
(
t
,
e
){}
dosome
(){
console
.
log
(
111
)}}
import
s
from
"axios"
;
import
{
setStore
as
e
}
from
"mxm-usrstorage"
;
class
t
{
_axios
;
_url
;
_config
;
constructor
(
e
,
t
){
t
&&
t
.
url
?(
this
.
_url
=
t
.
url
,
this
.
_axios
=
s
.
create
({
baseURL
:
t
.
url
,...
t
})):(
this
.
_url
=
e
,
this
.
_axios
=
s
.
create
({
baseURL
:
e
,...
t
})),
this
.
_config
=
t
,
this
.
_axios
.
interceptors
.
response
.
use
((
s
=>
(
s
=>
{
if
(
200
===
s
.
status
&&
"OK"
===
s
.
statusText
)
return
s
.
data
;
throw
new
Error
(
s
.
statusText
)})(
s
)),(
s
=>
Promise
.
reject
(
s
)))}}
var
i
=
{
login
:
"/api/user/login"
,
isSetPwd
:
"/api/user/isSetPwd"
,
keyAdd
:
"/api/appKey/add"
,
keyDelete
:
"/api/appKey/delete"
,
keyList
:
"/api/appKey/list"
,
register
:
"/api/user/register"
,
send
:
"/api/user/send"
,
sendEmail
:
"/api/user/sendEmail"
,
sendSms
:
"/api/user/sendSms"
,
setPhone
:
"/api/user/setPhone"
,
setPhoneCode
:
"/api/user/setPhoneCode"
,
setPwd
:
"/api/user/setPwd"
,
setPwdCode
:
"/api/user/setPwdCode"
,
user
:
"api/user"
,
add
:
"/api/users/add"
};
class
r
extends
t
{
constructor
(
s
,
e
){
super
(
s
,
e
)}
async
login
(
s
){
const
t
=
await
this
.
_axios
.
post
(
i
.
login
,
s
);
return
t
&&
e
({
app
:
this
.
constructor
.
name
}),
t
}
async
isSetPwd
(
s
){
return
await
this
.
_axios
.
post
(
i
.
isSetPwd
,
s
)}
async
keyAdd
(
s
){
return
await
this
.
_axios
.
post
(
i
.
keyAdd
,
s
)}
async
keyDelete
(
s
){
return
await
this
.
_axios
.
delete
(
i
.
keyDelete
,{
params
:
s
})}
async
keyList
(
s
){
return
await
this
.
_axios
.
post
(
i
.
keyList
,
s
)}}
class
a
extends
t
{
static
_version
;
constructor
(
s
,
e
){
super
(
s
,
e
),
a
.
_version
=
"v.1.0.1"
}
userModule
=
()
=>
new
r
(
this
.
_url
,
this
.
_config
)}
class
o
{
constructor
(
s
,
e
){}
kill
(){
console
.
log
(
222
)}}
class
n
{
_url
;
_config
;
constructor
(
s
,
e
){
this
.
_url
=
s
,
this
.
_config
=
e
}
SuyuanModlue
=
()
=>
new
a
(
this
.
_url
,
this
.
_config
)}
export
{
o
as
browserApi
,
t
as
commonApi
,
n
as
default
,
a
as
suyuanApi
};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function
o
(
t
,
e
){
if
(
"object"
==
typeof
Reflect
&&
"function"
==
typeof
Reflect
.
metadata
)
return
Reflect
.
metadata
(
t
,
e
)}
class
s
{
_axios
;
_url
;
_config
;
constructor
(
e
,
o
){
o
&&
o
.
url
?(
this
.
_url
=
o
.
url
,
this
.
_axios
=
t
.
create
({
baseURL
:
o
.
url
,...
o
})):(
this
.
_url
=
e
,
this
.
_axios
=
t
.
create
({
baseURL
:
e
,...
o
})),
this
.
_config
=
o
,
this
.
_axios
.
interceptors
.
response
.
use
((
t
=>
(
t
=>
{
if
(
200
===
t
.
status
&&
"OK"
===
t
.
statusText
)
return
t
.
data
;
throw
new
Error
(
t
.
statusText
)})(
t
)),(
t
=>
Promise
.
reject
(
t
)))}
userModule
=
()
=>
new
r
(
this
.
_url
,
this
.
_config
)}
class
r
extends
s
{
constructor
(
t
,
e
){
super
(
t
,
e
)}
async
login
(
t
){
return
await
this
.
_axios
.
post
(
"/api/user/login"
,
t
)}}
!
function
(
t
,
e
,
o
,
s
){
var
r
,
n
=
arguments
.
length
,
i
=
n
<
3
?
e
:
null
===
s
?
s
=
Object
.
getOwnPropertyDescriptor
(
e
,
o
):
s
;
if
(
"object"
==
typeof
Reflect
&&
"function"
==
typeof
Reflect
.
decorate
)
i
=
Reflect
.
decorate
(
t
,
e
,
o
,
s
);
else
for
(
var
c
=
t
.
length
-
1
;
c
>=
0
;
c
--
)(
r
=
t
[
c
])
&&
(
i
=
(
n
<
3
?
r
(
i
):
n
>
3
?
r
(
e
,
o
,
i
):
r
(
e
,
o
))
||
i
);
n
>
3
&&
i
&&
Object
.
defineProperty
(
e
,
o
,
i
)}([
function
(
t
,
e
,
o
){
console
.
log
(
t
)},
o
(
"design:type"
,
Function
),
o
(
"design:paramtypes"
,[
Object
]),
o
(
"design:returntype"
,
Promise
)],
r
.
prototype
,
"login"
,
null
);
class
n
{
constructor
(
t
,
e
){}
kill
(){
console
.
log
(
222
)}}
class
i
{
Common
;
Suyuan
;
Browser
;
config
;
constructor
(
t
,
o
){
this
.
config
=
o
,
this
.
Common
=
new
e
(
t
,
this
.
config
),
this
.
Browser
=
new
n
(
t
,
this
.
config
),
this
.
Suyuan
=
new
s
(
t
,
this
.
config
)}}
export
{
n
as
browserApi
,
e
as
commonApi
,
i
as
default
,
s
as
suyuanApi
};
dist/suyuan/User.d.ts
0 → 100644
View file @
e57972ae
import
{
IsSetPwd_REQ
,
KeyAdd_REQ
,
Login_REQ
,
KeyList_REQ
}
from
"./req.types"
;
import
{
KeyAdd_RES
,
keyList_RES
,
Login_RES
}
from
"./res.types"
;
import
Common
from
"../common"
;
declare
class
User
extends
Common
{
constructor
(
url
:
any
,
config
?:
any
);
login
(
data
:
Login_REQ
):
Promise
<
Login_RES
>
;
isSetPwd
(
data
:
IsSetPwd_REQ
):
Promise
<
{
is_set_pwd
:
number
;
}
>
;
keyAdd
(
data
:
KeyAdd_REQ
):
Promise
<
KeyAdd_RES
>
;
keyDelete
(
id
:
number
):
Promise
<
{
id
:
number
;
}
>
;
keyList
(
data
:
KeyList_REQ
):
Promise
<
keyList_RES
>
;
}
export
default
User
;
dist/suyuan/constants.d.ts
0 → 100644
View file @
e57972ae
declare
const
_default
:
{
user
:
{
login
:
string
;
isSetPwd
:
string
;
keyAdd
:
string
;
keyDelete
:
string
;
keyList
:
string
;
register
:
string
;
send
:
string
;
sendEmail
:
string
;
sendSms
:
string
;
setPhone
:
string
;
setPhoneCode
:
string
;
setPwd
:
string
;
setPwdCode
:
string
;
user
:
string
;
add
:
string
;
};
};
export
default
_default
;
dist/suyuan/index.d.ts
View file @
e57972ae
import
{
AxiosInstance
}
from
"axios"
;
import
User
from
"./User"
;
import
{
Login
}
from
"./req.types"
;
import
Common
from
"../common"
;
declare
class
Suyuan
{
declare
class
Suyuan
extends
Common
{
protected
_axios
:
AxiosInstance
;
static
_version
:
string
;
protected
_url
:
any
;
protected
_config
:
any
;
constructor
(
url
:
string
,
config
?:
any
);
constructor
(
url
:
string
,
config
?:
any
);
userModule
:
()
=>
User
;
userModule
:
()
=>
User
;
}
}
declare
class
User
extends
Suyuan
{
constructor
(
url
:
any
,
config
?:
any
);
login
(
data
:
Login
):
Promise
<
{
id
:
number
;
token
:
string
;
}
>
;
}
export
default
Suyuan
;
export
default
Suyuan
;
dist/suyuan/req.types.d.ts
View file @
e57972ae
export
interface
Login
{
export
interface
Login
_REQ
{
country
?:
string
;
country
?:
string
;
email
?:
string
;
email
?:
string
;
code
?:
string
;
code
?:
string
;
...
@@ -6,3 +6,16 @@ export interface Login {
...
@@ -6,3 +6,16 @@ export interface Login {
phone
?:
string
;
phone
?:
string
;
pwd
?:
string
;
pwd
?:
string
;
}
}
export
interface
IsSetPwd_REQ
{
"country"
:
string
;
"phone"
:
string
;
"email"
:
string
;
}
export
interface
KeyAdd_REQ
{
"app_id"
:
string
;
"app_key"
:
string
;
}
export
interface
KeyList_REQ
{
"page"
:
number
;
"page_size"
:
number
;
}
dist/suyuan/res.types.d.ts
View file @
e57972ae
...
@@ -4,3 +4,26 @@ export interface ResConstruction<T> {
...
@@ -4,3 +4,26 @@ export interface ResConstruction<T> {
"msg"
:
string
;
"msg"
:
string
;
"data"
:
T
;
"data"
:
T
;
}
}
export
interface
Login_RES
{
id
:
number
;
token
:
string
;
}
export
interface
KeyAdd_RES
{
"id"
:
0
;
"user_id"
:
0
;
"app_id"
:
string
;
"app_key"
:
string
;
"app_secret"
:
string
;
}
interface
keyItem
{
"id"
:
number
;
"user_id"
:
number
;
"app_id"
:
string
;
"app_key"
:
string
;
"app_secret"
:
string
;
}
export
interface
keyList_RES
{
"total"
:
number
;
"results"
:
keyItem
[];
}
export
{};
src/play.ts
View file @
e57972ae
import
FZMAPI
from
"./index"
;
import
FZMAPI
from
"./index"
;
const
api
=
new
FZMAPI
(
"http://121.37.141.165:46790"
)
const
api
=
new
FZMAPI
(
'http://111213'
)
// api.userModule.login()
api
.
SuyuanModlue
().
userModule
().
keyAdd
({
// api.keyAdd()
"app_id"
:
"string"
,
// api.UserModule.login(
"app_key"
:
"string"
// {
})
// login_type:0,
\ No newline at end of file
// phone: '13800000000',
// pwd:'770a6e7a2eada8facf51f1240c0b3612'
// }
// )
// api.login({
// login_type:0,
// phone: '13800000000',
// pwd:'770a6e7a2eada8facf51f1240c0b3612'
// })
src/slg/constants.ts
0 → 100644
View file @
e57972ae
export
default
{
}
\ No newline at end of file
src/suyuan/User.ts
View file @
e57972ae
...
@@ -49,6 +49,7 @@ class User extends Common {
...
@@ -49,6 +49,7 @@ class User extends Common {
data
data
);
);
}
}
/**
/**
* 添加用户接口密钥
* 添加用户接口密钥
* ```ts
* ```ts
...
...
src/suyuan/index.ts
View file @
e57972ae
...
@@ -14,9 +14,10 @@ import constants from "./constants";
...
@@ -14,9 +14,10 @@ import constants from "./constants";
import
User
from
"./User"
;
import
User
from
"./User"
;
import
Common
from
"../common"
;
import
Common
from
"../common"
;
class
Suyuan
extends
Common
{
class
Suyuan
extends
Common
{
static
_version
:
string
constructor
(
url
:
string
,
config
?:
any
)
{
constructor
(
url
:
string
,
config
?:
any
)
{
super
(
url
,
config
);
super
(
url
,
config
);
Suyuan
.
_version
=
'v.1.0.1'
// this.userModule = new User(this._url, this._config);
// this.userModule = new User(this._url, this._config);
}
}
userModule
=
()
=>
new
User
(
this
.
_url
,
this
.
_config
);
userModule
=
()
=>
new
User
(
this
.
_url
,
this
.
_config
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment