@pubinfo-nightly/module-auth 2025.12.9 → 2025.12.26
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/components/LoginWithFourA/index.d.ts +4 -4
- package/dist/components/RedirectLogin/index.d.ts +4 -4
- package/dist/context.d.ts +2 -2
- package/dist/core.d.ts +1 -1
- package/dist/helper.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +156 -177
- package/dist/interface.d.ts +1 -1
- package/dist/pages/auth.d.ts +4 -4
- package/dist/providers/4A.d.ts +1 -1
- package/dist/providers/4A.js +18 -20
- package/dist/providers/credentials.d.ts +1 -1
- package/dist/providers/credentials.js +8 -10
- package/dist/providers/ding-zj.d.ts +1 -1
- package/dist/providers/ding-zj.js +43 -48
- package/dist/providers/sso.d.ts +1 -1
- package/dist/providers/sso.js +17 -22
- package/package.json +3 -3
package/dist/interface.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RouteLocationRaw } from '
|
|
1
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
2
2
|
export type Recordable = Record<string, any>;
|
|
3
3
|
export type Fn<T = any, K = any> = (params?: Recordable & T) => Promise<K> | K;
|
|
4
4
|
export type FnApi<T = any> = (params: Recordable & T, baseURL: string) => Promise<any>;
|
package/dist/pages/auth.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export declare const PageAuth: import(
|
|
1
|
+
export declare const PageAuth: import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
2
2
|
type: StringConstructor;
|
|
3
3
|
redirectTo: FunctionConstructor;
|
|
4
4
|
authenticate: FunctionConstructor;
|
|
5
|
-
}>, () =>
|
|
5
|
+
}>, () => globalThis.VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
6
6
|
[key: string]: any;
|
|
7
|
-
}>, {}, {}, {}, import(
|
|
7
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
8
8
|
type: StringConstructor;
|
|
9
9
|
redirectTo: FunctionConstructor;
|
|
10
10
|
authenticate: FunctionConstructor;
|
|
11
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import(
|
|
11
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/dist/providers/4A.d.ts
CHANGED
package/dist/providers/4A.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
function FourA(e) {
|
|
2
|
+
let { clientId: t, redirectUri: n } = e;
|
|
3
|
+
return {
|
|
4
|
+
id: "4A",
|
|
5
|
+
name: "4A登录",
|
|
6
|
+
type: "oauth",
|
|
7
|
+
signIn: {
|
|
8
|
+
url: "http://134.108.76.137:7001/index",
|
|
9
|
+
params: {
|
|
10
|
+
response_type: "code",
|
|
11
|
+
client_id: t,
|
|
12
|
+
redirect_uri: n
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
authenticate: "/bs/loginBy4a",
|
|
16
|
+
...e
|
|
17
|
+
};
|
|
18
18
|
}
|
|
19
|
-
export {
|
|
20
|
-
i as default
|
|
21
|
-
};
|
|
19
|
+
export { FourA as default };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
function Credentials(e) {
|
|
2
|
+
return {
|
|
3
|
+
id: "credentials",
|
|
4
|
+
name: "凭证登录",
|
|
5
|
+
type: "custom",
|
|
6
|
+
...e
|
|
7
|
+
};
|
|
8
8
|
}
|
|
9
|
-
export {
|
|
10
|
-
t as default
|
|
11
|
-
};
|
|
9
|
+
export { Credentials as default };
|
|
@@ -1,49 +1,44 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
initQRCode: e.mode === "embed" ? o : void 0,
|
|
44
|
-
...e
|
|
45
|
-
};
|
|
1
|
+
function DingZJ(e) {
|
|
2
|
+
let { clientId: t, redirectUri: n } = e;
|
|
3
|
+
return {
|
|
4
|
+
id: "ding-zj",
|
|
5
|
+
name: "浙政钉登录",
|
|
6
|
+
type: "oauth",
|
|
7
|
+
signIn: {
|
|
8
|
+
redirect: {
|
|
9
|
+
url: "https://openplatform-pro.ding.zj.gov.cn/oauth2/auth.htm",
|
|
10
|
+
params: {
|
|
11
|
+
response_type: "code",
|
|
12
|
+
client_id: t,
|
|
13
|
+
redirect_uri: n,
|
|
14
|
+
scope: "get_user_info",
|
|
15
|
+
authType: "QRCODE"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
embed: {
|
|
19
|
+
url: "https://login-pro.ding.zj.gov.cn/oauth2/auth.htm",
|
|
20
|
+
params: {
|
|
21
|
+
response_type: "code",
|
|
22
|
+
client_id: t,
|
|
23
|
+
redirect_uri: n,
|
|
24
|
+
scope: "get_user_info",
|
|
25
|
+
authType: "QRCODE",
|
|
26
|
+
embedMode: "true"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}[e.mode],
|
|
30
|
+
authenticate: "/bs/loginByDingZJ",
|
|
31
|
+
initQRCode: e.mode === "embed" ? (e, t) => {
|
|
32
|
+
if (!document.getElementById(t.id)) throw Error(`未找到id为${t.id}的DOM元素`);
|
|
33
|
+
let n = document.createElement("iframe");
|
|
34
|
+
n.src = e, n.width = "200", n.height = "200", document.appendChild(n), window.addEventListener("message", (e) => {
|
|
35
|
+
if (t.redirectUri) {
|
|
36
|
+
let n = new URL(t.redirectUri);
|
|
37
|
+
n.search = new URLSearchParams(e.data).toString(), window.location.href = n.toString();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
} : void 0,
|
|
41
|
+
...e
|
|
42
|
+
};
|
|
46
43
|
}
|
|
47
|
-
export {
|
|
48
|
-
g as default
|
|
49
|
-
};
|
|
44
|
+
export { DingZJ as default };
|
package/dist/providers/sso.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProviderOptions, ProviderUserOptions } from '
|
|
1
|
+
import type { ProviderOptions, ProviderUserOptions } from '@/interface';
|
|
2
2
|
export interface SsoOptions extends ProviderUserOptions {
|
|
3
3
|
/**
|
|
4
4
|
* 登录类型,根据调用 `/app/oauth/generateCode` 接口时传递的 `grantType` 参数值判断:
|
package/dist/providers/sso.js
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)).json(),
|
|
18
|
-
...t
|
|
19
|
-
};
|
|
1
|
+
function Sso(e = {}) {
|
|
2
|
+
let { loginType: t = "defaultOauth2" } = e;
|
|
3
|
+
return {
|
|
4
|
+
id: "sso",
|
|
5
|
+
name: "SSO统一账号登录",
|
|
6
|
+
type: "custom",
|
|
7
|
+
authenticate: async (e, n) => await (await fetch(`${n}/auth/ssoLogin`, {
|
|
8
|
+
headers: { "Content-Type": "application/json" },
|
|
9
|
+
method: "POST",
|
|
10
|
+
body: JSON.stringify({
|
|
11
|
+
...e,
|
|
12
|
+
loginType: t
|
|
13
|
+
})
|
|
14
|
+
})).json(),
|
|
15
|
+
...e
|
|
16
|
+
};
|
|
20
17
|
}
|
|
21
|
-
export {
|
|
22
|
-
o as default
|
|
23
|
-
};
|
|
18
|
+
export { Sso as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo-nightly/module-auth",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2025.12.
|
|
4
|
+
"version": "2025.12.26",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"node": "^20.19.0 || >=22.12.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"pubinfo-nightly": "2025.12.
|
|
26
|
+
"pubinfo-nightly": "2025.12.26"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"pubinfo-nightly": "2025.12.
|
|
29
|
+
"pubinfo-nightly": "2025.12.26"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"dev": "pubinfo build --watch",
|