befly-admin-ui 1.8.22 → 1.8.24

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.
@@ -11,7 +11,7 @@
11
11
 
12
12
  <div class="main-content">
13
13
  <div class="main-table">
14
- <TTable :data="$Data.rows" :columns="tableColumns" :loading="$Data.loading" :active-row-keys="$Data.activeRowKeys" :row-key="rowKey" :height="tableHeight" active-row-type="single" @active-change="onActiveChange">
14
+ <TTable :data="$Data.rows" :columns="tableColumns" :loading="$Data.loading" :active-row-keys="$Data.activeRowKeys" :row-key="rowKey" :height="resolvedTableHeight" active-row-type="single" @active-change="onActiveChange">
15
15
  <template #operation="scope">
16
16
  <slot name="operation" v-bind="buildOperationSlotProps(scope)"></slot>
17
17
  </template>
@@ -60,6 +60,10 @@ const props = defineProps({
60
60
  type: String,
61
61
  default: "calc(100vh - var(--search-height) - var(--pagination-height) - var(--layout-gap) * 4)"
62
62
  },
63
+ isPagination: {
64
+ type: Boolean,
65
+ default: true
66
+ },
63
67
  pageSize: {
64
68
  type: Number,
65
69
  default: 30
@@ -200,6 +204,13 @@ const tableColumns = computed(() => columnsMeta.value.tableColumns);
200
204
 
201
205
  const detailFields = computed(() => columnsMeta.value.detailFields);
202
206
 
207
+ const resolvedTableHeight = computed(() => {
208
+ if (props.isPagination) {
209
+ return props.tableHeight;
210
+ }
211
+ return "calc(100vh - var(--search-height) - var(--layout-gap) * 2)";
212
+ });
213
+
203
214
  const forwardedTableSlotNames = computed(() => {
204
215
  if (Array.isArray(props.tableSlotNames) && props.tableSlotNames.length > 0) {
205
216
  const out = [];
@@ -7,7 +7,7 @@
7
7
  <div class="logo-icon">
8
8
  <AppIcon style="width: 24px; height: 24px; color: var(--primary-color)" />
9
9
  </div>
10
- <h2>{{ appTitle }}</h2>
10
+ <h2>{{ $Config.appTitle }}</h2>
11
11
  </div>
12
12
 
13
13
  <!-- 菜单区域 -->
@@ -45,7 +45,7 @@
45
45
  <span>系统设置</span>
46
46
  </div>
47
47
  <div class="footer-user">
48
- <t-upload :action="uploadPath" :headers="uploadHeaders" :show-upload-list="false" accept="image/*" @success="onAvatarUploadSuccess">
48
+ <t-upload :action="$Config.uploadPath" :headers="uploadHeaders" :show-upload-list="false" accept="image/*" @success="onAvatarUploadSuccess">
49
49
  <div class="user-avatar" :class="{ 'has-avatar': $Data.userInfo.avatar }">
50
50
  <img v-if="$Data.userInfo.avatar" :src="$Data.userInfo.avatar" alt="avatar" />
51
51
  <UserIcon v-else style="width: 16px; height: 16px; color: #fff" />
@@ -82,14 +82,11 @@ import { CloudIcon, CloseCircleIcon, CodeIcon, LinkIcon, MenuIcon, SettingIcon,
82
82
  import { reactive, watch } from "vue";
83
83
  import { useRoute, useRouter } from "vue-router";
84
84
  import { $Http } from "@/plugins/http.js";
85
+ import { $Config } from "@/plugins/config.js";
85
86
 
86
87
  const router = useRouter();
87
88
  const route = useRoute();
88
- const uploadHeaders = { Authorization: localStorage.getItem("yicode-token") || "" };
89
-
90
- const loginPath = "/core/login";
91
- const appTitle = import.meta.env.VITE_APP_TITLE;
92
- const uploadPath = import.meta.env.VITE_UPLOAD_PATH;
89
+ const uploadHeaders = { Authorization: localStorage.getItem($Config.tokenName) || "" };
93
90
 
94
91
  function isString(value) {
95
92
  return typeof value === "string";
@@ -223,8 +220,8 @@ async function handleLogout() {
223
220
  }
224
221
 
225
222
  try {
226
- localStorage.removeItem("yicode-token");
227
- await router.push(loginPath);
223
+ localStorage.removeItem($Config.tokenName);
224
+ await router.push($Config.loginPath);
228
225
  MessagePlugin.success("退出成功");
229
226
  destroy();
230
227
  } catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "befly-admin-ui",
3
- "version": "1.8.22",
4
- "gitHead": "757e491f7d2d22339b35ffd577c14778203e5757",
3
+ "version": "1.8.24",
4
+ "gitHead": "0690bdde6ac3f8c13ba8f580d39a7f2f6e31f10a",
5
5
  "private": false,
6
6
  "description": "Befly - 管理后台功能组件",
7
7
  "keywords": [
@@ -8,8 +8,8 @@
8
8
  <div class="circle circle-3"></div>
9
9
  </div>
10
10
  <div class="welcome-content">
11
- <h1 class="brand-title">Befly</h1>
12
- <p class="brand-subtitle">轻量级业务快速开发框架</p>
11
+ <h1 class="brand-title">{{ $Config.appTitle }}</h1>
12
+ <p class="brand-subtitle">{{ $Config.appDesc }}</p>
13
13
  </div>
14
14
  </div>
15
15
 
@@ -18,7 +18,6 @@
18
18
  <div class="login-box">
19
19
  <div class="login-header">
20
20
  <h2 class="login-title">欢迎回来</h2>
21
- <p class="login-subtitle">请登录您的账户</p>
22
21
  </div>
23
22
 
24
23
  <TForm :model="$Data.formData" :rules="$Data.formRules" ref="formRef" class="login-form" :show-message="false" label-width="0">
@@ -56,7 +55,7 @@
56
55
  </TForm>
57
56
 
58
57
  <div class="login-footer">
59
- <p class="copyright" 2024 Befly. All rights reserved.</p>
58
+ <p class="copyright">{{ $Config.loginFootnote }}</p>
60
59
  </div>
61
60
  </div>
62
61
  </div>
@@ -68,8 +67,9 @@ import { reactive, ref } from "vue";
68
67
  import { useRouter } from "vue-router";
69
68
  import { Form as TForm, FormItem as TFormItem, Input as TInput, Button as TButton, Checkbox as TCheckbox, InputAdornment as TInputAdornment, Select as TSelect, Option as TOption, MessagePlugin } from "tdesign-vue-next";
70
69
  import { LockOnIcon, UserIcon } from "tdesign-icons-vue-next";
71
- import { $Http } from "@/plugins/http";
72
70
  import { hashPassword } from "befly-admin-ui/utils/hashPassword";
71
+ import { $Http } from "@/plugins/http.js";
72
+ import { $Config } from "@/plugins/config.js";
73
73
 
74
74
  const router = useRouter();
75
75
 
@@ -109,15 +109,11 @@ async function apiLogin() {
109
109
  password: hashedPassword
110
110
  });
111
111
 
112
- localStorage.setItem("yicode-token", res.data.token);
113
-
114
- if (res.data.userInfo) {
115
- localStorage.setItem("yicode-userInfo", JSON.stringify(res.data.userInfo));
116
- }
112
+ localStorage.setItem($Config.tokenName, res.data.token);
117
113
 
118
114
  MessagePlugin.success(res.msg || "登录成功");
119
115
 
120
- await router.push("/");
116
+ await router.push($Config.homePath);
121
117
  } catch (error) {
122
118
  MessagePlugin.error(error.msg || error.message || "登录失败");
123
119
  } finally {