vue-layout-gitcode 1.0.25 → 1.0.27

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, openBlock, createBlock, unref, normalizeProps, mergeProps, createElementBlock, normalizeClass, renderSlot, normalizeStyle, createElementVNode, reactive, readonly, h, getCurrentInstance, effectScope, inject, onMounted, onUnmounted, shallowRef, ref, onBeforeMount, watch, Fragment, isRef, createVNode, Text, provide, withCtx, toDisplayString as toDisplayString$1, createCommentVNode, renderList, createTextVNode, Transition, withModifiers, render, resolveComponent, watchEffect, guardReactiveProps, onBeforeUnmount, nextTick, defineAsyncComponent, withDirectives, vShow, withKeys, resolveDynamicComponent, toRaw, mergeModels, useModel as useModel$1, watchPostEffect, createSlots } from "vue";
1
+ import { defineComponent, computed, openBlock, createBlock, unref, normalizeProps, mergeProps, createElementBlock, normalizeClass, renderSlot, normalizeStyle, createElementVNode, reactive, readonly, inject, h, getCurrentInstance, effectScope, onMounted, onUnmounted, shallowRef, ref, onBeforeMount, watch, Fragment, isRef, createVNode, Text, provide, withCtx, toDisplayString as toDisplayString$1, createCommentVNode, renderList, createTextVNode, Transition, withModifiers, render, resolveComponent, watchEffect, guardReactiveProps, onBeforeUnmount, nextTick, defineAsyncComponent, withDirectives, vShow, withKeys, resolveDynamicComponent, toRaw, mergeModels, useModel as useModel$1, watchPostEffect, createSlots } from "vue";
2
2
  import { Button } from "vue-devui-lal/button";
3
3
  import { Popover } from "vue-devui-lal/popover";
4
4
  import { Tooltip } from "vue-devui-lal/tooltip";
@@ -121,6 +121,93 @@ function setLayoutConfig(customConfig) {
121
121
  function useLayoutConfig() {
122
122
  return readonly(layoutConfig$5);
123
123
  }
124
+ async function reqCatch(req, params) {
125
+ try {
126
+ const data = await req(params);
127
+ return {
128
+ data,
129
+ error: null
130
+ };
131
+ } catch (e) {
132
+ return {
133
+ data: null,
134
+ error: e
135
+ };
136
+ }
137
+ }
138
+ async function reqCatchV2(req) {
139
+ try {
140
+ const data = await req();
141
+ return {
142
+ data,
143
+ error: null
144
+ };
145
+ } catch (e) {
146
+ return {
147
+ data: null,
148
+ error: e
149
+ };
150
+ }
151
+ }
152
+ function asideRequest(request) {
153
+ return {
154
+ // 数据上报
155
+ report(eventId, data, headers = {}) {
156
+ return reqCatch(() => request({
157
+ url: `/api/v1/report`,
158
+ method: "post",
159
+ data,
160
+ params: {
161
+ event_id: eventId
162
+ },
163
+ headers
164
+ }, { ignoreError: true }));
165
+ },
166
+ // 我参与的项目
167
+ getMyProjects(params) {
168
+ return reqCatch(() => request({
169
+ url: `/api/v2/projects/user_projects/related_me`,
170
+ method: "get",
171
+ params
172
+ }), params);
173
+ },
174
+ // 我参与的组织
175
+ getMyGroups(params) {
176
+ return reqCatch(() => request({
177
+ url: "/api/v2/groups/user_groups/related_me",
178
+ method: "get",
179
+ params
180
+ }), params);
181
+ }
182
+ };
183
+ }
184
+ const useReport = async (eventID, eventParams, request) => {
185
+ const globalStore = inject("globalStore");
186
+ if (eventID === "pageview" && window._hmt) {
187
+ const path = window.location.pathname + window.location.search;
188
+ window._hmt.push(["_trackPageview", path]);
189
+ }
190
+ if ((globalStore == null ? void 0 : globalStore.httpStatus) !== 200) {
191
+ eventParams.http_code = globalStore == null ? void 0 : globalStore.httpStatus;
192
+ }
193
+ return await request(eventID, eventParams);
194
+ };
195
+ const useRequestReport = (request, globalStore) => {
196
+ const useReport2 = async (eventID, eventParams, headers) => {
197
+ if (eventID === "pageview" && window._hmt) {
198
+ const path = window.location.pathname + window.location.search;
199
+ window._hmt.push(["_trackPageview", path]);
200
+ }
201
+ if ((globalStore == null ? void 0 : globalStore.httpStatus) !== 200) {
202
+ eventParams.http_code = globalStore == null ? void 0 : globalStore.httpStatus;
203
+ }
204
+ const API = asideRequest(request);
205
+ return await API.report(eventID, eventParams, headers);
206
+ };
207
+ return {
208
+ useReport: useReport2
209
+ };
210
+ };
124
211
  function generateRandomString(length) {
125
212
  let result2 = "";
126
213
  const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
@@ -9343,13 +9430,13 @@ const cookies = platform.hasStandardBrowserEnv ? (
9343
9430
  function isAbsoluteURL(url) {
9344
9431
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
9345
9432
  }
9346
- function combineURLs(baseURL2, relativeURL) {
9347
- return relativeURL ? baseURL2.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL2;
9433
+ function combineURLs(baseURL, relativeURL) {
9434
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
9348
9435
  }
9349
- function buildFullPath(baseURL2, requestedURL, allowAbsoluteUrls) {
9436
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
9350
9437
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
9351
- if (baseURL2 && (isRelativeUrl || allowAbsoluteUrls == false)) {
9352
- return combineURLs(baseURL2, requestedURL);
9438
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
9439
+ return combineURLs(baseURL, requestedURL);
9353
9440
  }
9354
9441
  return requestedURL;
9355
9442
  }
@@ -10515,10 +10602,9 @@ const setPassportPrefix = (url, method) => {
10515
10602
  }
10516
10603
  return url;
10517
10604
  };
10518
- const baseURL = layoutConfig$3.VITE_API_HOST;
10519
10605
  const proxyService = (params, customConfigs) => {
10520
10606
  const service = axios$1.create({
10521
- baseURL,
10607
+ baseURL: layoutConfig$3.VITE_API_HOST,
10522
10608
  timeout: (customConfigs == null ? void 0 : customConfigs.customTimeout) || 3e4,
10523
10609
  withCredentials: true
10524
10610
  });
@@ -10565,61 +10651,6 @@ const proxyService = (params, customConfigs) => {
10565
10651
  );
10566
10652
  return service(params);
10567
10653
  };
10568
- const useReport = async (eventID, eventParams, request) => {
10569
- const globalStore = inject("globalStore");
10570
- if (eventID === "pageview" && window._hmt) {
10571
- const path = window.location.pathname + window.location.search;
10572
- window._hmt.push(["_trackPageview", path]);
10573
- }
10574
- if ((globalStore == null ? void 0 : globalStore.httpStatus) !== 200) {
10575
- eventParams.http_code = globalStore == null ? void 0 : globalStore.httpStatus;
10576
- }
10577
- return await request(eventID, eventParams);
10578
- };
10579
- async function reqCatch(req, params) {
10580
- try {
10581
- const data = await req(params);
10582
- return {
10583
- data,
10584
- error: null
10585
- };
10586
- } catch (e) {
10587
- return {
10588
- data: null,
10589
- error: e
10590
- };
10591
- }
10592
- }
10593
- async function reqCatchV2(req) {
10594
- try {
10595
- const data = await req();
10596
- return {
10597
- data,
10598
- error: null
10599
- };
10600
- } catch (e) {
10601
- return {
10602
- data: null,
10603
- error: e
10604
- };
10605
- }
10606
- }
10607
- function toolsFloatRequest(request) {
10608
- return {
10609
- // 数据上报
10610
- report(eventId, data, headers = {}) {
10611
- return reqCatch(() => request({
10612
- url: `/api/v1/report`,
10613
- method: "post",
10614
- data,
10615
- params: {
10616
- event_id: eventId
10617
- },
10618
- headers
10619
- }, { ignoreError: true }));
10620
- }
10621
- };
10622
- }
10623
10654
  const _hoisted_1$t = { class: "home-nav-right" };
10624
10655
  const _hoisted_2$j = { class: "home-nav-tooltip-wrapper" };
10625
10656
  const _hoisted_3$g = { class: "home-nav-text" };
@@ -10683,7 +10714,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
10683
10714
  const { t: t2 } = i18n.global;
10684
10715
  const props = __props;
10685
10716
  provide("globalStore", computed(() => props.globalStore));
10686
- const API = toolsFloatRequest(props.request);
10717
+ const { useReport: useReport2 } = useRequestReport(props.request, props.globalStore);
10718
+ provide("useReport", useReport2);
10687
10719
  const visibleItems = computed(() => {
10688
10720
  switch (props.sceneValue) {
10689
10721
  case SceneValue.news:
@@ -10750,10 +10782,10 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
10750
10782
  };
10751
10783
  const NPSOffsetOptions = reactive({ mainAxis: 10, crossAxis: -30 });
10752
10784
  const handleNpsSubmit = () => {
10753
- useReport(ToolsFloatReportEvent.NPS, {
10785
+ useReport2(ToolsFloatReportEvent.NPS, {
10754
10786
  nps_score: rateNow.value + 1,
10755
10787
  nps_comment: opinionText.value
10756
- }, API.report);
10788
+ });
10757
10789
  process2.value = false;
10758
10790
  NPSOffsetOptions.crossAxis = 0;
10759
10791
  window.dispatchEvent(new Event("resize"));
@@ -10795,16 +10827,16 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
10795
10827
  handleLogin("login");
10796
10828
  return;
10797
10829
  }
10798
- useReport(ToolsFloatReportEvent.AD_CLICK, {
10830
+ useReport2(ToolsFloatReportEvent.AD_CLICK, {
10799
10831
  ad_title: activeAdItem.value.title
10800
- }, API.report);
10832
+ });
10801
10833
  window.open(href);
10802
10834
  }
10803
10835
  };
10804
10836
  const handleActiveClose = () => {
10805
- useReport(ToolsFloatReportEvent.AD_CLOSE, {
10837
+ useReport2(ToolsFloatReportEvent.AD_CLOSE, {
10806
10838
  ad_title: activeAdItem.value.title
10807
- }, API.report);
10839
+ });
10808
10840
  activeAdJson.value = null;
10809
10841
  localStorage.setItem("closeActive", "1");
10810
10842
  const dateString = (/* @__PURE__ */ new Date()).toLocaleDateString("zh-CN");
@@ -11076,9 +11108,9 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
11076
11108
  };
11077
11109
  }
11078
11110
  });
11079
- const index_vue_vue_type_style_index_0_scoped_bb7c7d28_lang = "";
11111
+ const index_vue_vue_type_style_index_0_scoped_855bea01_lang = "";
11080
11112
  const index_vue_vue_type_style_index_1_lang$3 = "";
11081
- const ToolsFloat = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-bb7c7d28"]]);
11113
+ const ToolsFloat = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-855bea01"]]);
11082
11114
  function usePopup(className, rootElement) {
11083
11115
  const root2 = rootElement || document.getElementById("app");
11084
11116
  let cacheClass = "popup-container";
@@ -16914,7 +16946,6 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
16914
16946
  });
16915
16947
  const Notice_vue_vue_type_style_index_0_scoped_5dc62369_lang = "";
16916
16948
  const Notice = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-5dc62369"]]);
16917
- const UserLevel_vue_vue_type_style_index_0_scoped_062de504_lang = "";
16918
16949
  const _hoisted_1$m = {
16919
16950
  key: 0,
16920
16951
  class: "user-level-avatar-badge"
@@ -16927,7 +16958,8 @@ const _hoisted_6$6 = ["src"];
16927
16958
  const _hoisted_7$4 = { class: "custom-btn" };
16928
16959
  const _hoisted_8$4 = { class: "flex items-center justify-center" };
16929
16960
  const maxLevel = 3;
16930
- const _sfc_main$o = /* @__PURE__ */ Object.assign({ name: "UserLevel" }, {
16961
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
16962
+ ...{ name: "UserLevel" },
16931
16963
  __name: "UserLevel",
16932
16964
  props: ["accountInfo"],
16933
16965
  setup(__props) {
@@ -16950,14 +16982,14 @@ const _sfc_main$o = /* @__PURE__ */ Object.assign({ name: "UserLevel" }, {
16950
16982
  level: "https://cdn-static.gitcode.com/static/images/points/l-v3.png"
16951
16983
  }
16952
16984
  };
16953
- const API = headRequest(inject("request"));
16985
+ const useReport2 = inject("useReport");
16954
16986
  const router2 = useRouter();
16955
16987
  const userLevel = computed(() => {
16956
16988
  return props.accountInfo.level;
16957
16989
  });
16958
16990
  const handleUpgrade = () => {
16959
16991
  handleAvatarRedPoint(CLICK_TIME_MODULE.GROWTH_CENTER, props.accountInfo.username);
16960
- useReport("score_entrance_click", {}, API.report);
16992
+ useReport2("score_entrance_click", {});
16961
16993
  router2.push("/setting/points");
16962
16994
  };
16963
16995
  const levelInfo = computed(() => {
@@ -16996,7 +17028,8 @@ const _sfc_main$o = /* @__PURE__ */ Object.assign({ name: "UserLevel" }, {
16996
17028
  };
16997
17029
  }
16998
17030
  });
16999
- const UserLevel = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-062de504"]]);
17031
+ const UserLevel_vue_vue_type_style_index_0_scoped_b57b4f46_lang = "";
17032
+ const UserLevel = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-b57b4f46"]]);
17000
17033
  const _hoisted_1$l = { class: "g-user-drawer-info-list pl-[16px]" };
17001
17034
  const _hoisted_2$f = { class: "max-w-[200px]" };
17002
17035
  const _hoisted_3$c = ["title"];
@@ -17197,16 +17230,16 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
17197
17230
  __name: "UserAvatar",
17198
17231
  props: ["isChatBot", "loginOutFinish", "inAIHub", "independence"],
17199
17232
  setup(__props) {
17200
- const API = headRequest(inject("request"));
17201
17233
  const accountInfo = ref(JSON.parse(localStorage.getItem("userInfo") || "{}"));
17202
17234
  console.log("accountInfo", accountInfo.value.avatar);
17203
17235
  const haveVisited = ref(false);
17236
+ const useReport2 = inject("useReport");
17204
17237
  const handleToggle = (status) => {
17205
17238
  visitedClick();
17206
17239
  const params = { need_tips: accountInfo.value.need_tips, prompt_style: accountInfo.value.style_tips };
17207
- useReport("score_personal_center_avatar_click", params, API.report);
17240
+ useReport2("score_personal_center_avatar_click", params);
17208
17241
  if (status) {
17209
- useReport("score_personal_center_dropdown", params, API.report);
17242
+ useReport2("score_personal_center_dropdown", params);
17210
17243
  }
17211
17244
  nextTick(() => {
17212
17245
  if (judgeDrawerScroll()) {
@@ -17292,9 +17325,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
17292
17325
  };
17293
17326
  }
17294
17327
  });
17295
- const UserAvatar_vue_vue_type_style_index_0_scoped_3e176b36_lang = "";
17328
+ const UserAvatar_vue_vue_type_style_index_0_scoped_0bbce447_lang = "";
17296
17329
  const UserAvatar_vue_vue_type_style_index_1_lang = "";
17297
- const UserAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-3e176b36"]]);
17330
+ const UserAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-0bbce447"]]);
17298
17331
  var EVENT_NAME = /* @__PURE__ */ ((EVENT_NAME2) => {
17299
17332
  EVENT_NAME2["START_SEARCH"] = "开始搜索";
17300
17333
  EVENT_NAME2["SEARCH"] = "搜索";
@@ -17464,17 +17497,18 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17464
17497
  setup(__props) {
17465
17498
  var _a;
17466
17499
  const { t: $t } = i18n.global;
17467
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-c2ec507b.js"));
17468
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-3ed23ca5.js"));
17469
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-a3b6bf26.js"));
17470
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-376716a3.js"));
17471
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-17a21edd.js"));
17472
- const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-397747f0.js"));
17473
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-05ebe7a1.js"));
17500
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-74720f4c.js"));
17501
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-a0175599.js"));
17502
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-f9e61c56.js"));
17503
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-675e991e.js"));
17504
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-5d95cca8.js"));
17505
+ const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-87a4b922.js"));
17506
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-905fecf4.js"));
17474
17507
  const props = __props;
17475
17508
  const repoInfo = inject("repoInfo");
17476
17509
  const orgInfo = inject("orgInfo");
17477
17510
  const otherUserInfo = inject("otherUserInfo");
17511
+ const useReport2 = inject("useReport");
17478
17512
  const searchInfo = computed(() => {
17479
17513
  var _a2, _b;
17480
17514
  if (props.sceneValue === SceneValue.org && orgInfo.value) {
@@ -17657,7 +17691,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17657
17691
  const onSearch = () => {
17658
17692
  var _a2;
17659
17693
  _frEventTrack(EVENT_NAME.HEADER_START_SEARCH);
17660
- useReport("search-project", {}, () => {
17694
+ useReport2("search-project", {}, () => {
17661
17695
  });
17662
17696
  isFocus.value = false;
17663
17697
  inputRef.value.blur();
@@ -17699,7 +17733,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17699
17733
  }
17700
17734
  });
17701
17735
  const onFocus = () => {
17702
- useReport(REPO_EVENT.CLICK, {
17736
+ useReport2(REPO_EVENT.CLICK, {
17703
17737
  module_name: REPO_MODULE.SEARCH_BAR_CLICK
17704
17738
  }, () => {
17705
17739
  });
@@ -17784,7 +17818,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17784
17818
  { immediate: true }
17785
17819
  );
17786
17820
  onMounted(() => {
17787
- useReport(REPO_EVENT.SHOW, {
17821
+ useReport2(REPO_EVENT.SHOW, {
17788
17822
  module_name: REPO_MODULE.SEARCH_BAR_EXPO
17789
17823
  }, () => {
17790
17824
  });
@@ -17986,10 +18020,10 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17986
18020
  };
17987
18021
  }
17988
18022
  });
17989
- const index_vue_vue_type_style_index_0_scoped_c66b3fed_lang = "";
18023
+ const index_vue_vue_type_style_index_0_scoped_85de34aa_lang = "";
17990
18024
  const index_vue_vue_type_style_index_1_lang$2 = "";
17991
- const Search = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-c66b3fed"]]);
17992
- const NoticeModal = defineAsyncComponent(() => import("./notice-78d5c6d2.js"));
18025
+ const Search = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-85de34aa"]]);
18026
+ const NoticeModal = defineAsyncComponent(() => import("./notice-6f85f789.js"));
17993
18027
  function clearNotice() {
17994
18028
  if (localStorage.getItem("validator_email")) {
17995
18029
  localStorage.removeItem("validator_email");
@@ -18055,6 +18089,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
18055
18089
  const layoutConfig2 = useLayoutConfig();
18056
18090
  const route = useRoute();
18057
18091
  const props = __props;
18092
+ const { useReport: useReport2 } = useRequestReport(props.request, props.globalStore);
18058
18093
  const emit = __emit;
18059
18094
  provide("request", props.request);
18060
18095
  provide("globalStore", computed(() => props.globalStore));
@@ -18062,6 +18097,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
18062
18097
  provide("orgInfo", computed(() => props.orgInfo));
18063
18098
  provide("userInfo", computed(() => props.userInfo));
18064
18099
  provide("otherUserInfo", computed(() => props.otherUserInfo));
18100
+ provide("useReport", useReport2);
18065
18101
  const visibleItems = computed(() => {
18066
18102
  if (props.headerFunctions && props.headerFunctions.length > 0) {
18067
18103
  return props.headerFunctions;
@@ -18327,8 +18363,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
18327
18363
  };
18328
18364
  }
18329
18365
  });
18330
- const index_vue_vue_type_style_index_0_scoped_42f1bfe0_lang = "";
18331
- const GitCodeHeader = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-42f1bfe0"]]);
18366
+ const index_vue_vue_type_style_index_0_scoped_48e7c1da_lang = "";
18367
+ const GitCodeHeader = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-48e7c1da"]]);
18332
18368
  const createSetting = () => {
18333
18369
  const { t: t2 } = i18n.global;
18334
18370
  const settings = {
@@ -18511,38 +18547,6 @@ const transWebUrl = (url, params) => {
18511
18547
  const queryString = Object.entries(params).filter(([_, value]) => value !== void 0 && value !== null).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`).join("&");
18512
18548
  return queryString ? `${processedUrl}${separator}${queryString}` : processedUrl;
18513
18549
  };
18514
- function asideRequest(request) {
18515
- return {
18516
- // 数据上报
18517
- report(eventId, data, headers = {}) {
18518
- return reqCatch(() => request({
18519
- url: `/api/v1/report`,
18520
- method: "post",
18521
- data,
18522
- params: {
18523
- event_id: eventId
18524
- },
18525
- headers
18526
- }, { ignoreError: true }));
18527
- },
18528
- // 我参与的项目
18529
- getMyProjects(params) {
18530
- return reqCatch(() => request({
18531
- url: `/api/v2/projects/user_projects/related_me`,
18532
- method: "get",
18533
- params
18534
- }), params);
18535
- },
18536
- // 我参与的组织
18537
- getMyGroups(params) {
18538
- return reqCatch(() => request({
18539
- url: "/api/v2/groups/user_groups/related_me",
18540
- method: "get",
18541
- params
18542
- }), params);
18543
- }
18544
- };
18545
- }
18546
18550
  const _hoisted_1$f = { class: "devui-submenu layer_2 my-work-platform submenu-item relative" };
18547
18551
  const _hoisted_2$9 = {
18548
18552
  class: "devui-submenu-title layer_2",
@@ -18942,9 +18946,12 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
18942
18946
  sceneValue: { default: SceneValue.home },
18943
18947
  isLogin: { type: Boolean, default: false },
18944
18948
  asideDefaultWidth: { default: 240 },
18945
- asideSetShowLittle: { type: Boolean, default: false }
18949
+ asideSetShowLittle: { type: Boolean, default: false },
18950
+ showPreferencesSetting: { type: Boolean },
18951
+ showThemeSetting: { type: Boolean },
18952
+ showLangSetting: { type: Boolean }
18946
18953
  },
18947
- emits: ["onSelect"],
18954
+ emits: ["onMenuClick"],
18948
18955
  setup(__props, { emit: __emit }) {
18949
18956
  const layoutConfig2 = useLayoutConfig();
18950
18957
  const router2 = useRouter();
@@ -18955,6 +18962,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
18955
18962
  const props = __props;
18956
18963
  const request = inject("request");
18957
18964
  const userInfo = inject("userInfo");
18965
+ const useReport2 = inject("useReport");
18958
18966
  const emits = __emit;
18959
18967
  const visibleItems = computed(() => {
18960
18968
  switch (props.sceneValue) {
@@ -18979,10 +18987,20 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
18979
18987
  };
18980
18988
  const username = computed(() => (userInfo == null ? void 0 : userInfo.username) || JSON.parse(localStorage.getItem("userInfo") || "{}").username);
18981
18989
  const showPreferencesSetting = computed(() => {
18990
+ if (props.showPreferencesSetting !== void 0)
18991
+ return !props.asideSetShowLittle && props.showPreferencesSetting;
18982
18992
  return !props.asideSetShowLittle && route.name !== AICopilot_ROUTE_NAME && isModuleVisible(AsideDisplayItem.PREFERENCE);
18983
18993
  });
18984
- const aiHubSceneValue = [SceneValue.aiHome, SceneValue.aiGuide];
18985
- const inAIHub = computed(() => aiHubSceneValue.includes(props.sceneValue));
18994
+ const showThemeSetting = computed(() => {
18995
+ if (props.showPreferencesSetting !== void 0 && props.showThemeSetting !== void 0)
18996
+ return props.showThemeSetting;
18997
+ return ![SceneValue.aiHome, SceneValue.aiGuide].includes(props.sceneValue);
18998
+ });
18999
+ const showLangSetting = computed(() => {
19000
+ if (props.showPreferencesSetting !== void 0 && props.showLangSetting !== void 0)
19001
+ return props.showLangSetting;
19002
+ return true;
19003
+ });
18986
19004
  const isEn = computed(() => {
18987
19005
  return locale2.value === LANG_EN;
18988
19006
  });
@@ -19122,7 +19140,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19122
19140
  return menuArr;
19123
19141
  });
19124
19142
  const API = asideRequest(request);
19125
- const onSelect = (e) => {
19143
+ const onMenuClick = (e) => {
19126
19144
  var _a;
19127
19145
  const parentNode = e.el.parentNode;
19128
19146
  const routeDataStr = parentNode == null ? void 0 : parentNode.getAttribute("data-route");
@@ -19131,12 +19149,12 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19131
19149
  const url = (parentNode == null ? void 0 : parentNode.getAttribute("data-href")) || "";
19132
19150
  const host = (parentNode == null ? void 0 : parentNode.getAttribute("data-host")) || "";
19133
19151
  if (host === layoutConfig2.VITE_AI_HOST) {
19134
- useReport(AsideReportEvent.AI_CLICK, {}, API.report);
19152
+ useReport2(AsideReportEvent.AI_CLICK, {});
19135
19153
  }
19136
19154
  if (routeData) {
19137
19155
  if (routeData.login && !props.isLogin) {
19138
19156
  if (sizeStore.isMobile.value) {
19139
- emits("onSelect");
19157
+ emits("onMenuClick");
19140
19158
  }
19141
19159
  emitEvent("login");
19142
19160
  return;
@@ -19161,7 +19179,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19161
19179
  checkMenu();
19162
19180
  return false;
19163
19181
  }
19164
- emits("onSelect");
19182
+ emits("onMenuClick");
19165
19183
  };
19166
19184
  function checkMenu() {
19167
19185
  if (!route)
@@ -19246,7 +19264,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19246
19264
  onMouseleave: handleMouseLeave
19247
19265
  }, [
19248
19266
  createVNode(unref(Menu), {
19249
- onSelect,
19267
+ onSelect: onMenuClick,
19250
19268
  "open-keys": ["team", "project"],
19251
19269
  mode: "vertical",
19252
19270
  "default-select-keys": defaultSelectKeys.value,
@@ -19442,10 +19460,12 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19442
19460
  withDirectives(createElementVNode("div", _hoisted_19$1, [
19443
19461
  createVNode(_sfc_main$i)
19444
19462
  ], 512), [
19445
- [vShow, !inAIHub.value]
19463
+ [vShow, showThemeSetting.value]
19446
19464
  ]),
19447
- createElementVNode("div", _hoisted_20$1, [
19465
+ withDirectives(createElementVNode("div", _hoisted_20$1, [
19448
19466
  createVNode(_sfc_main$j)
19467
+ ], 512), [
19468
+ [vShow, showLangSetting.value]
19449
19469
  ])
19450
19470
  ]),
19451
19471
  default: withCtx(() => [
@@ -19470,9 +19490,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19470
19490
  };
19471
19491
  }
19472
19492
  });
19473
- const asideContent_vue_vue_type_style_index_0_scoped_9d5af764_lang = "";
19493
+ const asideContent_vue_vue_type_style_index_0_scoped_005ddc7b_lang = "";
19474
19494
  const asideContent_vue_vue_type_style_index_1_lang = "";
19475
- const AsideContent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-9d5af764"]]);
19495
+ const AsideContent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-005ddc7b"]]);
19476
19496
  const _hoisted_1$d = { class: "p-[16px] flex justify-between items-center h-[60px]" };
19477
19497
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
19478
19498
  __name: "index",
@@ -19484,14 +19504,19 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
19484
19504
  request: { type: Function, default: proxyService },
19485
19505
  globalStore: { default: () => ({
19486
19506
  httpStatus: 200
19487
- }) }
19507
+ }) },
19508
+ showPreferencesSetting: { type: Boolean, default: void 0 },
19509
+ showThemeSetting: { type: Boolean, default: void 0 },
19510
+ showLangSetting: { type: Boolean, default: void 0 }
19488
19511
  },
19489
19512
  setup(__props) {
19490
19513
  const route = useRoute();
19491
19514
  const props = __props;
19515
+ const { useReport: useReport2 } = useRequestReport(props.request, props.globalStore);
19492
19516
  provide("globalStore", computed(() => props.globalStore));
19493
19517
  provide("request", props.request);
19494
19518
  provide("userInfo", computed(() => props.userInfo));
19519
+ provide("useReport", useReport2);
19495
19520
  const showBgColor = computed(() => {
19496
19521
  if (route.meta.showBgColor)
19497
19522
  return true;
@@ -19551,8 +19576,11 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
19551
19576
  sceneValue: _ctx.sceneValue,
19552
19577
  asideDefaultWidth: mainMarginLeftWidth.value,
19553
19578
  asideSetShowLittle: unref(asideSetShowLittle),
19554
- isLogin: _ctx.isLogin
19555
- }, null, 8, ["sceneValue", "asideDefaultWidth", "asideSetShowLittle", "isLogin"])) : createCommentVNode("", true)
19579
+ isLogin: _ctx.isLogin,
19580
+ showPreferencesSetting: _ctx.showPreferencesSetting,
19581
+ showThemeSetting: _ctx.showThemeSetting,
19582
+ showLangSetting: _ctx.showLangSetting
19583
+ }, null, 8, ["sceneValue", "asideDefaultWidth", "asideSetShowLittle", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting"])) : createCommentVNode("", true)
19556
19584
  ]),
19557
19585
  _: 1
19558
19586
  }, 8, ["class", "style"])) : createCommentVNode("", true),
@@ -19580,11 +19608,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
19580
19608
  asideVisible.value ? (openBlock(), createBlock(AsideContent, {
19581
19609
  key: 0,
19582
19610
  asideDefaultWidth: 240,
19583
- onOnSelect: handleClickMenu,
19611
+ onOnMenuClick: handleClickMenu,
19584
19612
  sceneValue: _ctx.sceneValue,
19585
19613
  isLogin: _ctx.isLogin,
19614
+ showPreferencesSetting: _ctx.showPreferencesSetting,
19615
+ showThemeSetting: _ctx.showThemeSetting,
19616
+ showLangSetting: _ctx.showLangSetting,
19586
19617
  style: { "height": "calc(100% - 60px)", "padding-top": "0" }
19587
- }, null, 8, ["sceneValue", "isLogin"])) : createCommentVNode("", true)
19618
+ }, null, 8, ["sceneValue", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting"])) : createCommentVNode("", true)
19588
19619
  ]),
19589
19620
  _: 1
19590
19621
  }, 8, ["modelValue"])
@@ -19592,9 +19623,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
19592
19623
  };
19593
19624
  }
19594
19625
  });
19595
- const index_vue_vue_type_style_index_0_scoped_2b450dd3_lang = "";
19626
+ const index_vue_vue_type_style_index_0_scoped_d4e2262d_lang = "";
19596
19627
  const index_vue_vue_type_style_index_1_lang$1 = "";
19597
- const GitCodeAside = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-2b450dd3"]]);
19628
+ const GitCodeAside = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-d4e2262d"]]);
19598
19629
  const repoInfoData = {
19599
19630
  "star_count": 0,
19600
19631
  "forks_count": 0,
@@ -20502,11 +20533,11 @@ const createLoginConfig = (request) => {
20502
20533
  },
20503
20534
  // csdn授权后
20504
20535
  afterCsdnLogin(param) {
20505
- bindResultResolve(param);
20536
+ bindResultResolve(param, API);
20506
20537
  },
20507
20538
  // atomgit授权后
20508
20539
  afterAtomGitLogin(param) {
20509
- bindResultResolve(param);
20540
+ bindResultResolve(param, API);
20510
20541
  },
20511
20542
  // 微信授权前
20512
20543
  async beforeWechatLogin(param) {
@@ -20519,7 +20550,7 @@ const createLoginConfig = (request) => {
20519
20550
  },
20520
20551
  // 微信授权后
20521
20552
  afterWechatLogin(param) {
20522
- bindResultResolve(param);
20553
+ bindResultResolve(param, API);
20523
20554
  },
20524
20555
  // 其他三方授权前(gitee、github、hbuilder)
20525
20556
  beforeOtherLogin(param) {
@@ -20532,7 +20563,7 @@ const createLoginConfig = (request) => {
20532
20563
  },
20533
20564
  // 其他三方授权后
20534
20565
  afterOtherLogin(param) {
20535
- bindResultResolve(param);
20566
+ bindResultResolve(param, API);
20536
20567
  }
20537
20568
  };
20538
20569
  };
@@ -24285,7 +24316,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
24285
24316
  const MFA_vue_vue_type_style_index_0_lang = "";
24286
24317
  const MFA_vue_vue_type_style_index_1_scoped_02a2d8c5_lang = "";
24287
24318
  const MFA = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-02a2d8c5"]]);
24288
- const SlidCaptcha = defineAsyncComponent(() => import("./index-d366ea34.js"));
24319
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-d3dae056.js"));
24289
24320
  const useSlidCaptcha = () => {
24290
24321
  const { mount, unMount } = usePopup("slid-captcha-popup");
24291
24322
  const open = (config) => {
@@ -24492,6 +24523,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24492
24523
  const props = __props;
24493
24524
  const request = props.request;
24494
24525
  provide("request", request);
24526
+ const useReport2 = inject("useReport");
24495
24527
  const API = headRequest(request);
24496
24528
  const LoginConfig = createLoginConfig(request, props.loginSuccess);
24497
24529
  const usernameRegExp2 = /^(?!-)(?!.*-$)[a-zA-Z][a-zA-Z0-9_-]{1,18}[a-zA-Z0-9]$/;
@@ -24945,7 +24977,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24945
24977
  const handleConfirm = async (info) => {
24946
24978
  var _a, _b;
24947
24979
  if (formType.value === "register") {
24948
- useReport("signup_submit", {}, API.report);
24980
+ useReport2("signup_submit", {});
24949
24981
  }
24950
24982
  const formData = await ((_a = FormRef.value) == null ? void 0 : _a.ValidateForm());
24951
24983
  if (!formData || formData.type === "fail")
@@ -25252,11 +25284,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25252
25284
  }
25253
25285
  });
25254
25286
  const agreementReport = (eventId, type) => {
25255
- useReport(eventId, { type }, API.report);
25287
+ useReport2(eventId, { type });
25256
25288
  };
25257
25289
  function onModalClose() {
25258
25290
  if (formType.value === "register") {
25259
- useReport("signup_close", {}, API.report);
25291
+ useReport2("signup_close", {});
25260
25292
  }
25261
25293
  }
25262
25294
  function onClickModalClose() {
@@ -25268,13 +25300,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25268
25300
  if (props.showClose) {
25269
25301
  emits("close");
25270
25302
  if (formType.value === "register") {
25271
- useReport("signup_button_close", {}, API.report);
25303
+ useReport2("signup_button_close", {});
25272
25304
  }
25273
25305
  }
25274
25306
  }
25275
25307
  watchPostEffect(() => {
25276
25308
  if (formType.value === "register") {
25277
- useReport("signup_view", {}, API.report);
25309
+ useReport2("signup_view", {});
25278
25310
  }
25279
25311
  });
25280
25312
  onBeforeUnmount(() => {
@@ -25635,9 +25667,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25635
25667
  };
25636
25668
  }
25637
25669
  });
25638
- const index_vue_vue_type_style_index_0_scoped_2db3ea14_lang = "";
25670
+ const index_vue_vue_type_style_index_0_scoped_e9e7ee6e_lang = "";
25639
25671
  const index_vue_vue_type_style_index_1_lang = "";
25640
- const LoginModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-2db3ea14"]]);
25672
+ const LoginModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-e9e7ee6e"]]);
25641
25673
  const { t } = i18n.global;
25642
25674
  function useLogin(request) {
25643
25675
  const successMsg = t("gitCodeLayout.common.tips.welcome");
@@ -25732,7 +25764,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25732
25764
  openHarmonyGuide: { type: Boolean, default: true }
25733
25765
  },
25734
25766
  setup(__props) {
25735
- useLayoutConfig();
25736
25767
  const props = __props;
25737
25768
  const status = ref(false);
25738
25769
  const { login, isMounted } = useLogin(props.request);
@@ -25812,25 +25843,24 @@ export {
25812
25843
  TOPIC_TYPE as T,
25813
25844
  _export_sfc as _,
25814
25845
  i18n as a,
25815
- useReport as b,
25816
- REPO_EVENT as c,
25817
- REPO_TYPE as d,
25846
+ REPO_EVENT as b,
25847
+ REPO_TYPE as c,
25848
+ useTimeFormat as d,
25818
25849
  extractRepoInfoWithURL as e,
25819
- useTimeFormat as f,
25820
- usePageResize as g,
25850
+ usePageResize as f,
25851
+ highlightWords as g,
25821
25852
  headRequest as h,
25822
25853
  isPhone as i,
25823
- highlightWords as j,
25824
- _frEventTrack as k,
25825
- debounce$1 as l,
25826
- useLayoutConfig as m,
25827
- ToolsFloat as n,
25828
- _sfc_main as o,
25829
- GitCodeHeader as p,
25830
- GitCodeLayoutEmitter as q,
25854
+ _frEventTrack as j,
25855
+ debounce$1 as k,
25856
+ useLayoutConfig as l,
25857
+ ToolsFloat as m,
25858
+ _sfc_main as n,
25859
+ GitCodeHeader as o,
25860
+ GitCodeLayoutEmitter as p,
25861
+ index as q,
25831
25862
  reqCatch as r,
25832
25863
  setLayoutConfig as s,
25833
25864
  transWebUrl as t,
25834
- useModel as u,
25835
- index as v
25865
+ useModel as u
25836
25866
  };