little-wheels 1.2.4 → 1.2.5
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/dist/index.d.ts +4 -1
- package/dist/index.es.js +25 -24
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
export declare class AuthLogin {
|
|
9
9
|
APPID: string;
|
|
10
10
|
dev: boolean;
|
|
11
|
+
baseURL?: string;
|
|
11
12
|
private storage;
|
|
12
13
|
/**
|
|
13
14
|
* 构造函数,初始化SSO认证实例
|
|
14
15
|
* @param {AuthLoginType} config - 认证配置
|
|
15
16
|
* @param {string} config.APPID - 应用唯一标识
|
|
16
17
|
*/
|
|
17
|
-
constructor({ APPID, dev }: AuthLoginType);
|
|
18
|
+
constructor({ APPID, dev, baseURL }: AuthLoginType);
|
|
18
19
|
/**
|
|
19
20
|
* 执行单点登录流程
|
|
20
21
|
* @async
|
|
@@ -100,6 +101,7 @@ export declare interface AuthLoginType {
|
|
|
100
101
|
APPID: string;
|
|
101
102
|
dev?: boolean;
|
|
102
103
|
storage?: "localStorage";
|
|
104
|
+
baseURL?: string;
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
export declare interface CompanyItem {
|
|
@@ -395,6 +397,7 @@ export declare const useSSOApi: (authLogin: AuthLogin) => {
|
|
|
395
397
|
* @param params.extend 如果为 true 返回 position 和 department 字段,,代表用户的岗位和部门
|
|
396
398
|
*/
|
|
397
399
|
getUsers: (params: {
|
|
400
|
+
username?: string;
|
|
398
401
|
real_name?: string;
|
|
399
402
|
exact?: boolean;
|
|
400
403
|
enable?: boolean;
|
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var nn = Object.defineProperty;
|
|
2
2
|
var on = (r, e, n) => e in r ? nn(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
|
|
3
|
-
var
|
|
3
|
+
var Ee = (r, e, n) => on(r, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
class an {
|
|
5
5
|
constructor(e) {
|
|
6
|
-
|
|
6
|
+
Ee(this, "appId");
|
|
7
7
|
this.appId = e;
|
|
8
8
|
}
|
|
9
9
|
setItem(e, n) {
|
|
@@ -57,7 +57,7 @@ function fn(r) {
|
|
|
57
57
|
}), n;
|
|
58
58
|
}
|
|
59
59
|
var Le, Vr;
|
|
60
|
-
function
|
|
60
|
+
function Pe() {
|
|
61
61
|
return Vr || (Vr = 1, Le = TypeError), Le;
|
|
62
62
|
}
|
|
63
63
|
const ln = {}, cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -148,12 +148,12 @@ function xe() {
|
|
|
148
148
|
}
|
|
149
149
|
if (H(o)) {
|
|
150
150
|
var Wr = B ? g.call(String(o), /^(Symbol\(.*\))_[^)]*$/, "$1") : j.call(o);
|
|
151
|
-
return typeof o == "object" && !B ?
|
|
151
|
+
return typeof o == "object" && !B ? Ie(Wr) : Wr;
|
|
152
152
|
}
|
|
153
153
|
if (Yt(o)) {
|
|
154
|
-
for (var
|
|
155
|
-
|
|
156
|
-
return
|
|
154
|
+
for (var Re = "<" + w.call(String(o.nodeName)), Me = o.attributes || [], $e = 0; $e < Me.length; $e++)
|
|
155
|
+
Re += " " + Me[$e].name + "=" + fe(ae(Me[$e].value), "double", T);
|
|
156
|
+
return Re += ">", o.childNodes && o.childNodes.length && (Re += "..."), Re += "</" + w.call(String(o.nodeName)) + ">", Re;
|
|
157
157
|
}
|
|
158
158
|
if (le(o)) {
|
|
159
159
|
if (o.length === 0)
|
|
@@ -190,13 +190,13 @@ function xe() {
|
|
|
190
190
|
if (we(o))
|
|
191
191
|
return De("WeakRef");
|
|
192
192
|
if (F(o))
|
|
193
|
-
return
|
|
193
|
+
return Ie(re(Number(o)));
|
|
194
194
|
if (X(o))
|
|
195
|
-
return
|
|
195
|
+
return Ie(re(D.call(o)));
|
|
196
196
|
if (W(o))
|
|
197
|
-
return
|
|
197
|
+
return Ie(c.call(o));
|
|
198
198
|
if (N(o))
|
|
199
|
-
return
|
|
199
|
+
return Ie(re(String(o)));
|
|
200
200
|
if (typeof window < "u" && o === window)
|
|
201
201
|
return "{ [object Window] }";
|
|
202
202
|
if (typeof globalThis < "u" && o === globalThis || typeof Qr < "u" && o === Qr)
|
|
@@ -375,7 +375,7 @@ function xe() {
|
|
|
375
375
|
}[o];
|
|
376
376
|
return x ? "\\" + x : "\\x" + (o < 16 ? "0" : "") + p.call(o.toString(16));
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Ie(t) {
|
|
379
379
|
return "Object(" + t + ")";
|
|
380
380
|
}
|
|
381
381
|
function De(t) {
|
|
@@ -439,7 +439,7 @@ var He, Yr;
|
|
|
439
439
|
function pn() {
|
|
440
440
|
if (Yr) return He;
|
|
441
441
|
Yr = 1;
|
|
442
|
-
var r = /* @__PURE__ */ xe(), e = /* @__PURE__ */
|
|
442
|
+
var r = /* @__PURE__ */ xe(), e = /* @__PURE__ */ Pe(), n = function(v, E, m) {
|
|
443
443
|
for (var d = v, h; (h = d.next) != null; d = h)
|
|
444
444
|
if (h.key === E)
|
|
445
445
|
return d.next = h.next, m || (h.next = /** @type {NonNullable<typeof list.next>} */
|
|
@@ -716,7 +716,7 @@ var wr, It;
|
|
|
716
716
|
function zt() {
|
|
717
717
|
if (It) return wr;
|
|
718
718
|
It = 1;
|
|
719
|
-
var r = qe(), e = /* @__PURE__ */
|
|
719
|
+
var r = qe(), e = /* @__PURE__ */ Pe(), n = Fr(), a = qn();
|
|
720
720
|
return wr = function(y) {
|
|
721
721
|
if (y.length < 1 || typeof y[0] != "function")
|
|
722
722
|
throw new e("a function is required");
|
|
@@ -773,7 +773,7 @@ var Er, $t;
|
|
|
773
773
|
function Cr() {
|
|
774
774
|
if ($t) return Er;
|
|
775
775
|
$t = 1;
|
|
776
|
-
var r, e = /* @__PURE__ */ Gt(), n = /* @__PURE__ */ yn(), a = /* @__PURE__ */ dn(), s = /* @__PURE__ */ vn(), y = /* @__PURE__ */ hn(), I = /* @__PURE__ */ gn(), v = /* @__PURE__ */
|
|
776
|
+
var r, e = /* @__PURE__ */ Gt(), n = /* @__PURE__ */ yn(), a = /* @__PURE__ */ dn(), s = /* @__PURE__ */ vn(), y = /* @__PURE__ */ hn(), I = /* @__PURE__ */ gn(), v = /* @__PURE__ */ Pe(), E = /* @__PURE__ */ mn(), m = /* @__PURE__ */ Sn(), d = /* @__PURE__ */ wn(), h = /* @__PURE__ */ bn(), S = /* @__PURE__ */ An(), l = /* @__PURE__ */ On(), c = /* @__PURE__ */ En(), b = /* @__PURE__ */ In(), i = Function, u = function(L) {
|
|
777
777
|
try {
|
|
778
778
|
return i('"use strict"; return (' + L + ").constructor;")();
|
|
779
779
|
} catch {
|
|
@@ -1026,7 +1026,7 @@ var Ir, xt;
|
|
|
1026
1026
|
function Qt() {
|
|
1027
1027
|
if (xt) return Ir;
|
|
1028
1028
|
xt = 1;
|
|
1029
|
-
var r = /* @__PURE__ */ Cr(), e = /* @__PURE__ */ Kt(), n = /* @__PURE__ */ xe(), a = /* @__PURE__ */
|
|
1029
|
+
var r = /* @__PURE__ */ Cr(), e = /* @__PURE__ */ Kt(), n = /* @__PURE__ */ xe(), a = /* @__PURE__ */ Pe(), s = r("%Map%", !0), y = e("Map.prototype.get", !0), I = e("Map.prototype.set", !0), v = e("Map.prototype.has", !0), E = e("Map.prototype.delete", !0), m = e("Map.prototype.size", !0);
|
|
1030
1030
|
return Ir = !!s && /** @type {Exclude<import('.'), false>} */
|
|
1031
1031
|
function() {
|
|
1032
1032
|
var h, S = {
|
|
@@ -1059,7 +1059,7 @@ var Rr, qt;
|
|
|
1059
1059
|
function Mn() {
|
|
1060
1060
|
if (qt) return Rr;
|
|
1061
1061
|
qt = 1;
|
|
1062
|
-
var r = /* @__PURE__ */ Cr(), e = /* @__PURE__ */ Kt(), n = /* @__PURE__ */ xe(), a = Qt(), s = /* @__PURE__ */
|
|
1062
|
+
var r = /* @__PURE__ */ Cr(), e = /* @__PURE__ */ Kt(), n = /* @__PURE__ */ xe(), a = Qt(), s = /* @__PURE__ */ Pe(), y = r("%WeakMap%", !0), I = e("WeakMap.prototype.get", !0), v = e("WeakMap.prototype.set", !0), E = e("WeakMap.prototype.has", !0), m = e("WeakMap.prototype.delete", !0);
|
|
1063
1063
|
return Rr = y ? (
|
|
1064
1064
|
/** @type {Exclude<import('.'), false>} */
|
|
1065
1065
|
function() {
|
|
@@ -1094,7 +1094,7 @@ var _r, Dt;
|
|
|
1094
1094
|
function Nn() {
|
|
1095
1095
|
if (Dt) return _r;
|
|
1096
1096
|
Dt = 1;
|
|
1097
|
-
var r = /* @__PURE__ */
|
|
1097
|
+
var r = /* @__PURE__ */ Pe(), e = /* @__PURE__ */ xe(), n = pn(), a = Qt(), s = Mn(), y = s || a || n;
|
|
1098
1098
|
return _r = function() {
|
|
1099
1099
|
var v, E = {
|
|
1100
1100
|
assert: function(m) {
|
|
@@ -1637,7 +1637,7 @@ const de = /* @__PURE__ */ un(Wn), G = {
|
|
|
1637
1637
|
};
|
|
1638
1638
|
let Dr = 0;
|
|
1639
1639
|
async function U(r, e, n) {
|
|
1640
|
-
const a = await fetch(e, {
|
|
1640
|
+
const a = await fetch((r.baseURL || "") + e, {
|
|
1641
1641
|
headers: {
|
|
1642
1642
|
"Content-Type": "application/json",
|
|
1643
1643
|
Authorization: "Bearer " + r.getToken()
|
|
@@ -1859,11 +1859,12 @@ class Jn {
|
|
|
1859
1859
|
* @param {AuthLoginType} config - 认证配置
|
|
1860
1860
|
* @param {string} config.APPID - 应用唯一标识
|
|
1861
1861
|
*/
|
|
1862
|
-
constructor({ APPID: e, dev: n }) {
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
this
|
|
1862
|
+
constructor({ APPID: e, dev: n, baseURL: a }) {
|
|
1863
|
+
Ee(this, "APPID");
|
|
1864
|
+
Ee(this, "dev");
|
|
1865
|
+
Ee(this, "baseURL");
|
|
1866
|
+
Ee(this, "storage");
|
|
1867
|
+
this.APPID = e, this.storage = new an(e), this.dev = n || !1, this.baseURL = a || "";
|
|
1867
1868
|
}
|
|
1868
1869
|
/**
|
|
1869
1870
|
* 执行单点登录流程
|