浏览代码

登录页动态配置渲染

ming 2 年之前
父节点
当前提交
02c2c4170c
共有 3 个文件被更改,包括 27 次插入24 次删除
  1. 1 1
      src/api/login.js
  2. 19 16
      src/pages/login.vue
  3. 7 7
      src/pages/serveConfig.vue

+ 1 - 1
src/api/login.js

@@ -43,7 +43,7 @@ export function getCodeImg(data) {
 /** 获取登录页数据 */
 export function getMobileTenantConfig(data) {
   return request({
-    url: "/system/sysMobileTenantConfig/getMobileTenantConfig",
+    url: "/system/sysMobileTenantConfig/getAppTenantConfig",
     headers: {
       isToken: false,
     },

+ 19 - 16
src/pages/login.vue

@@ -4,20 +4,22 @@
     <!-- <view style="position:absolute;top:10px;right:10px;z-index:99;color:#2a98ff" @tap="goSeverConfig">服务器配置</view> -->
 
     <!-- #ifdef APP-PLUS-->
-    <view style="position:absolute;top:20px;right:15px;z-index:99;color:#2a98ff" @tap="goSeverConfig">服务器配置</view>
+    <view style="position:absolute;top:30px;right:15px;z-index:99;color:#2a98ff" @tap="goSeverConfig">服务器配置</view>
     <!--#endif-->
 
 
     <view class="bg">
-      <!-- <image class="bgImage" :src="bg" v-if="bg" /> -->
-      <!-- <image class="bgImage" src="@/static/images/wt/bg.png" v-if="!bg" /> -->
+      <image class="bgImage" :src="bg" v-if="bg" />
+      <!-- <image class="bgImage" src="@/static/images/wt/bg.png" v-else /> -->
     </view>
 
 
     <view class="middle login">
       <view class="top">
-        <image class="logo" :src="logo" mode="widthFix" v-if="logo" />
-        <text class="title">{{ title }}移动端登录</text>
+        <image class="logo" :src="logo"  v-if="logo" />
+        <image class="logo" src="@/static/logo200.png"  v-else />
+        <text class="title" v-if="title">{{ title }}</text>
+        <text class="title" v-else>移动端配置</text>
       </view>
 
       <view id="login-input" style="margin-top: 20px" v-if="switchText == '账号密码登录'">
@@ -75,10 +77,10 @@ const { proxy } = getCurrentInstance();
 
 const data = reactive({
   /** saas数据 */
-  bg: "/static/images/wt/bg.png",
-  logo: "/static/logo.png",
-  title: undefined,
-  bottomTitle: undefined,
+  bg: "",
+  logo: "",
+  title: '',
+  bottomTitle: '',
   /** login数据 */
   phone: undefined,
   verify: undefined,
@@ -169,6 +171,7 @@ function env() {
 
  //#ifdef H5
   var linkUrl=window.location.host;
+  // var linkUrl='ces.cn';
  //#endif
 
  //#ifdef APP-PLUS
@@ -264,11 +267,10 @@ async function submitRes() {
       return;
     }
 
-
-
     login({
       username: username.value,
       password: password.value,
+      tenantId: tenantId.value,
     });
   }
 }
@@ -294,12 +296,12 @@ async function info() {
 async function getMobileTenantConfigApi(params) {
   getMobileTenantConfig(params).then((res) => {
     if (res.data.length > 0) {
-      let data = res.data.data[0];
-      bg.value = data.loginBackUrl;
+      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);
     }
   });
@@ -378,8 +380,9 @@ onLoad(() => {
       display: flex;
       margin-bottom: 60px;
       .logo {
-        width: 50px;
-        height: 50px;
+        width: 40px;
+        height: auto;
+        max-height:50px;
         margin: 0 20px 0 auto;
       }
       .title {

+ 7 - 7
src/pages/serveConfig.vue

@@ -31,13 +31,13 @@ const dataList = reactive({
         message: "请输入链接地址",
         trigger: ["blur"],
       },
-      {
-        type: "string",
-        required: true,
-        message: "请输入正确的链接地址",
-        pattern: /^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$/,
-        trigger: ["blur", "change"],
-      },
+    //   {
+    //     type: "string",
+    //     required: true,
+    //     message: "请输入正确的链接地址",
+    //     pattern: /^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$/,
+    //     trigger: ["blur", "change"],
+    //   },
     ],
   
   },