labull-framework 1.4.1 → 3.0.0

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.
@@ -16,9 +16,11 @@ export interface AuthUser {
16
16
  name: string;
17
17
  /** 工号(Authing 的 `username` 同步过来的;没有就是 null)。 */
18
18
  workId: string | null;
19
- /** 🔴 "是不是管理员" = 这个布尔位(Django 的 `is_staff`)。前端只拿它做**显隐**,授权全在后端。 */
20
- isStaff: boolean;
19
+ /** 🔴 "是不是管理员" = **有没有 `labull_framework.edit_magic_block`**(直接给的 / 经权限包给的都算)。前端只拿它做**显隐**,授权全在后端。 */
20
+ isAdmin: boolean;
21
+ /** 所在 Django 组的名字(**组只是权限包**:只给人看/排查,别拿组名做判断)。 */
21
22
  groups: string[];
23
+ /** 有效权限(`app_label.codename`,直接给的 + 经组给的)—— **这才是判据**。 */
22
24
  permissions: string[];
23
25
  }
24
26
  export declare function authHeaders(method?: string, json?: boolean): Record<string, string>;
@@ -55,7 +57,7 @@ export interface AuthGateOptions {
55
57
  export declare function createAuthGate(options?: AuthGateOptions): AuthGate;
56
58
  export declare function useAuth(): {
57
59
  user: Ref<AuthUser | null, AuthUser | null>;
58
- isStaff: import("vue").ComputedRef<boolean>;
60
+ isAdmin: import("vue").ComputedRef<boolean>;
59
61
  /** 🔴 只是界面提示位(本地读得到 CSRF cookie 就算),**不是授权判据**:要挡就在后端挡。 */
60
62
  isAuthenticated: () => boolean;
61
63
  refresh: () => Promise<AuthUser | null>;
package/dist/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as e, P as o, a as t, b as l, _ as T, U as b, i as r, l as i } from "./chunk-index-3dQJWK2S.js";
1
+ import { A as e, P as o, a as t, b as l, _ as T, U as b, i as r, l as i } from "./chunk-index-Bf5t2QKZ.js";
2
2
  import { T as n, a as p, c as u, f as d, i as P, b as f, o as x, p as A, s as v, u as C, d as S } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-Fky1ghd2.js";
3
3
  export {
4
4
  e as AppSearch,
package/package.json CHANGED
@@ -1,67 +1,67 @@
1
- {
2
- "name": "labull-framework",
3
- "version": "1.4.1",
4
- "private": false,
5
- "type": "module",
6
- "description": "Labull 前端 SDK:主题 CSS + 登录态 / 外壳组件 / magic block(四块合一,一个包)",
7
- "license": "MIT",
8
- "sideEffects": [
9
- "*.css",
10
- "./dist/*.css"
11
- ],
12
- "files": [
13
- "dist",
14
- "README.md",
15
- "LICENSE"
16
- ],
17
- "main": "./dist/index.js",
18
- "module": "./dist/index.js",
19
- "types": "./dist/index.d.ts",
20
- "exports": {
21
- ".": {
22
- "types": "./dist/index.d.ts",
23
- "import": "./dist/index.js"
24
- },
25
- "./theme": {
26
- "types": "./dist/theme.d.ts",
27
- "import": "./dist/theme.js"
28
- },
29
- "./ui": {
30
- "types": "./dist/ui.d.ts",
31
- "import": "./dist/ui.js"
32
- },
33
- "./auth": {
34
- "types": "./dist/auth.d.ts",
35
- "import": "./dist/auth.js"
36
- },
37
- "./magic-block": {
38
- "types": "./dist/magic-block.d.ts",
39
- "import": "./dist/magic-block.js"
40
- },
41
- "./style.css": "./dist/style.css",
42
- "./package.json": "./package.json"
43
- },
44
- "peerDependencies": {
45
- "vue": "^3.4"
46
- },
47
- "peerDependenciesMeta": {
48
- "vue-router": {
49
- "optional": true
50
- }
51
- },
52
- "scripts": {
53
- "clean": "node -e \"import('node:fs').then(fs=>{for(const d of ['dist','dist-types'])fs.rmSync(d,{recursive:true,force:true})})\"",
54
- "build:js": "vite build",
55
- "build:types": "vue-tsc -p tsconfig.build.json && node flatten-types.mjs",
56
- "build": "npm run build:js && npm run build:types && node self-check.mjs",
57
- "pack:check": "npm pack --dry-run"
58
- },
59
- "devDependencies": {
60
- "@vitejs/plugin-vue": "^5.2.4",
61
- "typescript": "^5.9.3",
62
- "vite": "^5.4.21",
63
- "vue": "^3.5.43",
64
- "vue-router": "^4.6.4",
65
- "vue-tsc": "^2.2.12"
66
- }
67
- }
1
+ {
2
+ "name": "labull-framework",
3
+ "version": "3.0.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Labull 前端 SDK:主题 CSS + 登录态 / 外壳组件 / magic block(四块合一,一个包)",
7
+ "license": "MIT",
8
+ "sideEffects": [
9
+ "*.css",
10
+ "./dist/*.css"
11
+ ],
12
+ "files": [
13
+ "dist",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "main": "./dist/index.js",
18
+ "module": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js"
24
+ },
25
+ "./theme": {
26
+ "types": "./dist/theme.d.ts",
27
+ "import": "./dist/theme.js"
28
+ },
29
+ "./ui": {
30
+ "types": "./dist/ui.d.ts",
31
+ "import": "./dist/ui.js"
32
+ },
33
+ "./auth": {
34
+ "types": "./dist/auth.d.ts",
35
+ "import": "./dist/auth.js"
36
+ },
37
+ "./magic-block": {
38
+ "types": "./dist/magic-block.d.ts",
39
+ "import": "./dist/magic-block.js"
40
+ },
41
+ "./style.css": "./dist/style.css",
42
+ "./package.json": "./package.json"
43
+ },
44
+ "peerDependencies": {
45
+ "vue": "^3.4"
46
+ },
47
+ "peerDependenciesMeta": {
48
+ "vue-router": {
49
+ "optional": true
50
+ }
51
+ },
52
+ "scripts": {
53
+ "clean": "node -e \"import('node:fs').then(fs=>{for(const d of ['dist','dist-types'])fs.rmSync(d,{recursive:true,force:true})})\"",
54
+ "build:js": "vite build",
55
+ "build:types": "vue-tsc -p tsconfig.build.json && node flatten-types.mjs",
56
+ "build": "npm run build:js && npm run build:types && node self-check.mjs",
57
+ "pack:check": "npm pack --dry-run"
58
+ },
59
+ "devDependencies": {
60
+ "@vitejs/plugin-vue": "^5.2.4",
61
+ "typescript": "^5.9.3",
62
+ "vite": "^5.4.21",
63
+ "vue": "^3.5.43",
64
+ "vue-router": "^4.6.4",
65
+ "vue-tsc": "^2.2.12"
66
+ }
67
+ }