@skyfox2000/webui 1.2.3 → 1.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
package/src/index.ts CHANGED
@@ -1,53 +1,6 @@
1
1
  import '@/assets/global.css';
2
2
 
3
- export {
4
- Button,
5
- Tooltip,
6
- AppIcon,
7
- Fullscreen,
8
- Helper,
9
- Icon,
10
- LayoutIcon,
11
- ProjectIcon,
12
- ToolIcon,
13
- Dialog,
14
- Drawer,
15
- Form,
16
- FormItem,
17
- Search,
18
- SearchItem,
19
- Table,
20
- TableOperate,
21
- Toolbar,
22
- Icontool,
23
- Tree,
24
- AutoComplete,
25
- Cascader,
26
- Checkbox,
27
- DatePicker,
28
- Input,
29
- InputIcon,
30
- InputPassword,
31
- InputNumber,
32
- PropEditor,
33
- Radio,
34
- RadioStatus,
35
- RangePicker,
36
- Select,
37
- Switch,
38
- Textarea,
39
- Transfer,
40
- TransferTable,
41
- TreeSelect,
42
- UploadList,
43
- Breadcrumb,
44
- Content,
45
- Datetime,
46
- Header,
47
- HeaderExits,
48
- Menu,
49
- MenuTabs,
50
- } from '@/components/index';
3
+ export { pinia } from '@/stores/pinia';
51
4
 
52
5
  // 类型定义 - 明确导出
53
6
  export type {
@@ -242,8 +195,6 @@ export {
242
195
  mainAppPush,
243
196
  } from '@/utils/main-openapis';
244
197
 
245
- export { pinia } from '@/stores/pinia';
246
-
247
198
  import router from '@/router';
248
199
  export { router as AppRouter };
249
200
  export { pendingNavigation, routes } from '@/router';
@@ -253,3 +204,52 @@ export { useHostInfo } from '@/stores/hostInfo';
253
204
  export { useUserInfo } from '@/stores/userInfo';
254
205
  export { usePageInfo } from '@/stores/pageInfo';
255
206
  export { useSettingInfo } from '@/stores/settingInfo';
207
+
208
+ export {
209
+ Button,
210
+ Tooltip,
211
+ AppIcon,
212
+ Fullscreen,
213
+ Helper,
214
+ Icon,
215
+ LayoutIcon,
216
+ ProjectIcon,
217
+ ToolIcon,
218
+ Dialog,
219
+ Drawer,
220
+ Form,
221
+ FormItem,
222
+ Search,
223
+ SearchItem,
224
+ Table,
225
+ TableOperate,
226
+ Toolbar,
227
+ Icontool,
228
+ Tree,
229
+ AutoComplete,
230
+ Cascader,
231
+ Checkbox,
232
+ DatePicker,
233
+ Input,
234
+ InputIcon,
235
+ InputPassword,
236
+ InputNumber,
237
+ PropEditor,
238
+ Radio,
239
+ RadioStatus,
240
+ RangePicker,
241
+ Select,
242
+ Switch,
243
+ Textarea,
244
+ Transfer,
245
+ TransferTable,
246
+ TreeSelect,
247
+ UploadList,
248
+ Breadcrumb,
249
+ Content,
250
+ Datetime,
251
+ Header,
252
+ HeaderExits,
253
+ Menu,
254
+ MenuTabs,
255
+ } from '@/components/index';
@@ -56,7 +56,7 @@ export { routes };
56
56
  * @param isLogin 是否已登录
57
57
  * @returns 权限判断结果
58
58
  */
59
- export const hasPermission = (route: RouteRecord, isLogin: boolean): boolean => {
59
+ const hasPermission = (route: RouteRecord, isLogin: boolean): boolean => {
60
60
  const roles = route.meta?.roles ?? [];
61
61
  const permission = route.meta?.permission;
62
62
 
@@ -114,7 +114,6 @@ export const pendingNavigation: Ref<{ to: RouteLocationNormalizedGeneric; next:
114
114
  */
115
115
  router.beforeEach((to, _from, next) => {
116
116
  const toRoute = to as unknown as RouteRecord;
117
-
118
117
  if (to.path.startsWith('/error/') || to.path.startsWith(LOGIN_PATH)) {
119
118
  return next();
120
119
  }
@@ -195,7 +195,10 @@ export const useAppInfo = defineStore('appInfo', {
195
195
  async getRemoteAppList(): Promise<void> {
196
196
  // 从服务器获取
197
197
  return httpPost<AppInfo[]>(AppUrlList.appList, {
198
- Query: {},
198
+ Query: {
199
+ AppCode: this.appInfo.AppCode,
200
+ Enabled: 1,
201
+ },
199
202
  }).then((result: ApiResponse<AppInfo[]> | null) => {
200
203
  if (result?.status === ResStatus.SUCCESS && result.data) {
201
204
  this.appList.length = 0;
@@ -204,8 +204,8 @@ export const useUserInfo = defineStore('userInfo', {
204
204
  */
205
205
  init() {
206
206
  if (this.token && this.isLogin) {
207
- setToken(this.token);
208
207
  checkToken(this.token, () => this.clean());
208
+ setToken(this.token);
209
209
  } else {
210
210
  this.clean();
211
211
  }
@@ -317,6 +317,21 @@ export const useUserInfo = defineStore('userInfo', {
317
317
  return this.userInfo;
318
318
  },
319
319
 
320
+ setUserInfo(userInfo: UserInfo, token: string) {
321
+ if (!checkToken(token)) {
322
+ this.clean();
323
+ return;
324
+ }
325
+
326
+ this.userInfo = {
327
+ ...this.userInfo,
328
+ ...userInfo,
329
+ };
330
+ this.token = token;
331
+ setToken(this.token);
332
+ this.isLogin = true;
333
+ },
334
+
320
335
  /**
321
336
  * 获取用户Token
322
337
  * @returns 用户Token