Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
teddi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
teddi
Commits
65a01dd3
Commit
65a01dd3
authored
Nov 18, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
26d3d237
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
2 deletions
+57
-2
net.d.ts
dist/net.d.ts
+4
-0
net.js
dist/net.js
+23
-0
svga.d.ts
dist/svga.d.ts
+12
-1
svga.js
dist/svga.js
+11
-0
readme.md
readme.md
+7
-1
No files found.
dist/net.d.ts
0 → 100644
View file @
65a01dd3
/**
* 获取星速台token
*/
export
declare
const
getPxToken
:
()
=>
Promise
<
unknown
>
;
dist/net.js
0 → 100644
View file @
65a01dd3
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
exports
.
getPxToken
=
void
0
;
/**
* 获取星速台token
*/
exports
.
getPxToken
=
function
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
if
(
location
.
href
.
indexOf
(
'localhost'
)
>
-
1
)
{
resolve
(
'local-token'
);
}
else
{
window
.
getPxToken
(
function
(
e
,
token
)
{
if
(
!
e
)
{
resolve
(
token
);
}
else
{
reject
(
e
);
}
});
}
});
};
dist/svga.d.ts
View file @
65a01dd3
import
SVGA
=
require
(
"svgaplayerweb"
);
export
declare
const
loadSVGA
:
(
url
:
string
)
=>
Promise
<
unknown
>
;
/**
* 快速加载svga资源,但不装载
* @param url 资源URL
*/
export
declare
const
loadSVGA
:
(
url
:
string
)
=>
Promise
<
SVGA
.
VideoEntity
>
;
/**
* 快速装载一个svga动画
* @param url 资源URL
* @param className 挂载元素的class name
* @param loops 播放次数。默认为空,循环播放。
* @param clearsAfterStop
*/
export
declare
const
getSVGA
:
(
url
:
string
,
className
:
string
,
loops
:
number
,
clearsAfterStop
:
boolean
)
=>
Promise
<
SVGA
.
Player
>
;
dist/svga.js
View file @
65a01dd3
...
...
@@ -39,6 +39,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports
.
getSVGA
=
exports
.
loadSVGA
=
void
0
;
var
SVGA
=
require
(
"svgaplayerweb"
);
var
svgaParser
=
new
SVGA
.
Parser
();
/**
* 快速加载svga资源,但不装载
* @param url 资源URL
*/
exports
.
loadSVGA
=
function
(
url
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
svgaParser
.
load
(
url
,
function
(
videoItem
)
{
...
...
@@ -48,6 +52,13 @@ exports.loadSVGA = function (url) {
});
});
};
/**
* 快速装载一个svga动画
* @param url 资源URL
* @param className 挂载元素的class name
* @param loops 播放次数。默认为空,循环播放。
* @param clearsAfterStop
*/
exports
.
getSVGA
=
function
(
url
,
className
,
loops
,
clearsAfterStop
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
videoItem
,
svga
;
return
__generator
(
this
,
function
(
_a
)
{
...
...
readme.md
View file @
65a01dd3
...
...
@@ -90,4 +90,10 @@ const videoItem = await loadSVGA(url);
```
html
<script
src=
"getTokenKey"
></script>
<script
src=
"//yun.duiba.com.cn/js-libs/px-token/0.0.4/px-token.min.js"
></script>
```
\ No newline at end of file
```
用法
```
js
import
{
getPxToken
}
from
"teddi"
;
const
token
=
await
getPxToken
();
const
result
=
await
API
.
doSign
({
token
});
```
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