gyj пре 2 година
родитељ
комит
70e12e5618
6 измењених фајлова са 37 додато и 17 уклоњено
  1. 1
    1
      App.vue
  2. 4
    3
      config.js
  3. 8
    2
      pages.json
  4. 12
    3
      pages/login.vue
  5. 4
    3
      permission.js
  6. 8
    5
      utils/request.js

+ 1
- 1
App.vue Прегледај датотеку

@@ -32,7 +32,7 @@
32 32
 			},
33 33
 			checkLogin() {
34 34
 				if (!getToken()) {
35
-					this.$tab.reLaunch('/pages/login')
35
+					this.$tab.reLaunch('/pages/switchSystem')
36 36
 				}
37 37
 			}
38 38
 		}

+ 4
- 3
config.js Прегледај датотеку

@@ -1,10 +1,11 @@
1 1
 // 应用全局配置
2 2
 module.exports = {
3 3
 	// baseUrl: 'https://api.xayunmei.com/zhongcaiapi',
4
-	baseUrl: 'https://api.xayunmei.com/zhongcaiapitest',
4
+	// baseUrl: 'https://api.xayunmei.com/zhongcaiapitest',
5 5
 	// baseUrl: 'http://121.40.189.20:9001',
6
-	// baseUrl: 'http://121.40.189.20:8001',
7
-	// baseUrl: 'http://192.168.3.77:8080',
6
+	baseUrlZC: 'http://121.40.189.20:6001',
7
+	baseUrlTJ: 'http://121.40.189.22:8001',
8
+	// baseUrl: 'http://172.16.1.24:8001',
8 9
 	// baseUrl: 'http://localhost:8080',
9 10
 	// baseUrl: 'http://192.168.3.18:9001',
10 11
 	// 应用信息

+ 8
- 2
pages.json Прегледај датотеку

@@ -1,8 +1,14 @@
1 1
 {
2
-	"pages": [{
2
+	"pages": [
3
+		{
4
+			"path": "pages/switchSystem",
5
+			"style": {
6
+				"navigationBarTitleText": ""
7
+			}
8
+		}, {
3 9
 			"path": "pages/login",
4 10
 			"style": {
5
-				"navigationBarTitleText": "登录"
11
+				"navigationBarTitleText": ""
6 12
 			}
7 13
 		}, {
8 14
 			"path": "pages/register",

+ 12
- 3
pages/login.vue Прегледај датотеку

@@ -1,9 +1,14 @@
1 1
 <template>
2 2
 	<view class="normal-login-container">
3
-		<view class="logo-content align-center justify-center flex">
3
+		<view class="logo-content align-center justify-center flex" v-if="logSyste==1">
4 4
 			<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
5 5
 			</image>
6 6
 			<text class="title">仲裁平台</text>
7
+		</view>
8
+		<view class="logo-content align-center justify-center flex" v-if="logSyste==2">
9
+			<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
10
+			</image>
11
+			<text class="title">调节平台</text>
7 12
 		</view>
8 13
 		<view class="login-form-content">
9 14
 			<view class="input-item flex align-center">
@@ -60,7 +65,7 @@
60 65
 			return {
61 66
 				codeUrl: "",
62 67
 				captchaEnabled: true,
63
-				
68
+				logSyste:0,
64 69
 				// 用户注册开关
65 70
 				register: true,
66 71
 				globalConfig: getApp().globalData.config,
@@ -112,7 +117,7 @@
112 117
 			},
113 118
 			// 登录方法
114 119
 			async handleLogin() {
115
-				console.log(this.isSelectAgree,'xxxx')
120
+				const sysType = uni.getStorageSync('sysType')
116 121
 				if (this.loginForm.username === "") {
117 122
 					this.$modal.msgError("请输入您的账号")
118 123
 				}else if(this.isSelectAgree.length < 1){
@@ -144,6 +149,10 @@
144 149
 					this.$tab.reLaunch('/pages/work/index')
145 150
 				})
146 151
 			},
152
+			onLoad(options){
153
+				 let vals = decodeURIComponent(options.values);
154
+				 this.logSyste = vals
155
+			}
147 156
 			
148 157
 		}
149 158
 	}

+ 4
- 3
permission.js Прегледај датотеку

@@ -1,11 +1,12 @@
1 1
 import { getToken } from '@/utils/auth'
2
-
2
+//跳转页面
3
+const loginPage = "/pages/switchSystem"
3 4
 // 登录页面
4
-const loginPage = "/pages/login"
5
+// const loginPage = "/pages/login"
5 6
   
6 7
 // 页面白名单
7 8
 const whiteList = [
8
-  '/pages/login', '/pages/register', '/pages/common/webview/index','/pages/realName','/mp_ecard_sdk/index/index', '/pages/personalInfoCollection'
9
+'/pages/switchSystem', '/pages/login', '/pages/register', '/pages/common/webview/index','/pages/realName','/mp_ecard_sdk/index/index', '/pages/personalInfoCollection'
9 10
 ]
10 11
 
11 12
 // 检查地址白名单

+ 8
- 5
utils/request.js Прегледај датотеку

@@ -5,9 +5,11 @@ import errorCode from '@/utils/errorCode'
5 5
 import { toast, showConfirm, tansParams } from '@/utils/common'
6 6
 
7 7
 let timeout = 10000
8
-const baseUrl = config.baseUrl
9
-
10
-const request = config => {
8
+const baseUrlZC = config.baseUrlZC
9
+const baseUrlTJ = config.baseUrlTJ
10
+const request = config => {
11
+  const sysType = uni.getStorageSync('sysType')
12
+  
11 13
   // 是否需要设置 token
12 14
   const isToken = (config.headers || {}).isToken === false
13 15
   config.header = config.header || {}
@@ -20,11 +22,12 @@ const request = config => {
20 22
     url = url.slice(0, -1)
21 23
     config.url = url
22 24
   }
23
-  return new Promise((resolve, reject) => {
25
+  return new Promise((resolve, reject) => {
26
+	const reqURL = sysType == 1 ? baseUrlZC : baseUrlTJ
24 27
     uni.request({
25 28
         method: config.method || 'get',
26 29
         timeout: config.timeout ||  timeout,
27
-        url: config.baseUrl || baseUrl + config.url,
30
+        url: config.baseUrl || reqURL + config.url,
28 31
         data: config.data,
29 32
         header: config.header,
30 33
         dataType: 'json'