igsdk 1.1.1 → 1.1.3
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/README.md +443 -0
- package/igsdk.d.ts +97 -101
- package/igsdk.js +1 -1
- package/package.json +3 -4
- package/README-CN.html +0 -696
package/README-CN.html
DELETED
|
@@ -1,696 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
|
|
5
|
-
|
|
6
|
-
<link href='https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; --title-bar-height:20px; }
|
|
7
|
-
.mac-os-11 { --title-bar-height:28px; }
|
|
8
|
-
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
|
|
9
|
-
h1, h2, h3, h4, h5 { white-space: pre-wrap; }
|
|
10
|
-
body { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
|
|
11
|
-
iframe { margin: auto; }
|
|
12
|
-
a.url { word-break: break-all; }
|
|
13
|
-
a:active, a:hover { outline: 0px; }
|
|
14
|
-
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
|
|
15
|
-
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; }
|
|
16
|
-
#write.first-line-indent p { text-indent: 2em; }
|
|
17
|
-
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
|
|
18
|
-
#write.first-line-indent li { margin-left: 2em; }
|
|
19
|
-
.for-image #write { padding-left: 8px; padding-right: 8px; }
|
|
20
|
-
body.typora-export { padding-left: 30px; padding-right: 30px; }
|
|
21
|
-
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
|
|
22
|
-
.typora-export .task-list-item input { pointer-events: none; }
|
|
23
|
-
@media screen and (max-width: 500px) {
|
|
24
|
-
body.typora-export { padding-left: 0px; padding-right: 0px; }
|
|
25
|
-
#write { padding-left: 20px; padding-right: 20px; }
|
|
26
|
-
}
|
|
27
|
-
#write li > figure:last-child { margin-bottom: 0.5rem; }
|
|
28
|
-
#write ol, #write ul { position: relative; }
|
|
29
|
-
img { max-width: 100%; vertical-align: middle; image-orientation: from-image; }
|
|
30
|
-
button, input, select, textarea { color: inherit; font: inherit; }
|
|
31
|
-
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
|
|
32
|
-
*, ::after, ::before { box-sizing: border-box; }
|
|
33
|
-
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
|
|
34
|
-
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
|
|
35
|
-
p { line-height: inherit; }
|
|
36
|
-
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; }
|
|
37
|
-
p { orphans: 4; }
|
|
38
|
-
h1 { font-size: 2rem; }
|
|
39
|
-
h2 { font-size: 1.8rem; }
|
|
40
|
-
h3 { font-size: 1.6rem; }
|
|
41
|
-
h4 { font-size: 1.4rem; }
|
|
42
|
-
h5 { font-size: 1.2rem; }
|
|
43
|
-
h6 { font-size: 1rem; }
|
|
44
|
-
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
|
|
45
|
-
.hidden { display: none; }
|
|
46
|
-
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
|
|
47
|
-
a { cursor: pointer; }
|
|
48
|
-
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
|
|
49
|
-
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
|
|
50
|
-
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
|
|
51
|
-
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
|
|
52
|
-
figure > table { margin: 0px; }
|
|
53
|
-
thead, tr { break-inside: avoid; break-after: auto; }
|
|
54
|
-
thead { display: table-header-group; }
|
|
55
|
-
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
|
|
56
|
-
table.md-table td { min-width: 32px; }
|
|
57
|
-
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
|
|
58
|
-
.CodeMirror-linenumber { user-select: none; }
|
|
59
|
-
.CodeMirror { text-align: left; }
|
|
60
|
-
.CodeMirror-placeholder { opacity: 0.3; }
|
|
61
|
-
.CodeMirror pre { padding: 0px 4px; }
|
|
62
|
-
.CodeMirror-lines { padding: 0px; }
|
|
63
|
-
div.hr:focus { cursor: none; }
|
|
64
|
-
#write pre { white-space: pre-wrap; }
|
|
65
|
-
#write.fences-no-line-wrapping pre { white-space: pre; }
|
|
66
|
-
#write pre.ty-contain-cm { white-space: normal; }
|
|
67
|
-
.CodeMirror-gutters { margin-right: 4px; }
|
|
68
|
-
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
|
|
69
|
-
.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
|
|
70
|
-
#write .md-fences.mock-cm { white-space: pre-wrap; }
|
|
71
|
-
.md-fences.md-fences-with-lineno { padding-left: 0px; }
|
|
72
|
-
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
|
|
73
|
-
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
|
|
74
|
-
.CodeMirror-line, twitterwidget { break-inside: avoid; }
|
|
75
|
-
svg { break-inside: avoid; }
|
|
76
|
-
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
|
|
77
|
-
.footnotes + .footnotes { margin-top: 0px; }
|
|
78
|
-
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
|
|
79
|
-
li div { padding-top: 0px; }
|
|
80
|
-
blockquote { margin: 1rem 0px; }
|
|
81
|
-
li .mathjax-block, li p { margin: 0.5rem 0px; }
|
|
82
|
-
li blockquote { margin: 1rem 0px; }
|
|
83
|
-
li { margin: 0px; position: relative; }
|
|
84
|
-
blockquote > :last-child { margin-bottom: 0px; }
|
|
85
|
-
blockquote > :first-child, li > :first-child { margin-top: 0px; }
|
|
86
|
-
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
|
|
87
|
-
#write .footnote-line { white-space: pre-wrap; }
|
|
88
|
-
@media print {
|
|
89
|
-
body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; }
|
|
90
|
-
#write { margin-top: 0px; border-color: transparent !important; padding-top: 0px !important; padding-bottom: 0px !important; }
|
|
91
|
-
.typora-export * { -webkit-print-color-adjust: exact; }
|
|
92
|
-
.typora-export #write { break-after: avoid; }
|
|
93
|
-
.typora-export #write::after { height: 0px; }
|
|
94
|
-
.is-mac table { break-inside: avoid; }
|
|
95
|
-
#write > p:nth-child(1) { margin-top: 0px; }
|
|
96
|
-
.typora-export-show-outline .typora-export-sidebar { display: none; }
|
|
97
|
-
figure { overflow-x: visible; }
|
|
98
|
-
}
|
|
99
|
-
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
|
|
100
|
-
a img, img a { cursor: pointer; }
|
|
101
|
-
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
|
|
102
|
-
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
|
|
103
|
-
#write.first-line-indent p > .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; }
|
|
104
|
-
p > .md-image:only-child { display: inline-block; width: 100%; }
|
|
105
|
-
#write .MathJax_Display { margin: 0.8em 0px 0px; }
|
|
106
|
-
.md-math-block { width: 100%; }
|
|
107
|
-
.md-math-block:not(:empty)::after { display: none; }
|
|
108
|
-
.MathJax_ref { fill: currentcolor; }
|
|
109
|
-
[contenteditable="true"]:active, [contenteditable="true"]:focus, [contenteditable="false"]:active, [contenteditable="false"]:focus { outline: 0px; box-shadow: none; }
|
|
110
|
-
.md-task-list-item { position: relative; list-style-type: none; }
|
|
111
|
-
.task-list-item.md-task-list-item { padding-left: 0px; }
|
|
112
|
-
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
|
|
113
|
-
.math { font-size: 1rem; }
|
|
114
|
-
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
|
|
115
|
-
.md-toc-content { position: relative; margin-left: 0px; }
|
|
116
|
-
.md-toc-content::after, .md-toc::after { display: none; }
|
|
117
|
-
.md-toc-item { display: block; color: rgb(65, 131, 196); }
|
|
118
|
-
.md-toc-item a { text-decoration: none; }
|
|
119
|
-
.md-toc-inner:hover { text-decoration: underline; }
|
|
120
|
-
.md-toc-inner { display: inline-block; cursor: pointer; }
|
|
121
|
-
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
|
|
122
|
-
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
|
|
123
|
-
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
|
|
124
|
-
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
|
|
125
|
-
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
|
|
126
|
-
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
|
|
127
|
-
@media screen and (max-width: 48em) {
|
|
128
|
-
.md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
|
|
129
|
-
.md-toc-h4 .md-toc-inner { margin-left: 5em; }
|
|
130
|
-
.md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
|
|
131
|
-
.md-toc-h6 .md-toc-inner { margin-left: 8em; }
|
|
132
|
-
}
|
|
133
|
-
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
|
|
134
|
-
.footnote-line a:not(.reversefootnote) { color: inherit; }
|
|
135
|
-
.reversefootnote { font-family: ui-monospace, sans-serif; }
|
|
136
|
-
.md-attr { display: none; }
|
|
137
|
-
.md-fn-count::after { content: "."; }
|
|
138
|
-
code, pre, samp, tt { font-family: var(--monospace); }
|
|
139
|
-
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
|
|
140
|
-
.md-comment { color: rgb(162, 127, 3); opacity: 0.6; font-family: var(--monospace); }
|
|
141
|
-
code { text-align: left; vertical-align: initial; }
|
|
142
|
-
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
|
|
143
|
-
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
|
|
144
|
-
.md-diagram-panel > svg { max-width: 100%; }
|
|
145
|
-
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; height: auto; }
|
|
146
|
-
[lang="mermaid"] .node text { font-size: 1rem; }
|
|
147
|
-
table tr th { border-bottom: 0px; }
|
|
148
|
-
video { max-width: 100%; display: block; margin: 0px auto; }
|
|
149
|
-
iframe { max-width: 100%; width: 100%; border: none; }
|
|
150
|
-
.highlight td, .highlight tr { border: 0px; }
|
|
151
|
-
mark { background: rgb(255, 255, 0); color: rgb(0, 0, 0); }
|
|
152
|
-
.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }
|
|
153
|
-
.md-expand mark .md-meta { opacity: 0.3 !important; }
|
|
154
|
-
mark .md-meta { color: rgb(0, 0, 0); }
|
|
155
|
-
@media print {
|
|
156
|
-
.typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; }
|
|
157
|
-
}
|
|
158
|
-
.md-diagram-panel .messageText { stroke: none !important; }
|
|
159
|
-
.md-diagram-panel .start-state { fill: var(--node-fill); }
|
|
160
|
-
.md-diagram-panel .edgeLabel rect { opacity: 1 !important; }
|
|
161
|
-
.md-fences.md-fences-math { font-size: 1em; }
|
|
162
|
-
.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; }
|
|
163
|
-
.md-fences-advanced:not(.md-focus) { background: inherit; }
|
|
164
|
-
.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; }
|
|
165
|
-
.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; }
|
|
166
|
-
.typora-export-show-outline #write { --webkit-flex:2; flex: 2 1 0%; }
|
|
167
|
-
.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; }
|
|
168
|
-
@media screen and (max-width: 1024px) {
|
|
169
|
-
.typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; }
|
|
170
|
-
}
|
|
171
|
-
@media screen and (max-width: 800px) {
|
|
172
|
-
.typora-export-sidebar { display: none; }
|
|
173
|
-
}
|
|
174
|
-
.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; overflow-wrap: anywhere; }
|
|
175
|
-
.outline-content ul { margin-top: 0px; margin-bottom: 0px; }
|
|
176
|
-
.outline-content strong { font-weight: 400; }
|
|
177
|
-
.outline-expander { width: 1rem; height: 1.42857rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; }
|
|
178
|
-
.outline-expander::before { content: ""; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; }
|
|
179
|
-
.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; }
|
|
180
|
-
.outline-expander:hover::before { content: ""; }
|
|
181
|
-
.outline-h1 > .outline-item { padding-left: 0px; }
|
|
182
|
-
.outline-h2 > .outline-item { padding-left: 1em; }
|
|
183
|
-
.outline-h3 > .outline-item { padding-left: 2em; }
|
|
184
|
-
.outline-h4 > .outline-item { padding-left: 3em; }
|
|
185
|
-
.outline-h5 > .outline-item { padding-left: 4em; }
|
|
186
|
-
.outline-h6 > .outline-item { padding-left: 5em; }
|
|
187
|
-
.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; }
|
|
188
|
-
.outline-label:hover { text-decoration: underline; }
|
|
189
|
-
.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); }
|
|
190
|
-
.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left: 28px solid transparent; border-right: 28px solid transparent; }
|
|
191
|
-
.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; }
|
|
192
|
-
.outline-item-open > .outline-item > .outline-expander::before { content: ""; }
|
|
193
|
-
.outline-children { display: none; }
|
|
194
|
-
.info-panel-tab-wrapper { display: none; }
|
|
195
|
-
.outline-item-open > .outline-children { display: block; }
|
|
196
|
-
.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; }
|
|
197
|
-
.typora-export .outline-item:hover { margin-right: -8px; border-right: 8px solid transparent; }
|
|
198
|
-
.typora-export .outline-expander::before { content: "+"; font-family: inherit; top: -1px; }
|
|
199
|
-
.typora-export .outline-expander:hover::before, .typora-export .outline-item-open > .outline-item > .outline-expander::before { content: "−"; }
|
|
200
|
-
.typora-export-collapse-outline .outline-children { display: none; }
|
|
201
|
-
.typora-export-collapse-outline .outline-item-open > .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; }
|
|
202
|
-
.typora-export-no-collapse-outline .outline-expander::before { content: "" !important; }
|
|
203
|
-
.typora-export-show-outline .outline-item-active > .outline-item .outline-label { font-weight: 700; }
|
|
204
|
-
.md-inline-math-container mjx-container { zoom: 0.95; }
|
|
205
|
-
mjx-container { break-inside: avoid; }
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
.CodeMirror { height: auto; }
|
|
209
|
-
.CodeMirror.cm-s-inner { background: inherit; }
|
|
210
|
-
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
|
|
211
|
-
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
|
|
212
|
-
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
|
|
213
|
-
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
|
|
214
|
-
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
|
|
215
|
-
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
|
|
216
|
-
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
|
|
217
|
-
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
|
|
218
|
-
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
|
|
219
|
-
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
|
|
220
|
-
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
|
|
221
|
-
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
|
|
222
|
-
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
|
|
223
|
-
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
|
|
224
|
-
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
|
|
225
|
-
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
|
|
226
|
-
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
|
|
227
|
-
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
|
|
228
|
-
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
|
|
229
|
-
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
|
|
230
|
-
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
|
|
231
|
-
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
|
|
232
|
-
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
|
|
233
|
-
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
|
|
234
|
-
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
|
|
235
|
-
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
|
|
236
|
-
.cm-negative { color: rgb(221, 68, 68); }
|
|
237
|
-
.cm-positive { color: rgb(34, 153, 34); }
|
|
238
|
-
.cm-header, .cm-strong { font-weight: 700; }
|
|
239
|
-
.cm-del { text-decoration: line-through; }
|
|
240
|
-
.cm-em { font-style: italic; }
|
|
241
|
-
.cm-link { text-decoration: underline; }
|
|
242
|
-
.cm-error { color: red; }
|
|
243
|
-
.cm-invalidchar { color: red; }
|
|
244
|
-
.cm-constant { color: rgb(38, 139, 210); }
|
|
245
|
-
.cm-defined { color: rgb(181, 137, 0); }
|
|
246
|
-
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
|
|
247
|
-
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
|
|
248
|
-
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
|
|
249
|
-
.CodeMirror { position: relative; overflow: hidden; }
|
|
250
|
-
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
|
|
251
|
-
.CodeMirror-sizer { position: relative; }
|
|
252
|
-
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; outline: 0px; }
|
|
253
|
-
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
|
|
254
|
-
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: auto hidden; }
|
|
255
|
-
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
|
|
256
|
-
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
|
|
257
|
-
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 10px; z-index: 3; overflow-y: hidden; }
|
|
258
|
-
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
|
|
259
|
-
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
|
|
260
|
-
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
|
|
261
|
-
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
|
|
262
|
-
.CodeMirror-lines { cursor: text; }
|
|
263
|
-
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
|
|
264
|
-
.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; }
|
|
265
|
-
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
|
|
266
|
-
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
|
|
267
|
-
.CodeMirror-linebackground { position: absolute; inset: 0px; z-index: 0; }
|
|
268
|
-
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
|
|
269
|
-
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
|
|
270
|
-
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
|
|
271
|
-
.CodeMirror-measure pre { position: static; }
|
|
272
|
-
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
|
|
273
|
-
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
|
|
274
|
-
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
|
|
275
|
-
.cm-searching { background: rgba(255, 255, 0, 0.4); }
|
|
276
|
-
span.cm-underlined { text-decoration: underline; }
|
|
277
|
-
span.cm-strikethrough { text-decoration: line-through; }
|
|
278
|
-
.cm-tw-syntaxerror { color: rgb(255, 255, 255); background-color: rgb(153, 0, 0); }
|
|
279
|
-
.cm-tw-deleted { text-decoration: line-through; }
|
|
280
|
-
.cm-tw-header5 { font-weight: 700; }
|
|
281
|
-
.cm-tw-listitem:first-child { padding-left: 10px; }
|
|
282
|
-
.cm-tw-box { border-style: solid; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-color: inherit; border-top-width: 0px !important; }
|
|
283
|
-
.cm-tw-underline { text-decoration: underline; }
|
|
284
|
-
@media print {
|
|
285
|
-
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
:root {
|
|
290
|
-
--side-bar-bg-color: #fafafa;
|
|
291
|
-
--control-text-color: #777;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
@include-when-export url(https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext);
|
|
295
|
-
|
|
296
|
-
/* open-sans-regular - latin-ext_latin */
|
|
297
|
-
/* open-sans-italic - latin-ext_latin */
|
|
298
|
-
/* open-sans-700 - latin-ext_latin */
|
|
299
|
-
/* open-sans-700italic - latin-ext_latin */
|
|
300
|
-
html {
|
|
301
|
-
font-size: 16px;
|
|
302
|
-
-webkit-font-smoothing: antialiased;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
body {
|
|
306
|
-
font-family: "Open Sans","Clear Sans", "Helvetica Neue", Helvetica, Arial, 'Segoe UI Emoji', sans-serif;
|
|
307
|
-
color: rgb(51, 51, 51);
|
|
308
|
-
line-height: 1.6;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
#write {
|
|
312
|
-
max-width: 860px;
|
|
313
|
-
margin: 0 auto;
|
|
314
|
-
padding: 30px;
|
|
315
|
-
padding-bottom: 100px;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
@media only screen and (min-width: 1400px) {
|
|
319
|
-
#write {
|
|
320
|
-
max-width: 1024px;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
@media only screen and (min-width: 1800px) {
|
|
325
|
-
#write {
|
|
326
|
-
max-width: 1200px;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
#write > ul:first-child,
|
|
331
|
-
#write > ol:first-child{
|
|
332
|
-
margin-top: 30px;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
a {
|
|
336
|
-
color: #4183C4;
|
|
337
|
-
}
|
|
338
|
-
h1,
|
|
339
|
-
h2,
|
|
340
|
-
h3,
|
|
341
|
-
h4,
|
|
342
|
-
h5,
|
|
343
|
-
h6 {
|
|
344
|
-
position: relative;
|
|
345
|
-
margin-top: 1rem;
|
|
346
|
-
margin-bottom: 1rem;
|
|
347
|
-
font-weight: bold;
|
|
348
|
-
line-height: 1.4;
|
|
349
|
-
cursor: text;
|
|
350
|
-
}
|
|
351
|
-
h1:hover a.anchor,
|
|
352
|
-
h2:hover a.anchor,
|
|
353
|
-
h3:hover a.anchor,
|
|
354
|
-
h4:hover a.anchor,
|
|
355
|
-
h5:hover a.anchor,
|
|
356
|
-
h6:hover a.anchor {
|
|
357
|
-
text-decoration: none;
|
|
358
|
-
}
|
|
359
|
-
h1 tt,
|
|
360
|
-
h1 code {
|
|
361
|
-
font-size: inherit;
|
|
362
|
-
}
|
|
363
|
-
h2 tt,
|
|
364
|
-
h2 code {
|
|
365
|
-
font-size: inherit;
|
|
366
|
-
}
|
|
367
|
-
h3 tt,
|
|
368
|
-
h3 code {
|
|
369
|
-
font-size: inherit;
|
|
370
|
-
}
|
|
371
|
-
h4 tt,
|
|
372
|
-
h4 code {
|
|
373
|
-
font-size: inherit;
|
|
374
|
-
}
|
|
375
|
-
h5 tt,
|
|
376
|
-
h5 code {
|
|
377
|
-
font-size: inherit;
|
|
378
|
-
}
|
|
379
|
-
h6 tt,
|
|
380
|
-
h6 code {
|
|
381
|
-
font-size: inherit;
|
|
382
|
-
}
|
|
383
|
-
h1 {
|
|
384
|
-
font-size: 2.25em;
|
|
385
|
-
line-height: 1.2;
|
|
386
|
-
border-bottom: 1px solid #eee;
|
|
387
|
-
}
|
|
388
|
-
h2 {
|
|
389
|
-
font-size: 1.75em;
|
|
390
|
-
line-height: 1.225;
|
|
391
|
-
border-bottom: 1px solid #eee;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
/*@media print {
|
|
395
|
-
.typora-export h1,
|
|
396
|
-
.typora-export h2 {
|
|
397
|
-
border-bottom: none;
|
|
398
|
-
padding-bottom: initial;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.typora-export h1::after,
|
|
402
|
-
.typora-export h2::after {
|
|
403
|
-
content: "";
|
|
404
|
-
display: block;
|
|
405
|
-
height: 100px;
|
|
406
|
-
margin-top: -96px;
|
|
407
|
-
border-top: 1px solid #eee;
|
|
408
|
-
}
|
|
409
|
-
}*/
|
|
410
|
-
|
|
411
|
-
h3 {
|
|
412
|
-
font-size: 1.5em;
|
|
413
|
-
line-height: 1.43;
|
|
414
|
-
}
|
|
415
|
-
h4 {
|
|
416
|
-
font-size: 1.25em;
|
|
417
|
-
}
|
|
418
|
-
h5 {
|
|
419
|
-
font-size: 1em;
|
|
420
|
-
}
|
|
421
|
-
h6 {
|
|
422
|
-
font-size: 1em;
|
|
423
|
-
color: #777;
|
|
424
|
-
}
|
|
425
|
-
p,
|
|
426
|
-
blockquote,
|
|
427
|
-
ul,
|
|
428
|
-
ol,
|
|
429
|
-
dl,
|
|
430
|
-
table{
|
|
431
|
-
margin: 0.8em 0;
|
|
432
|
-
}
|
|
433
|
-
li>ol,
|
|
434
|
-
li>ul {
|
|
435
|
-
margin: 0 0;
|
|
436
|
-
}
|
|
437
|
-
hr {
|
|
438
|
-
height: 2px;
|
|
439
|
-
padding: 0;
|
|
440
|
-
margin: 16px 0;
|
|
441
|
-
background-color: #e7e7e7;
|
|
442
|
-
border: 0 none;
|
|
443
|
-
overflow: hidden;
|
|
444
|
-
box-sizing: content-box;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
li p.first {
|
|
448
|
-
display: inline-block;
|
|
449
|
-
}
|
|
450
|
-
ul,
|
|
451
|
-
ol {
|
|
452
|
-
padding-left: 30px;
|
|
453
|
-
}
|
|
454
|
-
ul:first-child,
|
|
455
|
-
ol:first-child {
|
|
456
|
-
margin-top: 0;
|
|
457
|
-
}
|
|
458
|
-
ul:last-child,
|
|
459
|
-
ol:last-child {
|
|
460
|
-
margin-bottom: 0;
|
|
461
|
-
}
|
|
462
|
-
blockquote {
|
|
463
|
-
border-left: 4px solid #dfe2e5;
|
|
464
|
-
padding: 0 15px;
|
|
465
|
-
color: #777777;
|
|
466
|
-
}
|
|
467
|
-
blockquote blockquote {
|
|
468
|
-
padding-right: 0;
|
|
469
|
-
}
|
|
470
|
-
table {
|
|
471
|
-
padding: 0;
|
|
472
|
-
word-break: initial;
|
|
473
|
-
}
|
|
474
|
-
table tr {
|
|
475
|
-
border: 1px solid #dfe2e5;
|
|
476
|
-
margin: 0;
|
|
477
|
-
padding: 0;
|
|
478
|
-
}
|
|
479
|
-
table tr:nth-child(2n),
|
|
480
|
-
thead {
|
|
481
|
-
background-color: #f8f8f8;
|
|
482
|
-
}
|
|
483
|
-
table th {
|
|
484
|
-
font-weight: bold;
|
|
485
|
-
border: 1px solid #dfe2e5;
|
|
486
|
-
border-bottom: 0;
|
|
487
|
-
margin: 0;
|
|
488
|
-
padding: 6px 13px;
|
|
489
|
-
}
|
|
490
|
-
table td {
|
|
491
|
-
border: 1px solid #dfe2e5;
|
|
492
|
-
margin: 0;
|
|
493
|
-
padding: 6px 13px;
|
|
494
|
-
}
|
|
495
|
-
table th:first-child,
|
|
496
|
-
table td:first-child {
|
|
497
|
-
margin-top: 0;
|
|
498
|
-
}
|
|
499
|
-
table th:last-child,
|
|
500
|
-
table td:last-child {
|
|
501
|
-
margin-bottom: 0;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
.CodeMirror-lines {
|
|
505
|
-
padding-left: 4px;
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
.code-tooltip {
|
|
509
|
-
box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);
|
|
510
|
-
border-top: 1px solid #eef2f2;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
.md-fences,
|
|
514
|
-
code,
|
|
515
|
-
tt {
|
|
516
|
-
border: 1px solid #e7eaed;
|
|
517
|
-
background-color: #f8f8f8;
|
|
518
|
-
border-radius: 3px;
|
|
519
|
-
padding: 0;
|
|
520
|
-
padding: 2px 4px 0px 4px;
|
|
521
|
-
font-size: 0.9em;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
code {
|
|
525
|
-
background-color: #f3f4f4;
|
|
526
|
-
padding: 0 2px 0 2px;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
.md-fences {
|
|
530
|
-
margin-bottom: 15px;
|
|
531
|
-
margin-top: 15px;
|
|
532
|
-
padding-top: 8px;
|
|
533
|
-
padding-bottom: 6px;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
.md-task-list-item > input {
|
|
538
|
-
margin-left: -1.3em;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
@media print {
|
|
542
|
-
html {
|
|
543
|
-
font-size: 13px;
|
|
544
|
-
}
|
|
545
|
-
pre {
|
|
546
|
-
page-break-inside: avoid;
|
|
547
|
-
word-wrap: break-word;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
.md-fences {
|
|
552
|
-
background-color: #f8f8f8;
|
|
553
|
-
}
|
|
554
|
-
#write pre.md-meta-block {
|
|
555
|
-
padding: 1rem;
|
|
556
|
-
font-size: 85%;
|
|
557
|
-
line-height: 1.45;
|
|
558
|
-
background-color: #f7f7f7;
|
|
559
|
-
border: 0;
|
|
560
|
-
border-radius: 3px;
|
|
561
|
-
color: #777777;
|
|
562
|
-
margin-top: 0 !important;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
.mathjax-block>.code-tooltip {
|
|
566
|
-
bottom: .375rem;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
.md-mathjax-midline {
|
|
570
|
-
background: #fafafa;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
#write>h3.md-focus:before{
|
|
574
|
-
left: -1.5625rem;
|
|
575
|
-
top: .375rem;
|
|
576
|
-
}
|
|
577
|
-
#write>h4.md-focus:before{
|
|
578
|
-
left: -1.5625rem;
|
|
579
|
-
top: .285714286rem;
|
|
580
|
-
}
|
|
581
|
-
#write>h5.md-focus:before{
|
|
582
|
-
left: -1.5625rem;
|
|
583
|
-
top: .285714286rem;
|
|
584
|
-
}
|
|
585
|
-
#write>h6.md-focus:before{
|
|
586
|
-
left: -1.5625rem;
|
|
587
|
-
top: .285714286rem;
|
|
588
|
-
}
|
|
589
|
-
.md-image>.md-meta {
|
|
590
|
-
/*border: 1px solid #ddd;*/
|
|
591
|
-
border-radius: 3px;
|
|
592
|
-
padding: 2px 0px 0px 4px;
|
|
593
|
-
font-size: 0.9em;
|
|
594
|
-
color: inherit;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
.md-tag {
|
|
598
|
-
color: #a7a7a7;
|
|
599
|
-
opacity: 1;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
.md-toc {
|
|
603
|
-
margin-top:20px;
|
|
604
|
-
padding-bottom:20px;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.sidebar-tabs {
|
|
608
|
-
border-bottom: none;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
#typora-quick-open {
|
|
612
|
-
border: 1px solid #ddd;
|
|
613
|
-
background-color: #f8f8f8;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
#typora-quick-open-item {
|
|
617
|
-
background-color: #FAFAFA;
|
|
618
|
-
border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;
|
|
619
|
-
border-style: solid;
|
|
620
|
-
border-width: 1px;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
/** focus mode */
|
|
624
|
-
.on-focus-mode blockquote {
|
|
625
|
-
border-left-color: rgba(85, 85, 85, 0.12);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
header, .context-menu, .megamenu-content, footer{
|
|
629
|
-
font-family: "Segoe UI", "Arial", sans-serif;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
.file-node-content:hover .file-node-icon,
|
|
633
|
-
.file-node-content:hover .file-node-open-state{
|
|
634
|
-
visibility: visible;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
.mac-seamless-mode #typora-sidebar {
|
|
638
|
-
background-color: #fafafa;
|
|
639
|
-
background-color: var(--side-bar-bg-color);
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
.md-lang {
|
|
643
|
-
color: #b4654d;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
/*.html-for-mac {
|
|
647
|
-
--item-hover-bg-color: #E6F0FE;
|
|
648
|
-
}*/
|
|
649
|
-
|
|
650
|
-
#md-notification .btn {
|
|
651
|
-
border: 0;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
.dropdown-menu .divider {
|
|
655
|
-
border-color: #e5e5e5;
|
|
656
|
-
opacity: 0.4;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
.ty-preferences .window-content {
|
|
660
|
-
background-color: #fafafa;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
.ty-preferences .nav-group-item.active {
|
|
664
|
-
color: white;
|
|
665
|
-
background: #999;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
.menu-item-container a.menu-style-btn {
|
|
669
|
-
background-color: #f5f8fa;
|
|
670
|
-
background-image: linear-gradient( 180deg , hsla(0, 0%, 100%, 0.8), hsla(0, 0%, 100%, 0));
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
</style><title>README-CN</title>
|
|
676
|
-
</head>
|
|
677
|
-
<body class='typora-export os-windows'><div class='typora-export-content'>
|
|
678
|
-
<div id='write' class=''><h1 id='iglees-sdk文档'><span>iGlees SDK文档</span></h1><p> </p><h2 id='sdk简介'><span>SDK简介</span></h2><p><span>iGlees SDK为Cocos开发者提供了广告、网络请求、加解密、缓存数据等功能。</span></p><p> </p><h2 id='sdk集成'><span>SDK集成</span></h2><h4 id='说明'><span>说明</span></h4><p><span>iGlees SDK的所有功能均放在IG命名空间,然后根据具体的功能模块进行调用。比如IG.IGSdk,IG.HttpWrapper等。</span></p><p> </p><h4 id='初始化sdk'><span>初始化SDK</span></h4><p><span>在使用iGlees SDK前,请务必先调用初始化方法完成SDK的初始,具体如下:</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><span><span></span>x</span></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* 初始化(注:使用SDK功能前调用,只需要调用一次,建议进入首个场景就调用)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param sys 当前系统对象 (CocosCreator<3.0时传cc.sys,CocosCreator>=3.0时传sys)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param reflection 反射对象(打包原生平台时需要设置,CocosCreator<=3.5时传jsb.reflection, CocosCreator>=3.6时传native.reflection)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param logLevel 日志等级(线上环境设置为LOG_ERROR或OFF)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param 是否初始化成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">*/</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">static</span> <span class="cm-variable">init</span>(<span class="cm-variable">sys</span>: <span class="cm-variable">any</span>, <span class="cm-variable">reflection</span><span class="cm-operator">?</span>: <span class="cm-variable">any</span>, <span class="cm-variable">logLevel</span><span class="cm-operator">?</span>: <span class="cm-variable">LOG_LEVEL</span>): <span class="cm-variable">boolean</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
679
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//初始化SDK</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">IG</span>.<span class="cm-property">IGSdk</span>.<span class="cm-property">init</span>(<span class="cm-variable">sys</span>, <span class="cm-variable">sys</span>.<span class="cm-property">isNative</span> <span class="cm-operator">?</span> <span class="cm-variable">jsb</span>.<span class="cm-property">reflection</span> : <span class="cm-atom">null</span>, <span class="cm-variable">IG</span>.<span class="cm-property">LOG_LEVEL</span>.<span class="cm-property">DEBUG</span>);</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 254px;"></div><div class="CodeMirror-gutters" style="display: none; height: 254px;"></div></div></div></pre><p> </p><h4 id='广告模块'><span>广告模块</span></h4><h6 id='初始化广告sdk'><span>初始化广告SDK</span></h6><p><span>在使用广告模块时,需先初始化广告SDK,具体如下:</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* 初始化广告SDK</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param initOpt 初始化可配置参数</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param callback 初始化回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">*/</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">static</span> <span class="cm-variable">init</span>(<span class="cm-variable">initOpt</span>: <span class="cm-variable">ASWInitOpt</span>, <span class="cm-variable">callback</span><span class="cm-operator">?</span>: <span class="cm-variable">ASWInitCallback</span>): <span class="cm-keyword">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//初始化广告SDK</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">initOpt</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">IG</span>.<span class="cm-property">ASWInitOpt</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">initOpt</span>.<span class="cm-property">mediaIdWeb</span> <span class="cm-operator">=</span> <span class="cm-string">'11'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">initOpt</span>.<span class="cm-property">mediaIdAndroid</span> <span class="cm-operator">=</span> <span class="cm-string">'9'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">initOpt</span>.<span class="cm-property">mediaIdIOS</span> <span class="cm-operator">=</span> <span class="cm-string">'10'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">initOpt</span>.<span class="cm-property">mediaId</span> <span class="cm-operator">=</span> <span class="cm-string">'11'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">initOpt</span>.<span class="cm-property">channel</span> <span class="cm-operator">=</span> <span class="cm-string">""</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">initOpt</span>.<span class="cm-property">customData</span> <span class="cm-operator">=</span> <span class="cm-string">""</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">initOpt</span>.<span class="cm-property">showLog</span> <span class="cm-operator">=</span> <span class="cm-atom">true</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">initOpt</span>.<span class="cm-property">test</span> <span class="cm-operator">=</span> <span class="cm-atom">true</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">IG</span>.<span class="cm-property">AdSdkWrapper</span>.<span class="cm-property">init</span>(<span class="cm-variable">initOpt</span>, (<span class="cm-def">code</span>, <span class="cm-def">msg</span>) <span class="cm-operator">=></span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">console</span>.<span class="cm-property">log</span>(<span class="cm-string-2">`Init sdk : code=${</span><span class="cm-variable-2">code</span><span class="cm-string-2">}</span> <span class="cm-string-2">, msg=${</span><span class="cm-variable-2">msg</span><span class="cm-string-2">}`</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 461px;"></div><div class="CodeMirror-gutters" style="display: none; height: 461px;"></div></div></div></pre><p><span>其中,初始化可配参数ASWInitOpt定义如下:</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 初始化参数</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">export</span> <span class="cm-keyword">class</span> <span class="cm-def">ASWInitOpt</span> <span class="cm-keyword">extends</span> <span class="cm-type">InitOpt</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//Web端媒体id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">mediaIdWeb</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//Android端媒体id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">mediaIdAndroid</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//iOS端媒体id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">mediaIdIOS</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//鸿蒙端媒体id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">mediaIdOpenHarmony</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
680
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 初始化可配置参数</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">export</span> <span class="cm-keyword">class</span> <span class="cm-def">InitOpt</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//媒体标识(必传)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">mediaId</span>: <span class="cm-type">string</span> <span class="cm-operator">=</span> <span class="cm-string">""</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//自定义渠道标识。广告数据可以根据自定义渠道进行拆分</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">channel</span>: <span class="cm-type">string</span> <span class="cm-operator">=</span> <span class="cm-string">""</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//自定义数据,最长255字符。激励视频服务端验证时,该数据会回调给服务器</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">customData</span>: <span class="cm-type">string</span> <span class="cm-operator">=</span> <span class="cm-string">""</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// 是否显示日志,默认不显示。线上环境应设置成false</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">showLog</span>: <span class="cm-type">boolean</span> <span class="cm-operator">=</span> <span class="cm-atom">false</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//是否打开测试模式。正式上线前请设置为false,否则将不产生收益</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">test</span>: <span class="cm-type">boolean</span> <span class="cm-operator">=</span> <span class="cm-atom">false</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 668px;"></div><div class="CodeMirror-gutters" style="display: none; height: 668px;"></div></div></div></pre><p> </p><h6 id='请求广告'><span>请求广告</span></h6><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* 请求广告</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param adOpt 请求广告可配置参数</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param callback 请求广告回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">*/</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">static</span> <span class="cm-variable">requestAd</span>(<span class="cm-variable">adOpt</span>: <span class="cm-variable">ASWAdOpt</span>, <span class="cm-variable">callback</span><span class="cm-operator">?</span>: <span class="cm-variable">ASWAdCallback</span>): <span class="cm-keyword">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
681
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//请求广告</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">adOpt</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">IG</span>.<span class="cm-property">ASWAdOpt</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">adOpt</span>.<span class="cm-property">adIdWeb</span> <span class="cm-operator">=</span> <span class="cm-string">'3'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">adOpt</span>.<span class="cm-property">adIdWechatGame</span> <span class="cm-operator">=</span> <span class="cm-string">'adunit-6c232b47c4cc6f9b'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">adOpt</span>.<span class="cm-property">adIdAndroid</span> <span class="cm-operator">=</span> <span class="cm-string">'37'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">adOpt</span>.<span class="cm-property">adType</span> <span class="cm-operator">=</span> <span class="cm-variable">IG</span>.<span class="cm-property">AD_TYPE</span>.<span class="cm-property">REWARD_VIDEO</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">IG</span>.<span class="cm-property">AdSdkWrapper</span>.<span class="cm-property">requestAd</span>(<span class="cm-variable">adOpt</span>, {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-property">onAdReward</span>(<span class="cm-def">adId</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">console</span>.<span class="cm-property">log</span>(<span class="cm-string-2">`ad[${</span><span class="cm-variable-2">adId</span><span class="cm-string-2">}] reward.`</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 415px;"></div><div class="CodeMirror-gutters" style="display: none; height: 415px;"></div></div></div></pre><p><span>其中,请求广告可配置参数ASWAdOpt定义如下:</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 请求广告参数</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">export</span> <span class="cm-keyword">class</span> <span class="cm-def">ASWAdOpt</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//广告类型(小游戏使用)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">adType</span>: <span class="cm-type">AD_TYPE</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//Web端广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">adIdWeb</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//Android端广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">adIdAndroid</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//iOS端广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">adIdIOS</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//鸿蒙端广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">adIdOpenHarmony</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//微信小游戏端广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">adIdWechatGame</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//抖音小游戏端广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">adIdDouYinGame</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 438px;"></div><div class="CodeMirror-gutters" style="display: none; height: 438px;"></div></div></div></pre><p><span>其中,请求广告回调ASWAdCallback定义如下:</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 请求广告回调接口</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">export</span> <span class="cm-keyword">interface</span> <span class="cm-def">ASWAdCallback</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 加载广告成功回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param adId 广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-property">onAdLoad</span><span class="cm-operator">?</span>(<span class="cm-def">adId</span>: <span class="cm-type">string</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
682
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 广告曝光回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param adId 广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-property">onAdShow</span><span class="cm-operator">?</span>(<span class="cm-def">adId</span>: <span class="cm-type">string</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
683
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 广告点击回调(Web平台不一定回调)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param adId 广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-property">onAdClick</span><span class="cm-operator">?</span>(<span class="cm-def">adId</span>: <span class="cm-type">string</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
684
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 激励视频可以奖励回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param adId 广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-property">onAdReward</span><span class="cm-operator">?</span>(<span class="cm-def">adId</span>: <span class="cm-type">string</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
685
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 激励视频观看完成回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param adId 广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-property">onAdComplete</span><span class="cm-operator">?</span>(<span class="cm-def">adId</span>: <span class="cm-type">string</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
686
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 广告关闭回调(Web平台不一定回调)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param adId 广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-property">onAdDismiss</span><span class="cm-operator">?</span>(<span class="cm-def">adId</span>: <span class="cm-type">string</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
687
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 广告加载失败回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param adId 广告位id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param code 错误码</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param msg 错误消息</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-property">onAdError</span><span class="cm-operator">?</span>(<span class="cm-def">adId</span>: <span class="cm-type">string</span>, <span class="cm-def">code</span>: <span class="cm-type">number</span>, <span class="cm-def">msg</span>: <span class="cm-type">string</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 1106px;"></div><div class="CodeMirror-gutters" style="display: none; height: 1106px;"></div></div></div></pre><p> </p><h4 id='网络请求模块'><span>网络请求模块</span></h4><h6 id='设置http请求配置'><span>设置HTTP请求配置</span></h6><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* 设置Http请求配置(请求之前设置)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param httpConfig Http请求配置</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">*/</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">static</span> <span class="cm-variable">setConfig</span>(<span class="cm-variable">httpConfig</span>: <span class="cm-variable">HttpWrapperConfig</span>): <span class="cm-keyword">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
688
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//构建HTTP请求配置</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">httpConfig</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">IG</span>.<span class="cm-property">HttpWrapperConfig</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">httpConfig</span>.<span class="cm-property">baseUrl</span> <span class="cm-operator">=</span> <span class="cm-string">'https://rx.dijikj.com/flkapi/'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">httpConfig</span>.<span class="cm-property">version</span> <span class="cm-operator">=</span> <span class="cm-string">'1.1.1'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">httpConfig</span>.<span class="cm-property">channel</span> <span class="cm-operator">=</span> <span class="cm-string">'officail'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//设置HTTP请求配置</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">IG</span>.<span class="cm-property">HttpWrapper</span>.<span class="cm-property">setConfig</span>(<span class="cm-variable">httpConfig</span>);</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 300px;"></div><div class="CodeMirror-gutters" style="display: none; height: 300px;"></div></div></div></pre><p><span>其中,HTTP配置HttpWrapperConfig定义如下:</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * Http请求配置</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">export</span> <span class="cm-keyword">class</span> <span class="cm-def">HttpWrapperConfig</span> <span class="cm-keyword">extends</span> <span class="cm-type">HttpConfig</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//请求基地址</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">baseUrl</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//客户端版本号</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">version</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//渠道标识</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">channel</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//签名前缀</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">signPrefix</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//AES加密秘钥</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">key</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//AES加密向量</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">iv</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
689
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * Http请求配置</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">export</span> <span class="cm-keyword">class</span> <span class="cm-def">HttpConfig</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//请求超时时间(ms)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-property">timeout</span>: <span class="cm-type">number</span> <span class="cm-operator">=</span> <span class="cm-number">5000</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 576px;"></div><div class="CodeMirror-gutters" style="display: none; height: 576px;"></div></div></div></pre><p> </p><h6 id='发起请求'><span>发起请求</span></h6><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* GET请求</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param path 请求路径</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param callback 请求回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">*/</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">get</span><span class="cm-operator"><</span><span class="cm-type">T</span> <span class="cm-keyword">extends</span> <span class="cm-type">HttpResData</span><span class="cm-operator">></span>(<span class="cm-variable">path</span>: <span class="cm-variable">string</span>, <span class="cm-variable">callback</span><span class="cm-operator">?</span>: <span class="cm-variable">HttpCallbackBean</span><span class="cm-operator"><</span><span class="cm-variable">T</span><span class="cm-operator">></span>): <span class="cm-keyword">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
690
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* POST请求</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param path 请求路径</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param params 请求参数</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* @param callback 请求回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">*/</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">post</span><span class="cm-operator"><</span><span class="cm-type">T</span> <span class="cm-keyword">extends</span> <span class="cm-type">HttpResData</span><span class="cm-operator">></span>(<span class="cm-variable">path</span>: <span class="cm-variable">string</span>, <span class="cm-variable">params</span><span class="cm-operator">?</span>: <span class="cm-variable">object</span>, <span class="cm-variable">callback</span><span class="cm-operator">?</span>: <span class="cm-variable">HttpCallbackBean</span><span class="cm-operator"><</span><span class="cm-variable">T</span><span class="cm-operator">></span>): <span class="cm-keyword">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
691
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
692
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//构建回调</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">callback</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">IG</span>.<span class="cm-property">HttpCallbackBean</span><span class="cm-operator"><</span><span class="cm-type">LoginResData</span><span class="cm-operator">></span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">callback</span>.<span class="cm-property">onFail</span> <span class="cm-operator">=</span> (<span class="cm-def">code</span>: <span class="cm-type">number</span>, <span class="cm-def">msg</span>: <span class="cm-type">string</span>) <span class="cm-operator">=></span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">console</span>.<span class="cm-property">error</span>(<span class="cm-string-2">`Http request fail: code=${</span><span class="cm-variable-2">code</span><span class="cm-string-2">}</span> <span class="cm-string-2">, msg=${</span><span class="cm-variable-2">msg</span><span class="cm-string-2">}`</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">};</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">callback</span>.<span class="cm-property">onRes</span> <span class="cm-operator">=</span> (<span class="cm-def">data</span>: <span class="cm-type">LoginResData</span>) <span class="cm-operator">=></span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">//缓存token</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">IG</span>.<span class="cm-property">HttpWrapper</span>.<span class="cm-property">setToken</span>(<span class="cm-variable-2">data</span>.<span class="cm-property">data</span>.<span class="cm-property">token</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//构建请求参数</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">param</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">LoginParam</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">param</span>.<span class="cm-property">type</span> <span class="cm-operator">=</span> <span class="cm-number">1</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">param</span>.<span class="cm-property">mobile</span> <span class="cm-operator">=</span> <span class="cm-string">'13617678127'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">param</span>.<span class="cm-property">code</span> <span class="cm-operator">=</span> <span class="cm-string">'123454321'</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//发起请求</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">new</span> <span class="cm-variable">IG</span>.<span class="cm-property">HttpWrapper</span>().<span class="cm-property">post</span><span class="cm-operator"><</span><span class="cm-type">LoginResData</span><span class="cm-operator">></span>(<span class="cm-string">'user/login'</span>, <span class="cm-variable">param</span>, <span class="cm-variable">callback</span>);</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 738px;"></div><div class="CodeMirror-gutters" style="display: none; height: 738px;"></div></div></div></pre><p> </p><h4 id='加解密模块'><span>加解密模块</span></h4><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* 加解密工具类</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">*/</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">export</span> <span class="cm-keyword">class</span> <span class="cm-def">CryptoUtil</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 设置配置(未设置时使用默认秘钥、向量)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param key 秘钥</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param iv 向量</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">setKey</span>(<span class="cm-def">key</span>: <span class="cm-type">string</span>, <span class="cm-def">iv</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 获取秘钥</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param key 当前设置的秘钥</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @returns 秘钥</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">private</span> <span class="cm-keyword">static</span> <span class="cm-property">getKey</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 获取向量</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param iv 当前设置的向量</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @returns 向量</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">private</span> <span class="cm-keyword">static</span> <span class="cm-property">getIv</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * MD5(32位小写)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param data 需要MD5的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @returns MD5后的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">md5</span>(<span class="cm-def">data</span>: <span class="cm-type">string</span>): <span class="cm-type">any</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * AES加密</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param data 需要AES加密的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param key 秘钥(未设置时,使用默认秘钥)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param iv 向量(未设置时,使用默认向量)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @returns AES加密后的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">aesEncrypty</span>(<span class="cm-def">data</span>: <span class="cm-type">string</span>, <span class="cm-def">key</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>, <span class="cm-def">iv</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>): <span class="cm-type">any</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * AES解密</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param data 需要AES解密的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param key 秘钥(未设置时,使用默认秘钥)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param iv 向量(未设置时,使用默认向量)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @returns AES解密后的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">aesDecrypt</span>(<span class="cm-def">data</span>: <span class="cm-type">string</span>, <span class="cm-def">key</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>, <span class="cm-def">iv</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>): <span class="cm-type">any</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * Base64加密</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param data 需要Base64加密的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @returns Base64加密后的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">base64Encrpty</span>(<span class="cm-def">data</span>: <span class="cm-type">string</span>): <span class="cm-type">any</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * BASE64 解密</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param data 需要Base64解密的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @returns Base64解密后的数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">base64Decrypt</span>(<span class="cm-def">data</span>: <span class="cm-type">string</span>): <span class="cm-type">any</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 生成符合UUID v4标准的唯一标识(优化版)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">uuid</span>(): <span class="cm-type">string</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
693
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 1636px;"></div><div class="CodeMirror-gutters" style="display: none; height: 1636px;"></div></div></div></pre><p> </p><h4 id='缓存模块'><span>缓存模块</span></h4><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="typescript" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="typescript"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.52344px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/**</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">* 本地存储工具类</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">*/</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">export</span> <span class="cm-keyword">class</span> <span class="cm-def">StorageUtil</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 检查是否可以缓存</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param key 数据key</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">private</span> <span class="cm-keyword">static</span> <span class="cm-property">checkAvailable</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 缓存数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param key 数据key</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param data 数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">setData</span>(<span class="cm-def">key</span>: <span class="cm-type">string</span>, <span class="cm-def">data</span>: <span class="cm-type">any</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 获取缓存数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param key 数据key</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @returns 数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">getData</span>(<span class="cm-def">key</span>: <span class="cm-type">string</span>): <span class="cm-type">string</span> <span class="cm-operator">|</span> <span class="cm-atom">null</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 安全缓存数据(数据会加密)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param key 数据key</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param data 数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param encryptKey 加密秘钥(未设置时,使用默认秘钥)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param encryptIv 加密向量(未设置时,使用默认向量)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">setDataSafely</span>(<span class="cm-def">key</span>: <span class="cm-type">string</span>, <span class="cm-def">data</span>: <span class="cm-type">any</span>, <span class="cm-def">encryptKey</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>, <span class="cm-def">encryptIv</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>): <span class="cm-type">void</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">/**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * 获取缓存数据(数据会解密)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param key 数据key</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param encryptKey 加密秘钥(未设置时,使用默认秘钥)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @param encryptIv 加密向量(未设置时,使用默认向量)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> * @returns 数据</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"> */</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">static</span> <span class="cm-property">getDataSafely</span>(<span class="cm-def">key</span>: <span class="cm-type">string</span>, <span class="cm-def">encryptKey</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>, <span class="cm-def">encryptIv</span><span class="cm-operator">?</span>: <span class="cm-type">string</span>): <span class="cm-type">string</span> <span class="cm-operator">|</span> <span class="cm-atom">null</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
|
|
694
|
-
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 1014px;"></div><div class="CodeMirror-gutters" style="display: none; height: 1014px;"></div></div></div></pre><p> </p></div></div>
|
|
695
|
-
</body>
|
|
696
|
-
</html>
|