jinyuan há 2 anos atrás
pai
commit
5924d5d1fb
6 ficheiros alterados com 48 adições e 24 exclusões
  1. 2 2
      api/api.js
  2. 1 0
      common/router/index.js
  3. 6 6
      common/service/service.js
  4. 3 3
      pages/jiance/jindu.vue
  5. 34 11
      pages/login/login.vue
  6. 2 2
      store/index.js

+ 2 - 2
api/api.js

@@ -31,10 +31,10 @@ const apiService = {
 	
 
 	authorize(params) {
-		return http.post('ibps/oauth2/v3/authorize/apply',params);
+		return http.post('/ibps/oauth2/v3/authorize/apply',params);
 	},
 	authentication(params) {
-		return http.post('ibps/oauth2/v3/authentication/apply',params);
+		return http.post('/ibps/oauth2/v3/authentication/apply',params);
 	},
 	
 	/**

+ 1 - 0
common/router/index.js

@@ -17,6 +17,7 @@ router.beforeEach((to, from, next) => {
 	let token=uni.getStorageSync(ACCESS_TOKEN);
  
 	console.log(to.name)
+	console.log(token)
 	if(token){
 		 next()
 		 console.log(true)

+ 6 - 6
common/service/service.js

@@ -41,14 +41,14 @@ http.validateStatus = (statusCode) => {
 http.interceptor.request((config, cancel) => { /* 请求之前拦截器 */
   //判断是否请求白名单,设置带不带token
   let url= config.url;
-  console.log(url)
-/*  if(url=="/ibps/oauth2/v3/user/login/apply"
-  ||url=="ibps/oauth2/v3/authorize/apply"
-  ||url=="ibps/oauth2/v3/authentication/apply"
+  //console.log(url)
+  if(url=="/ibps/oauth2/v3/user/login/apply"
+  ||url=="/ibps/oauth2/v3/authorize/apply"
+  ||url=="/ibps/oauth2/v3/authentication/apply"
   ){
-	 
+	 console.log(url)
 	  return config;
-  }  */
+  }  
   
   config.header = {
     ...config.header,

Diff do ficheiro suprimidas por serem muito extensas
+ 3 - 3
pages/jiance/jindu.vue


+ 34 - 11
pages/login/login.vue

@@ -3,7 +3,7 @@
         <scroll-view scroll-y class="page">
             <view class="text-center" :style="[{animation: 'show ' + 0.4+ 's 1'}]">
 				<image src="https://static.jeecg.com/upload/test/login4_1595818039175.png" mode='aspectFit' class="zai-logo "></image>
-				<view class="zai-title text-shadow ">网上委托平台 </view>
+				<view class="zai-title text-shadow ">明鉴细胞 </view>
 			</view>
             <view class="box padding-lr-xl login-paddingtop" :style="[{animation: 'show ' + 0.6+ 's 1'}]">
 				<block v-if="loginWay==1">
@@ -18,17 +18,17 @@
 						    <text :class="[showPassword ? 'cuIcon-attention' : 'cuIcon-attentionforbid']" @click="changePassword"></text>
 						</view>						
 					</view>
-                    <view @tap="zhuce()"> <text style="color: #E04B28;float: right; margin-right: 20rpx; "  > 还未注册?请注册</text> </view>
-					<view class="padding text-center margin-top">
+                    <!-- <view @tap="zhuce()"> <text style="color: #E04B28;float: right; margin-right: 20rpx; "  > 还未注册?请注册</text> </view>
+					 --><view class="padding text-center margin-top">
 						<button class="cu-btn bg-blue lg margin-right shadow" :loading="loading" :class="[shape=='round'?'round':'']"
 							@tap="onLogin"><text space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
 						</button>
-						<button class="cu-btn line-blue lg margin-left shadow" :loading="loading" :class="[shape=='round'?'round':'']"
+<!-- 						<button class="cu-btn line-blue lg margin-left shadow" :loading="loading" :class="[shape=='round'?'round':'']"
 							@tap="loginWay=3-loginWay">短信登录
-						</button>
+						</button> -->
 					</view>
 				</block>
-                <block v-else>
+<!--                <block v-else>
                 	<view class="cu-form-group margin-top  shadow-warp" :class="[shape=='round'?'round':'']">
                 		<view class="title"><text class="cuIcon-mobile margin-right-xs"></text>手机号:</view>
                 		<input placeholder="请输入手机号" type="number" maxlength="11" v-model="phoneNo"></input>
@@ -50,7 +50,7 @@
                 			@tap="loginWay=1">账户登录
                 		</button>
                 	</view>
-                </block>
+                </block> -->
 				
 	
 				<!-- #ifdef APP-PLUS -->
@@ -191,11 +191,34 @@
 						//获取用户信息
 						let userpara={username:loginParams.username};						
 						that.$http.post(url,userpara).then(res=>{
-	                         console.log(res)
-						})
+							 if(res.data.state==200){
+								console.log(res.data.data) 
+								uni.setStorageSync(USER_INFO,res.data.data);
+								
+								this.$tip.success('登录成功!')
+								this.$Router.replaceAll({name:'index'})
+								
+							 }else{
+								 if(res.data.state==500){
+								 	this.$tip.alert(res.data.message);
+								 }else{
+								 	this.$tip.alert(res.data.cause);
+								 }
+							 }
+							 
+							 //uni.setStorageSync(USER_INFO,userInfo);
+							 
+						}).catch((err) => {
+											
+			          let msg = err.data.message || "请求出现错误,请稍后再试"
+					  console.log(msg)
+			          this.loading=false;
+					  this.$tip.alert(msg);
+			        }).finally(()=>{
+					  this.loading=false;
+				    })
 						
-						  this.$tip.success('登录成功!')
-						  this.$Router.replaceAll({name:'index'})
+						  
 						 // #endif
 						}else {
 							//console.log(res.data.message)

+ 2 - 2
store/index.js

@@ -48,7 +48,7 @@ export default new Vuex.Store({
       return new Promise((resolve, reject) => {
 		  
        api.login(userInfo).then(response => {
-          console.log(response)
+        //  console.log(response)
 		   
 		  if(response.data.state ==200){ 
 	        const result = response.data
@@ -61,7 +61,7 @@ export default new Vuex.Store({
             //commit('SET_NAME', userInfo.username)
 
 			let params = {};
-			console.log("data:",userInfo)
+		//	console.log("data:",userInfo)
 			params.login_state=result.data;
 			params.client_id="ibps";   
 			//授权第二步

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff