Browse Source

feat(api): 添加学生登录接口并优化登录功能

- 在 apiRoute.js 中添加学生登录接口 xy_login
- 优化学生端登录逻辑,支持微信小程序 openid
-调整登录页面布局,移除多余的空视图
- 初始化登录页面时获取微信小程序 openid- 修改登录成功后的处理逻辑
master
liutong 10 months ago
parent
commit
09e3e47f41
  1. 9
      api/apiRoute.js
  2. 4
      pages/student/index/index.vue
  3. 9
      pages/student/login/login.vue

9
api/apiRoute.js

@ -396,8 +396,13 @@ export default {
//↓↓↓↓↓↓↓↓↓↓↓↓-----学生接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓ //↓↓↓↓↓↓↓↓↓↓↓↓-----学生接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
//学生登陆接口
xy_login(data = {}) {
let url = '/customerResourcesAuth/login'
return http.post(url, data).then(res => {
return res;
})
},

4
pages/student/index/index.vue

@ -168,11 +168,9 @@
} }
}, },
onLoad() { onLoad() {
},
onShow(){
this.openViewHome()//- this.openViewHome()//-
}, },
onShow(){},
methods: { methods: {
// //
async init(){ async init(){

9
pages/student/login/login.vue

@ -25,7 +25,6 @@
</fui-input> </fui-input>
</view> </view>
<view style="width: 95%;height: 30rpx;"></view>
<view style="width: 95%;margin:30rpx auto;"> <view style="width: 95%;margin:30rpx auto;">
<fui-input <fui-input
@click="picker_show_loginType=true" @click="picker_show_loginType=true"
@ -98,7 +97,10 @@ export default {
}, },
methods: { methods: {
async init(){ async init(){
//
//#ifdef MP-WEIXIN
await this.getMiNiWxOpenId() await this.getMiNiWxOpenId()
//#endif
}, },
input(e) { input(e) {
console.log(e) console.log(e)
@ -172,6 +174,7 @@ export default {
'login_type': 2, 'login_type': 2,
'mini_wx_openid':this.mini_wx_openid,//openid 'mini_wx_openid':this.mini_wx_openid,//openid
} }
res = await apiRoute.xy_login(params)
} }
if(!res.code){ if(!res.code){
@ -259,8 +262,8 @@ export default {
this.password1= '123123' // this.password1= '123123' //
}else{ }else{
// //
this.user= '' // this.user= '15335526445' //
this.password1= '' // this.password1= '123123' //
} }
}, },

Loading…
Cancel
Save