From 92224e3d5e03f223bf2fb4b0eb88b74e790d8da9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 17 一月 2022 10:00:05 +0800
Subject: [PATCH] 2022-01-17

---
 src/index.js                                       |   11 ++++-
 src/pc/components/login/normal-login/options.jsx   |   51 ++++++++++++++++++++++---
 public/admin.html                                  |   10 +++--
 src/pc/components/login/normal-login/loginform.jsx |    3 +
 src/pc/components/login/normal-login/index.scss    |    9 ++++
 5 files changed, 70 insertions(+), 14 deletions(-)

diff --git a/public/admin.html b/public/admin.html
index 41254bc..7a8f45d 100644
--- a/public/admin.html
+++ b/public/admin.html
@@ -22,10 +22,12 @@
             } else {
               var url = window.location.href.split(/(index.html)+/ig)[0]
               var appPort = 'admin/index.html'
-              if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
-                appPort = 'mob/index.html'
-              } else if (config.defaultApp) {
-                appPort = 'pc/index.html'
+              if (config.defaultApp) {
+                if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
+                  appPort = 'mob/index.html#/index'
+                } else {
+                  appPort = 'pc/index.html#/index'
+                }
               }
               window.location.replace(url + appPort)
             }
diff --git a/src/index.js b/src/index.js
index d96c6c3..cee8479 100644
--- a/src/index.js
+++ b/src/index.js
@@ -10,9 +10,7 @@
 import '@/assets/css/minkeicon.css'
 import '@/assets/css/viewstyle.scss'
 
-if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
-  window.location.replace(window.location.href.split(/(index.html)+/ig)[0] + 'mob/index.html')
-} else if (window.location.href.indexOf('#/design') > -1) { // 缂栬緫椤甸潰鍒锋柊鏃讹紝璺宠浆鑷充富椤�
+if (window.location.href.indexOf('#/design') > -1) { // 缂栬緫椤甸潰鍒锋柊鏃讹紝璺宠浆鑷充富椤�
   window.location.replace(window.location.href.replace(/design/ig, 'main'))
 }
 
@@ -67,6 +65,13 @@
   .then(config => {
     if (!config) return
 
+    if (config.defaultApp) {
+      if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
+        window.location.replace(window.location.href.split(/(index.html)+/ig)[0].replace('admin/', '') + 'mob/index.html#/index')
+        return
+      }
+    }
+
     let GLOB = {}
     GLOB.appId = config.appId || ''
     GLOB.lineColor = config.lineColor || ''
diff --git a/src/pc/components/login/normal-login/index.scss b/src/pc/components/login/normal-login/index.scss
index 8ae6194..95e396e 100644
--- a/src/pc/components/login/normal-login/index.scss
+++ b/src/pc/components/login/normal-login/index.scss
@@ -90,6 +90,15 @@
       transform: rotate(45deg);
     }
   }
+  .protocol-wrap {
+    padding: 0 20px 15px;
+    span {
+      font-size: 13px;
+    }
+    .protocol {
+      color: #1890ff;
+    }
+  }
   .login-ways {
     padding: 0 20px 25px;
     span {
diff --git a/src/pc/components/login/normal-login/loginform.jsx b/src/pc/components/login/normal-login/loginform.jsx
index bb7c058..0ca5d72 100644
--- a/src/pc/components/login/normal-login/loginform.jsx
+++ b/src/pc/components/login/normal-login/loginform.jsx
@@ -167,6 +167,9 @@
           </div>
           璇蜂娇鐢ㄥ鎴风鎵竴鎵櫥褰�
         </div> : null}
+        {/* {wrap.protocol === 'true' ? <div className={'protocol-wrap '}>
+          <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span className="protocol" key={i}>銆妠item.label}銆�</span>))}
+        </div> : null} */}
         <div className={'login-ways ' + (activeWay.type === 'app_scan' ? 'center' : '')}>
           {loginWays.map(item => {
             if (item.type === 'app_scan' || activeWay.type === item.type) return null
diff --git a/src/pc/components/login/normal-login/options.jsx b/src/pc/components/login/normal-login/options.jsx
index 45aaffe..bcdbea9 100644
--- a/src/pc/components/login/normal-login/options.jsx
+++ b/src/pc/components/login/normal-login/options.jsx
@@ -133,17 +133,54 @@
     },
     // {
     //   type: 'radio',
-    //   field: 'shortcut',
-    //   label: '蹇嵎鏂瑰紡',
-    //   initval: wrap.shortcut || 'remember',
-    //   tooltip: '璐﹀彿瀵嗙爜鐧诲綍鏃剁殑蹇嵎鏂瑰紡銆�',
+    //   field: 'protocol',
+    //   label: '鍗忚',
+    //   initval: wrap.protocol || 'false',
     //   required: false,
     //   options: [
-    //     {value: 'none', label: '鏃�'},
-    //     {value: 'remember', label: '璁颁綇瀵嗙爜'},
-    //     {value: 'autologon', label: '鑷姩鐧诲綍'},
+    //     {value: 'false', label: '鏃�'},
+    //     {value: 'true', label: '鏈�'},
+    //   ],
+    //   controlFields: [
+    //     {field: 'tip', values: ['true']},
+    //     {field: 'groups', values: ['true']},
     //   ]
     // },
+    // {
+    //   type: 'text',
+    //   field: 'tip',
+    //   label: '鎻愮ず鏂囧瓧',
+    //   initval: wrap.tip || '鎴戝凡闃呰骞跺悓鎰�',
+    //   required: true
+    // },
+    // {
+    //   type: 'table',
+    //   field: 'groups',
+    //   label: '鍗忚缁�',
+    //   initval: wrap.groups || [],
+    //   required: true,
+    //   span: 24,
+    //   columns: [
+    //     {
+    //       title: '鏂囨湰',
+    //       dataIndex: 'label',
+    //       inputType: 'input',
+    //       editable: true,
+    //       unique: true,
+    //       required: true,
+    //       width: '35%'
+    //     },
+    //     {
+    //       title: '閾炬帴',
+    //       dataIndex: 'link',
+    //       inputType: 'input',
+    //       editable: true,
+    //       unique: true,
+    //       required: true,
+    //       width: '40%'
+    //     },
+    //   ]
+    // }
   ]
 
   return wrapForm

--
Gitblit v1.8.0