Ver código fonte

feat:enterprice

ananzhusen 1 ano atrás
pai
commit
3b757261b5

+ 1 - 1
src/services/enterprise.ts

@@ -2,7 +2,7 @@ import { reactive } from 'vue';
 import axios from 'axios';
 
 const enterprise = reactive({
-  name: '',
+  name: '乐吾乐',
   home: 'https://le5le.com',
   account: location.protocol + '//' + location.host + '/account',
   v: location.protocol + '//' + location.host + '/v',

+ 5 - 2
src/views/components/FileProps.vue

@@ -204,7 +204,8 @@
                     </div>
                     <div v-else class="desc mt-4">
                       支持添加iconfont。
-                      <a :href="assets.account" target="_blank">VIP</a> 功能
+                      <a :href="getEnterprise.account" target="_blank">VIP</a>
+                      功能
                     </div>
                   </div>
                 </div>
@@ -274,13 +275,15 @@ import { autoSave, inTreePanel, useAssets } from '@/services/common';
 import { MessagePlugin } from 'tdesign-vue-next';
 import { loadCss } from '@meta2d/core';
 import { defaultPureColor } from '@/services/defaults';
+import { useEnterprise } from '@/services/enterprise';
+const { getEnterprise } = useEnterprise();
 
 const headers = {
   Authorization: 'Bearer ' + (localStorage.token || getCookie('token') || ''),
 };
 const updataData = { directory: '/大屏/图片/默认' };
 
-const { assets } = useAssets();
+// const { assets } = useAssets();
 
 const { user } = useUser();
 

+ 20 - 15
src/views/components/Header.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="app-header">
-    <a class="logo" :href="assets.home" target="_blank">
+    <a class="logo" :href="enterprise.home" target="_blank">
       <img src="/favicon.ico" />
-      <span>乐吾乐</span>
+      <span> {{ enterprise.name }}</span>
     </a>
     <t-dropdown
       :minColumnWidth="200"
@@ -216,7 +216,10 @@
     >
       <a> 帮助 </a>
       <t-dropdown-menu>
-        <t-dropdown-item v-for="item in assets.helps" :divider="item.divider">
+        <t-dropdown-item
+          v-for="item in enterprise.helps"
+          :divider="item.divider"
+        >
           <a :href="item.url" target="_blank">{{ item.name }}</a>
         </t-dropdown-item>
       </t-dropdown-menu>
@@ -225,19 +228,19 @@
     <div style="width: 148px; flex-shrink: 0"></div>
     <input v-model="data.name" @input="onInputName" />
 
-    <a :href="assets.account" target="_blank">
+    <a :href="enterprise.account" target="_blank">
       <t-icon name="home" />
       账户中心
     </a>
-    <a :href="assets.account" target="_blank" class="active">
+    <a :href="enterprise['v']" target="_blank" class="active">
       <t-icon name="desktop" />
       大屏可视化
     </a>
-    <a :href="assets['3d']" target="_blank">
+    <a :href="enterprise['3d']" target="_blank">
       <t-icon name="control-platform" />
       3D可视化
     </a>
-    <a :href="assets['2d']" target="_blank">
+    <a :href="enterprise['2d']" target="_blank">
       <t-icon name="app" />
       2D可视化
     </a>
@@ -256,7 +259,7 @@
       </a>
       <t-dropdown-menu>
         <t-dropdown-item divider="true">
-          <a :href="assets.account">
+          <a :href="enterprise.account">
             {{ user.username }}
             <label
               class="ml-16 vip-label"
@@ -269,20 +272,20 @@
           </a>
         </t-dropdown-item>
         <t-dropdown-item divider="true">
-          <a :href="`${assets.account}/v`" target="_blank"> 我的大屏 </a>
+          <a :href="`${enterprise.account}/v`" target="_blank"> 我的大屏 </a>
         </t-dropdown-item>
         <t-dropdown-item>
-          <a :href="`${assets.account}/account/teams`" target="_blank">
+          <a :href="`${enterprise.account}/account/teams`" target="_blank">
             我的团队
           </a>
         </t-dropdown-item>
         <t-dropdown-item>
-          <a :href="`${assets.account}/account/info`" target="_blank">
+          <a :href="`${enterprise.account}/account/info`" target="_blank">
             账号信息
           </a>
         </t-dropdown-item>
         <t-dropdown-item divider="true">
-          <a :href="`${assets.account}/account/security`" target="_blank">
+          <a :href="`${enterprise.account}/account/security`" target="_blank">
             安全设置
           </a>
         </t-dropdown-item>
@@ -335,13 +338,15 @@ import {
   delAttrs,
   useAssets,
 } from '@/services/common';
+import { useEnterprise } from '@/services/enterprise';
 
+const { enterprise } = useEnterprise();
 const router = useRouter();
 const route = useRoute();
 
 const baseUrl = import.meta.env.BASE_URL || '/';
 
-const { assets, getAssets } = useAssets();
+// const { assets, getAssets } = useAssets();
 
 const { user, signout } = useUser();
 const { setDot } = useDot();
@@ -350,7 +355,7 @@ const data = reactive({
 });
 
 onBeforeMount(async () => {
-  getAssets();
+  // getAssets();
 });
 
 const logout = () => {
@@ -375,7 +380,7 @@ onUnmounted(() => {
 });
 
 const login = () => {
-  return `${assets.account}?cb=${encodeURIComponent(location.href)}`;
+  return `${enterprise['account']}?cb=${encodeURIComponent(location.href)}`;
 };
 
 function load(isNew = false) {