Browse Source

服务器配置

ming 2 years ago
parent
commit
5d677280ff
3 changed files with 55 additions and 38 deletions
  1. 51 32
      src/pages/login.vue
  2. 3 5
      src/pages/serveConfig.vue
  3. 1 1
      src/static/scss/public.scss

+ 51 - 32
src/pages/login.vue

@@ -1,6 +1,7 @@
 <template>
   <view class="section">
 
+    <!-- <view style="position:absolute;top:10px;right:10px;z-index:99;color:#2a98ff" @tap="goSeverConfig">服务器配置</view> -->
 
     <!-- #ifdef APP-PLUS-->
     <view style="position:absolute;top:10px;right:10px;z-index:99;color:#2a98ff" @tap="goSeverConfig">服务器配置</view>
@@ -163,33 +164,56 @@ function env() {
   // }else{
   // }
 
-  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":
-      // console.log("H5"); //H5
-      //getMobileTenantConfigApi({ url: "172.16.1.47:3000" })
-      getMobileTenantConfigApi({ url: window.location.host });
-      break;
-    default: //devtools
-      console.log("小程序");
-      break;
+
+
+
+ //#ifdef H5
+  var linkUrl=window.location.host;
+ //#endif
+
+ //#ifdef APP-PLUS
+ var linkUrl=newPublicStore.serveUrl;
+ if(!newPublicStore.serveUrl){
+    uni.showToast({
+        title: '请进行服务器配置...',
+        icon: "none",
+      })
+  }else{
+    uni.showToast({
+        title: linkUrl,
+        icon: "none",
+      })
   }
+ //#endif
+
+ getMobileTenantConfigApi({ url:linkUrl });
+
+  //  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 });
+  //     break;
+  //   default: //devtools
+  //     console.log("小程序");
+  //     break;
+  // }
 }
 
-// #ifdef H5
-env();
-// #endif
+
+
+
 
 /** 点击提交按钮 */
 async function submitRes() {
+
   if (switchText.value == "账号密码登录") {
     if (!phone.value) {
       uni.showToast({
@@ -232,16 +256,7 @@ async function submitRes() {
       });
       return;
     }
-    
-    // #ifdef APP-PLUS
-    if(newPublicStore.serveUrl){
-      login({
-        username: username.value,
-        password: password.value,
-        serveUrl: newPublicStore.serveUrl
-      });
-    }
-    // #endif
+
 
 
     login({
@@ -253,7 +268,7 @@ async function submitRes() {
 
 /** 获取登录数据 */
 async function login(data) {
-  proxy.$modal.loading("登录中,请耐心等待...");
+  // proxy.$modal.loading("登录中,请耐心等待...");
 
   useStore.Login(data).then(() => {
     info();
@@ -295,6 +310,10 @@ function inputIcon() {
  * @onLoad
  */
 onLoad(() => {
+
+  env();
+
+
   const token = getToken();
   //需要登录
   if (token) {

+ 3 - 5
src/pages/serveConfig.vue

@@ -4,7 +4,6 @@
             <u--form :model="form" ref="uForm" :rules="rules" labelWidth="80">
                 <u-form-item label="链接地址" prop="linkUrl" required :borderBottom="true">
                     <u-input class="configInput" v-model="form.linkUrl" placeholder="请输入链接地址" border="none">
-
                     </u-input>
                 </u-form-item>
                 <view >
@@ -86,12 +85,11 @@ body {
 
     }
     ::v-deep .uni-input-input{
-        padding:8px
+        // padding:8px
     }
 
-      .uni-input-placeholder {
-        padding: 10px;
-
+    ::v-deep .u-input {
+        padding:0 5px!important;
     }
 
     ::v-deep .u-line {

+ 1 - 1
src/static/scss/public.scss

@@ -185,7 +185,7 @@ uni-input {
 
   :-webkit-autofill {
     caret-color: #fff; // 设置光标颜色
-    -webkit-text-fill-color: #ededed !important;
+    // -webkit-text-fill-color: gray !important;
     -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
     background-color: transparent;
     background-image: none;