Kaynağa Gözat

Merge branch '165' of uskycloud/usky-web-mobile into master

xf15575941817 2 yıl önce
ebeveyn
işleme
6a46d3b497

+ 11 - 3
src/App.vue

@@ -3,7 +3,7 @@ import config from "./config";
 import store from "@/store";
 import { getToken } from "@/utils/auth";
 
-import { defineComponent, getCurrentInstance, inject, onMounted } from "vue";
+import { defineComponent, getCurrentInstance, inject, onMounted, watchEffect } from "vue";
 import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
 
 let tab = inject("$tab");
@@ -24,10 +24,18 @@ function initConfig() {
 
 function checkLogin() {
   if (!getToken()) {
-    // proxy.$tab.reLaunch("/pages/login");
+    proxy.$tab.reLaunch("/pages/login");
   }
 }
 
+watchEffect(() => {
+  //#ifdef APP-PLUS
+  if (uni.getStorageSync("serveUrl")) {
+    config.baseUrl = "http://" + uni.getStorageSync("serveUrl") + "/prod-api";
+  }
+  //#endif
+});
+
 onShow(() => {
   console.log("App Show");
 });
@@ -39,7 +47,7 @@ onHide(() => {
 onLaunch(() => {
   console.log("App Launch");
   // #ifdef APP-PLUS
-  plus.screen.lockOrientation("portrait-primary");//设置不可横屏
+  plus.screen.lockOrientation("portrait-primary"); //设置不可横屏
   // #endif
   initApp();
 });

+ 16 - 27
src/pages.json

@@ -1,20 +1,5 @@
 {
   "pages": [
-    {
-      "path": "pages/login",
-      "style": {
-        "navigationBarTitleText": "登录",
-        "navigationStyle": "custom",
-        "navigationBarTextStyle": "black" // 仅支持 black/white
-      }
-    },
-    {
-      "path": "pages/serveConfig",
-      "style": {
-        "navigationBarTitleText": "服务器配置",
-        "navigationStyle": "custom"
-      }
-    },
     {
       "path": "pages/index",
       "style": {
@@ -42,6 +27,21 @@
         }
       }
     },
+    {
+      "path": "pages/login",
+      "style": {
+        "navigationBarTitleText": "登录",
+        "navigationStyle": "custom",
+        "navigationBarTextStyle": "black" // 仅支持 black/white
+      }
+    },
+    {
+      "path": "pages/serveConfig",
+      "style": {
+        "navigationBarTitleText": "服务器配置",
+        "navigationStyle": "custom"
+      }
+    },
     {
       "path": "pages/mine/index",
       "style": {
@@ -137,9 +137,7 @@
       }
     },
     //消防督察单模块 开始
-
     //消防督察单模块 结束
-
     //巡检模块 开始
     {
       "path": "pages/business/mhxf/xunJian/xunJian",
@@ -240,7 +238,6 @@
       }
     },
     //巡检模块 结束
-
     //信息查询 开始
     {
       "path": "pages/business/mhxf/informationSelect/index",
@@ -257,7 +254,6 @@
       }
     },
     //信息查询 结束
-
     //设备管理 开始
     {
       "path": "pages/business/mhxf/deviceManage/index",
@@ -267,7 +263,6 @@
       }
     },
     //设备管理 结束
-
     //协同作战地图 开始
     {
       "path": "pages/business/mhxf/coordination/index",
@@ -277,7 +272,6 @@
       }
     },
     //协同作战地图 结束
-
     //单位信息采集 开始
     {
       "path": "pages/business/mhxf/unitInfoCollection/index",
@@ -287,7 +281,6 @@
       }
     },
     //单位信息采集 结束
-
     //消防报告 开始
     {
       "path": "pages/business/mhxf/fireReport/index",
@@ -311,7 +304,6 @@
       }
     },
     //消防报告 结束
-
     //待办事项 开始
     {
       "path": "pages/business/mhxf/needMatter/index",
@@ -321,7 +313,6 @@
       }
     },
     //待办事项 结束
-
     //消息 开始
     {
       "path": "pages/info/info",
@@ -352,7 +343,6 @@
       }
     },
     //消息 结束
-
     //分析 开始
     {
       "path": "pages/analyse/analyse",
@@ -361,7 +351,6 @@
       }
     },
     //分析 结束
-
     //设置 开始
     {
       "path": "pages/setting/setting",
@@ -450,4 +439,4 @@
       }
     ]
   }
-}
+}

+ 73 - 229
src/pages/business/mhxf/unitInfoCollection/index.vue

@@ -154,7 +154,11 @@
                 />
               </u-form-item>
 
-              <view v-if="li.baseBuild.useCharacter == '厂房' || li.baseBuild.useCharacter == '仓库'">
+              <view
+                v-if="
+                  li.baseBuild.useCharacter == '生产类厂房' || li.baseBuild.useCharacter == '仓库、物流' || li.baseBuild.useCharacter == '涉及易燃易爆危险品的单位(生产、充装、储存、供应、销售等)'
+                "
+              >
                 <view style="margin: 10px 0; text-align: center">危险品生产数量(吨/月)</view>
                 <u-form-item label="甲类" prop="li.baseBuildAttach.hazardousProduceA" :borderBottom="true">
                   <u-input type="number" v-model="li.baseBuildAttach.hazardousProduceA" placeholder="请输入甲类" border="none" maxlength="24" />
@@ -323,157 +327,85 @@ const publicStores = publicStore();
 
 const checkboxValue = ref([]);
 
+//基本信息-单位使用性质下拉数据存储
+const companyNatureList = ref([
+  [
+    { value: 1, name: "餐饮场所" },
+    { value: 2, name: "超市" },
+    { value: 3, name: "宾(旅)馆" },
+    { value: 4, name: "商场" },
+    { value: 5, name: "集贸市场" },
+    { value: 6, name: "体育场馆、会堂" },
+    { value: 7, name: "影剧院、放映厅(录像厅)、礼堂等演出、放映场所" },
+    { value: 8, name: "歌舞娱乐场所(含KTV、夜总会、具有娱乐功能的餐饮场所)" },
+    { value: 9, name: "网吧" },
+    { value: 10, name: "棋牌室" },
+    { value: 11, name: "美容院(含SPA、瘦身等)" },
+    { value: 12, name: "足浴" },
+    { value: 13, name: "浴室(含洗浴、桑拿按摩、汗蒸等)" },
+    { value: 14, name: "营业性健身、休闲场所" },
+    { value: 15, name: "托儿所幼儿园" },
+    { value: 16, name: "中小学校" },
+    { value: 17, name: "大学" },
+    { value: 18, name: "教育培训机构(含早教中心、亲子活动场所等)" },
+    { value: 19, name: "养老院" },
+    { value: 20, name: "福利院" },
+    { value: 21, name: "医院" },
+    { value: 22, name: "月子会所" },
+    { value: 23, name: "公共图书馆、展览馆、博物馆" },
+    { value: 24, name: "宗教活动场所" },
+    { value: 25, name: "机场航站楼、客运车站候车室、客运码头候船厅" },
+    { value: 26, name: "政府机关" },
+    { value: 27, name: "广播电台、电视台和邮政、通信枢纽" },
+    { value: 28, name: "文物保护单位" },
+    { value: 29, name: "具有生产性质的厂房" },
+    { value: 30, name: "大型仓库、物流企业" },
+    { value: 31, name: "综合性工业企业、园区(含生产、仓库等)" },
+    { value: 32, name: "其他" },
+  ],
+]);
 //建筑-建筑结构下拉数据存储
 const buildStructureList = ref([
   [
-    {
-      value: 2,
-      name: "钢筋混凝土",
-    },
-    {
-      value: 1,
-      name: "砖混结构",
-    },
-    {
-      value: 3,
-      name: "钢结构",
-    },
-    {
-      value: 4,
-      name: "大型钢筋混凝土",
-    },
-    {
-      value: 5,
-      name: "木质结构",
-    },
-    {
-      value: 6,
-      name: "砖木结构",
-    },
+    { value: 2, name: "钢筋混凝土" },
+    { value: 1, name: "砖混结构" },
+    { value: 3, name: "钢结构" },
+    { value: 4, name: "大型钢筋混凝土" },
+    { value: 5, name: "木质结构" },
+    { value: 6, name: "砖木结构" },
   ],
 ]);
 //建筑-使用性质下拉数据存储
 const useCharacterList = ref([
   [
-    {
-      value: 1,
-      name: "大型综合体",
-    },
-    {
-      value: 2,
-      name: "餐饮场所",
-    },
-    {
-      value: 3,
-      name: "宾馆(旅馆)",
-    },
-    {
-      value: 4,
-      name: "商场",
-    },
-    {
-      value: 5,
-      name: "办公",
-    },
-    {
-      value: 6,
-      name: "科研",
-    },
-    {
-      value: 7,
-      name: "影剧院(放映厅、礼堂)",
-    },
-    {
-      value: 8,
-      name: "歌舞娱乐场所(含具有娱乐功能的茶座、餐饮场所)",
-    },
-    {
-      value: 9,
-      name: "游艺游乐场所(含网吧、棋牌、游艺厅等)",
-    },
-    {
-      value: 10,
-      name: "营业性健身休闲场所(含健身、旱冰场、洗浴、美容等)",
-    },
-
-    {
-      value: 11,
-      name: "集贸市场",
-    },
-    {
-      value: 12,
-      name: "医院",
-    },
-
-    {
-      value: 13,
-      name: "学校",
-    },
-    {
-      value: 14,
-      name: "养老机构",
-    },
-    {
-      value: 15,
-      name: "图书展览馆",
-    },
-    {
-      value: 16,
-      name: "大型宗教场所",
-    },
-    {
-      value: 17,
-      name: "体育场馆",
-    },
-    {
-      value: 18,
-      name: "客运站(航站楼、候船厅)",
-    },
-    {
-      value: 19,
-      name: "厂房",
-    },
-    {
-      value: 20,
-      name: "仓库",
-    },
-    {
-      value: 21,
-      name: "涉及易燃易爆危险品的单位(生产、充装、储存、供应、销售等)",
-    },
-    {
-      value: 22,
-      name: "其他",
-    },
+    { value: 1, name: "大型综合体" },
+    { value: 2, name: "商业" },
+    { value: 3, name: "办公" },
+    { value: 4, name: "住宿" },
+    { value: 5, name: "科研" },
+    { value: 6, name: "政府机关" },
+    { value: 7, name: "医院、医疗机构" },
+    { value: 8, name: "学校" },
+    { value: 9, name: "宗教场所" },
+    { value: 10, name: "客运站(航站楼、候船厅)" },
+    { value: 11, name: "展览、博物馆" },
+    { value: 12, name: "体育场馆" },
+    { value: 13, name: "客运站(航站楼、候船厅)" },
+    { value: 14, name: "生产类厂房" },
+    { value: 15, name: "仓库、物流" },
+    { value: 16, name: "涉及易燃易爆危险品的单位(生产、充装、储存、供应、销售等)" },
+    { value: 17, name: "其他(需具体填写)" },
   ],
 ]);
 //建筑-灭火器下拉数据存储
 const extinguishTypeList = ref([
   [
-    {
-      value: 1,
-      name: "水基型灭火器",
-    },
-    {
-      value: 2,
-      name: "干粉灭火器",
-    },
-    {
-      value: 3,
-      name: "洁净气体灭火器",
-    },
-    {
-      value: 4,
-      name: "二氧化碳灭火器",
-    },
-    {
-      value: 5,
-      name: "泡沫灭火器",
-    },
-    {
-      value: 6,
-      name: "其他灭火器",
-    },
+    { value: 1, name: "水基型灭火器" },
+    { value: 2, name: "干粉灭火器" },
+    { value: 3, name: "洁净气体灭火器" },
+    { value: 4, name: "二氧化碳灭火器" },
+    { value: 5, name: "泡沫灭火器" },
+    { value: 6, name: "其他灭火器" },
   ],
 ]);
 
@@ -1053,96 +985,7 @@ function handleAction(value, index, ind) {
   if (value == "单位使用性质") {
     actionTitle.value = "单位使用性质";
 
-    actionsList.value = [
-      [
-        {
-          value: 1,
-          name: "餐饮场所",
-        },
-        {
-          value: 2,
-          name: "宾馆(旅馆)",
-        },
-        {
-          value: 3,
-          name: "商场",
-        },
-        {
-          value: 4,
-          name: "办公",
-        },
-        {
-          value: 5,
-          name: "科研",
-        },
-        {
-          value: 6,
-          name: "影剧院(放映厅、礼堂)",
-        },
-        {
-          value: 7,
-          name: "歌舞娱乐场所(含具有娱乐功能的茶座、餐饮场所)",
-        },
-        {
-          value: 8,
-          name: "游艺游乐场所(含网吧、棋牌、游艺厅等)",
-        },
-        {
-          value: 9,
-          name: "营业性健身休闲场所(含健身、旱冰场、洗浴、美容等)",
-        },
-
-        {
-          value: 10,
-          name: "集贸市场",
-        },
-        {
-          value: 11,
-          name: "医院",
-        },
-
-        {
-          value: 12,
-          name: "学校",
-        },
-        {
-          value: 13,
-          name: "养老机构",
-        },
-        {
-          value: 14,
-          name: "图书展览馆",
-        },
-        {
-          value: 15,
-          name: "大型宗教场所",
-        },
-        {
-          value: 16,
-          name: "体育场馆",
-        },
-        {
-          value: 17,
-          name: "客运站(航站楼、候船厅)",
-        },
-        {
-          value: 18,
-          name: "厂房",
-        },
-        {
-          value: 19,
-          name: "仓库",
-        },
-        {
-          value: 20,
-          name: "涉及易燃易爆危险品的单位(生产、充装、储存、供应、销售等)",
-        },
-        {
-          value: 21,
-          name: "其他",
-        },
-      ],
-    ];
+    actionsList.value = companyNatureList.value;
 
     actionDefaultIndex.value = 0;
   }
@@ -1258,6 +1101,7 @@ function selectAction(e) {
           el.baseBuild.buildStructure = e.name;
         }
       });
+
       //使用性质
       useCharacterList.value[0].forEach((e) => {
         if (e.value == el.baseBuild.useCharacter) {

+ 1 - 1
src/pages/common/webview/index.vue

@@ -1,6 +1,6 @@
 <template>
   <view v-if="params.url">
-    <web-view :webview-styles="webviewStyles" :src="`${params.url}`"></web-view>
+    <web-view :webview-styles="webviewStyles" :src="`${params.url}`" allow></web-view>
   </view>
 </template>
 

+ 9 - 4
src/pages/index.vue

@@ -171,6 +171,7 @@ import * as jwx from "@/utils/jssdk.js"; //引入js sdk的封装
 
 import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
 import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
+import { getToken } from "@/utils/auth";
 import useStores from "@/store/modules/user.js";
 import publicStore from "@/store/modules/public";
 
@@ -232,7 +233,7 @@ function swiperChange(e) {
  * @轮播图点击事件
  */
 function swiperClick(list) {
-  if (list instanceof Object) {
+  if (typeof list == "object") {
     let linkType = arrayList.swiperList[arrayList.swiperIndex].linkType;
     let url = arrayList.swiperList[arrayList.swiperIndex].link;
 
@@ -274,9 +275,9 @@ function getMobileBannerApi() {
 
 onLoad((option) => {
   //获取首页标题
-  if (uni.getStorageSync("homeTitle")) {
+  if (useStore.$state.loginTitle) {
     uni.setNavigationBarTitle({
-      title: uni.getStorageSync("homeTitle"),
+      title: useStore.$state.loginTitle,
     });
   } else {
     uni.setNavigationBarTitle({
@@ -284,6 +285,10 @@ onLoad((option) => {
     });
   }
 
+  console.log(useStore.$state.tenantId)
+
+  console.log(useStore.$state.name)
+
   if (uni.getStorageSync(useStore.$state.name)) {
     arrayList.recentlyUsed = uni.getStorageSync(useStore.$state.name);
   }
@@ -324,7 +329,7 @@ function scanCode() {
       qrCodeSend({
         qrCode: list.uid,
         tenantId: useStore.$state.tenantId,
-        userName: useStore.$state.userName,
+        userName: useStore.$state.name,
       }).then((res) => {});
     },
     fail: (err) => {

+ 40 - 76
src/pages/login.vue

@@ -3,15 +3,15 @@
     <!-- <u-loading-page :loading="true" loading-text="loading..."  loading-mode="spinner"></u-loading-page> -->
 
     <view class="bg">
-      <image class="bgImage" :src="bg" v-if="bg" />
+      <image class="bgImage" :src="useStore.$state.loginBg" v-if="useStore.$state.loginBg" />
       <!-- <image class="bgImage" src="@/static/images/wt/bg.png" v-else /> -->
     </view>
 
     <view class="middle">
       <view class="top">
-        <image class="logo" mode="heightFix" :src="logo" v-if="logo" />
+        <image class="logo" mode="heightFix" :src="useStore.$state.loginLogo" v-if="useStore.$state.loginLogo" />
         <image class="logo" mode="heightFix" src="@/static/logo200.png" v-else />
-        <text class="title" v-if="title">{{ title }}</text>
+        <text class="title" v-if="useStore.$state.loginTitle">{{ useStore.$state.loginTitle }}</text>
         <text class="title" v-else>移动端登录</text>
       </view>
 
@@ -50,8 +50,8 @@
       <!--  -->
       <button class="submit" @click="submitRes">登 录</button>
 
-      <view class="switchText" @click="switchMode">
-        <text>{{ switchText }}</text>
+      <view class="switchText">
+        <text @click="switchMode">{{ switchText }}</text>
       </view>
 
       <!-- #ifdef APP-PLUS -->
@@ -67,16 +67,16 @@
       <!--#endif-->
     </view>
     <view class="bottom">
-      <div class="title">{{ bottomTitle }}</div>
+      <div class="title">{{ useStore.$state.loginBottomTitle }}</div>
     </view>
   </view>
 </template>
 
 <script setup>
 import { onLoad, onShow, onHide, onLaunch, onReady } from "@dcloudio/uni-app";
-import { reactive, getCurrentInstance, toRefs, inject, watchEffect } from "vue";
+import { reactive, getCurrentInstance, toRefs, inject } from "vue";
 import { getToken, setToken, removeToken } from "@/utils/auth";
-import { getCodeImg, getMobileTenantConfig } from "@/api/login";
+import { getCodeImg } from "@/api/login";
 
 import publicStore from "@/store/modules/public.js";
 
@@ -87,17 +87,11 @@ const newPublicStore = publicStore();
 const { proxy } = getCurrentInstance();
 
 const data = reactive({
-  /** saas数据 */
-  bg: "",
-  logo: "",
-  title: "",
-  bottomTitle: "",
   /** login数据 */
   phone: undefined,
   verify: undefined,
   codeTime: 0,
   switchText: "验证码登录",
-  tenantId: undefined,
   username: undefined,
   password: undefined,
   inputIconBool: true,
@@ -109,7 +103,7 @@ const data = reactive({
   // VerificationCodeOne
 });
 
-const { title, bg, bottomTitle, logo, phone, verify, codeTime, switchText, username, password, tenantId, inputIconBool, linkUrl, userChecked } = toRefs(data);
+const { phone, verify, codeTime, switchText, username, password, inputIconBool, linkUrl, userChecked } = toRefs(data);
 
 function goSeverConfig() {
   proxy.$tab.navigateTo("/pages/serveConfig");
@@ -128,7 +122,7 @@ function switchMode() {
 function getVerifyCode() {
   //#ifdef APP-PLUS
   if (!uni.getStorageSync("serveUrl")) {
-    proxy.$modal.msg("首次登录请先进行服务器配置");
+    proxy.$modal.msg("首次账号登录请先配置服务器");
     return;
   }
   //#endif
@@ -174,42 +168,46 @@ function getVerifyCode() {
  * 判断运行环境
  */
 function env() {
+  useStore.SET_LOGINMOBILELIST({
+    loginTitle: "",
+    loginBottomTitle: "",
+    loginBg: "",
+    loginLogo: "",
+    tenantId: "",
+  });
+
   // const u = navigator.userAgent
   // //https://blog.csdn.net/weixin_42659644/article/details/126294231
   // if(u.indexOf('saas')>-1){ //指定app内 获取app识别号
   // }else{
   // }
 
-  //#ifdef H5
-  linkUrl.value = window.location.host;
-  // linkUrl.value = window.location.host;
-  // linkUrl.value='ces.cn';
-  // linkUrl.value='172.16.120.165:13203'
-  getMobileTenantConfigApi({ url: linkUrl.value });
-  //#endif
-
-  //  uni.showToast({
-  //   title: '服务器链接地址为'+linkUrl,
-  //   icon: "none",
-  // })
-
   //  let port = uni.getSystemInfoSync().platform;
   // switch (port) {
-  //   case "android":
-  //     getMobileTenantConfigApi({ url: window.location.host });
-  //     console.log("Android"); //android
-  //     break;
-  //   case "ios":
-  //     console.log("iOS"); //ios
-  //     getMobileTenantConfigApi({ url: window.location.host });
-  //     break;
   //   case "windows":
-  //     getMobileTenantConfigApi({ url: window.location.host });
+  //     useStore.GetMobileTenantConfig({ url: window.location.host });
   //     break;
   //   default: //devtools
   //     console.log("小程序");
   //     break;
   // }
+
+  //#ifdef H5
+  if (window.location.host) {
+    linkUrl.value = window.location.host;
+    // linkUrl.value = window.location.host;
+    // linkUrl.value='ces.cn';
+    // linkUrl.value='172.16.120.165:13203'
+    useStore.GetMobileTenantConfig({ url: linkUrl.value });
+  }
+  //#endif
+
+  //#ifdef APP-PLUS
+  if (uni.getStorageSync("serveUrl")) {
+    linkUrl.value = uni.getStorageSync("serveUrl");
+    useStore.GetMobileTenantConfig({ url: linkUrl.value });
+  }
+  //#endif
 }
 
 /** 点击提交按钮 */
@@ -244,7 +242,7 @@ function submitRes() {
     login({
       phone: phone.value,
       verify: verify.value,
-      tenantId: tenantId.value,
+      tenantId: useStore.$state.tenantId,
     });
   } else {
     if (!username.value) {
@@ -259,7 +257,7 @@ function submitRes() {
     login({
       username: username.value,
       password: password.value,
-      tenantId: tenantId.value,
+      tenantId: useStore.$state.tenantId,
     });
   }
 }
@@ -277,23 +275,6 @@ function login(data) {
   });
 }
 
-/** 获取登录页数据 */
-function getMobileTenantConfigApi(params) {
-  getMobileTenantConfig(params).then((res) => {
-    if (res.data.length > 0) {
-      let data = res.data[0];
-      title.value = data.loginTitle;
-      bottomTitle.value = data.loginFooter;
-      tenantId.value = data.tenantId;
-      bg.value = data.loginBackUrl;
-      logo.value = data.loginLogo;
-      uni.setStorageSync("homeTitle", data.loginTitle);
-
-      useStore.$state.tenantId = data.tenantId;
-    }
-  });
-}
-
 // 用户协议
 function handleUserAgrement() {
   let site = getApp().globalData.config.appInfo.agreements[0];
@@ -305,28 +286,11 @@ function handlePrivacy() {
   proxy.$tab.navigateTo(`/pages/common/textview/index1?title=${site.title}&content=${site.content}`);
 }
 
-watchEffect(() => {
-  //#ifdef APP-PLUS
-  if (uni.getStorageSync("serveUrl")) {
-    linkUrl.value = uni.getStorageSync("serveUrl");
-    getMobileTenantConfigApi({ url: linkUrl.value });
-  }
-  //#endif
-});
-
 /**
  * @onLoad
  */
 onLoad(() => {
   env();
-
-  const token = getToken();
-  //需要登录
-  if (token) {
-    uni.switchTab({
-      url: "/pages/index",
-    });
-  }
 });
 
 // onReady(() => {
@@ -534,12 +498,12 @@ page {
   }
 
   .bottom {
-    position: absolute;
+    position: fixed;
     width: 100%;
     bottom: 10px;
     .title {
       text-align: center;
-      color: #000;
+      color: #96a6b5;
       font-size: 14px;
     }
   }

+ 2 - 2
src/pages/mine/index.vue

@@ -21,7 +21,7 @@
     </view>
 
     <view class="content-section">
-      <view class="mine-actions grid col-4 text-center">
+      <!-- <view class="mine-actions grid col-4 text-center">
         <view class="action-item" @click="handleJiaoLiuQun">
           <view class="iconfont icon-friendfill text-pink icon"></view>
           <text class="text">客服QQ</text>
@@ -38,7 +38,7 @@
           <view class="iconfont icon-dianzan text-green icon"></view>
           <text class="text">点赞我们</text>
         </view>
-      </view>
+      </view> -->
 
       <view class="menu-list">
         <view class="list-cell list-cell-arrow" @click="handleToEditInfo">

+ 11 - 4
src/pages/serveConfig.vue

@@ -13,7 +13,9 @@
     <view class="bottom">
       <u-input style="margin-bottom: 15px" v-model="linkUrl" placeholder="服务器地址(必填)" border="none" clearable> </u-input>
 
-      <u-input v-model="port" type="number" placeholder="端口号(必填)" border="none" maxlength="5" clearable> </u-input>
+      <!-- <u-input v-model="port" type="number" placeholder="端口号(必填)" border="none" maxlength="5" clearable> </u-input> -->
+
+      <u-input v-model="port" type="number" placeholder="端口号(非必填)" border="none" maxlength="5" clearable> </u-input>
 
       <u-button type="primary" style="width: 100%; height: 45px; font-size: 17px; margin-top: 20px" @click="handleSubmit()" shape="circle"> 保 存</u-button>
     </view>
@@ -86,12 +88,17 @@ function handleSubmit() {
     return;
   }
 
+  // if (!port.value) {
+  //   proxy.$modal.msg("请输入端口号");
+  //   return;
+  // }
+
   if (!port.value) {
-    proxy.$modal.msg("请输入端口号");
-    return;
+    uni.setStorageSync("serveUrl", linkUrl.value);
+  } else {
+    uni.setStorageSync("serveUrl", linkUrl.value + ":" + port.value);
   }
 
-  uni.setStorageSync("serveUrl", linkUrl.value + ":" + port.value);
   config.baseUrl = "http://" + uni.getStorageSync("serveUrl") + "/prod-api";
   navigateTo();
 }

+ 1 - 1
src/pages/setting/setting.vue

@@ -3,7 +3,7 @@
     <view class="top-banner justify-center align-center text-center">
       <view>
         <image width="130" src="@/static/images/setting/personal-head.png"></image>
-        <view class="userName">{{ useStores.$state.userName }}</view>
+        <view class="userName">{{ useStores.$state.name }}</view>
         <!-- <view>上海永天科技股份有限公司</view> -->
       </view>
     </view>

+ 1 - 1
src/permission.js

@@ -34,4 +34,4 @@ list.forEach((item) => {
       console.log(err);
     },
   });
-});
+});

+ 51 - 9
src/store/modules/user.js

@@ -1,6 +1,6 @@
 import storage from "@/utils/storage";
 import constant from "@/utils/constant";
-import { login, logout, getInfo } from "@/api/login";
+import { login, logout, getInfo, getMobileTenantConfig } from "@/api/login";
 import { getToken, setToken, removeToken } from "@/utils/auth";
 import { defineStore } from "pinia";
 import modal from "@/plugins/modal.js";
@@ -8,12 +8,16 @@ import modal from "@/plugins/modal.js";
 const useStores = defineStore("useStores", {
   state: () => ({
     token: getToken(),
-    name: storage.get(constant.name),
+    name: storage.get(constant.name),//用户名称
     avatar: storage.get(constant.avatar),
     roles: storage.get(constant.roles),
     permissions: storage.get(constant.permissions),
-    userName: "",
-    tenantId:"",
+
+    loginTitle: storage.get(constant.loginTitle),
+    loginBottomTitle: storage.get(constant.loginFooter),
+    loginBg: storage.get(constant.loginBackUrl),
+    loginLogo: storage.get(constant.loginLogo),
+    tenantId: storage.get(constant.tenantId),
   }),
   persist: {
     // 自定义数据持久化方式
@@ -34,8 +38,8 @@ const useStores = defineStore("useStores", {
       return new Promise((resolve, reject) => {
         login(data)
           .then((res) => {
+            this.SET_TOKEN(res.data.access_token)
             setToken(res.data.access_token);
-            this.token = res.data.access_token;
             resolve();
           })
           .catch((error) => {
@@ -46,16 +50,29 @@ const useStores = defineStore("useStores", {
       });
     },
 
+    //获取登录页数据
+    GetMobileTenantConfig(params) {
+      getMobileTenantConfig(params).then((res) => {
+        if (res.data.length > 0) {
+          let data = res.data[0];
+          this.SET_LOGINMOBILELIST({
+            loginTitle: data.loginTitle,
+            loginBottomTitle: data.loginFooter,
+            loginBg: data.loginBackUrl,
+            loginLogo: data.loginLogo,
+            tenantId: data.tenantId,
+          })
+        }
+      });
+    },
+
     // 获取用户信息
     GetInfo() {
       return new Promise((resolve, reject) => {
         getInfo()
           .then((res) => {
-            console.log(res.data);
             var data = res.data;
 
-            this.userName = data.user.userName;
-
             if (data.roles && data.roles.length > 0) {
               this.SET_ROLES(data.roles);
               this.SET_PERMISSIONS(data.permissions);
@@ -79,9 +96,16 @@ const useStores = defineStore("useStores", {
       return new Promise((resolve, reject) => {
         logout()
           .then(() => {
-            this.SET_TOKEN("");
+            this.SET_TOKEN("");//清空token
             this.SET_ROLES([]);
             this.SET_PERMISSIONS([]);
+            this.SET_LOGINMOBILELIST({
+              loginTitle: "",
+              loginBottomTitle: "",
+              loginBg: "",
+              loginLogo: "",
+              tenantId: "",
+            });//清空登录页数据
             removeToken();
             storage.clean();
             resolve();
@@ -112,6 +136,24 @@ const useStores = defineStore("useStores", {
       this.permissions = permissions;
       storage.set(constant.permissions, permissions);
     },
+
+    SET_LOGINMOBILELIST(loginMobileList) {
+      //title
+      this.loginTitle = loginMobileList.loginTitle
+      storage.set(constant.loginTitle, loginMobileList.loginTitle);
+      //bottomTitle
+      this.loginBottomTitle = loginMobileList.loginBottomTitle
+      storage.set(constant.loginBottomTitle, loginMobileList.loginBottomTitle);
+      //bg
+      this.loginBg = loginMobileList.loginBg
+      storage.set(constant.loginBg, loginMobileList.loginBg);
+      //logo
+      this.loginLogo = loginMobileList.loginLogo
+      storage.set(constant.loginLogo, loginMobileList.loginLogo);
+      //tenantId
+      this.tenantId = loginMobileList.tenantId
+      storage.set(constant.tenantId, loginMobileList.tenantId);
+    }
   },
 });
 

+ 12 - 6
src/utils/constant.js

@@ -1,8 +1,14 @@
 const constant = {
-   avatar: 'vuex_avatar',
-   name: 'vuex_name',
-   roles: 'vuex_roles',
-   permissions: 'vuex_permissions'
- }
+  avatar: 'vuex_avatar',
+  name: 'vuex_name',
+  roles: 'vuex_roles',
+  permissions: 'vuex_permissions',
 
- export default constant
+  loginTitle: 'vuex_loginTitle',
+  loginBottomTitle: 'vuex_loginBottomTitle',
+  loginBg: 'vuex_loginBg',
+  loginLogo: 'vuex_loginLogo',
+  tenantId: 'vuex_tenantId', 
+}
+
+export default constant

+ 5 - 5
src/utils/storage.js

@@ -4,13 +4,13 @@ import constant from './constant'
 let storageKey = 'storage_data'
 
 // 存储节点变量名
-let storageNodeKeys = [constant.avatar, constant.name, constant.roles, constant.permissions]
+let storageNodeKeys = [constant.avatar, constant.name, constant.roles, constant.permissions, constant.loginTitle, constant.loginBottomTitle, constant.loginBg, constant.loginLogo, constant.tenantId]
 
 // 存储的数据
 let storageData = uni.getStorageSync(storageKey) || {}
 
 const storage = {
-  set: function(key, value) {
+  set: function (key, value) {
     if (storageNodeKeys.indexOf(key) != -1) {
       let tmp = uni.getStorageSync(storageKey)
       tmp = tmp ? tmp : {}
@@ -18,14 +18,14 @@ const storage = {
       uni.setStorageSync(storageKey, tmp)
     }
   },
-  get: function(key) {
+  get: function (key) {
     return storageData[key] || ""
   },
-  remove: function(key) {
+  remove: function (key) {
     delete storageData[key]
     uni.setStorageSync(storageKey, storageData)
   },
-  clean: function() {
+  clean: function () {
     uni.removeStorageSync(storageKey)
   }
 }