登录返回用户区分状态
This commit is contained in:
parent
17145f6242
commit
b70cd5d87c
@ -1,5 +1,6 @@
|
||||
package com.xinelu.applet.mapper.newapp;
|
||||
|
||||
import com.xinelu.applet.vo.newapp.LoginStatusVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface NewAppLoginMapper {
|
||||
@ -10,5 +11,5 @@ public interface NewAppLoginMapper {
|
||||
* @param personPassword
|
||||
* @return
|
||||
*/
|
||||
int login(@Param("personAccount") String personAccount, @Param("personPassword") String personPassword);
|
||||
LoginStatusVo login(@Param("personAccount") String personAccount, @Param("personPassword") String personPassword);
|
||||
}
|
||||
|
||||
@ -2,9 +2,11 @@ package com.xinelu.applet.service.newapp.impl;
|
||||
|
||||
import com.xinelu.applet.mapper.newapp.NewAppLoginMapper;
|
||||
import com.xinelu.applet.service.newapp.NewAppLoginService;
|
||||
import com.xinelu.applet.vo.newapp.LoginStatusVo;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
|
||||
@Service
|
||||
public class NewAppLoginServiceImpl implements NewAppLoginService {
|
||||
@ -20,9 +22,13 @@ public class NewAppLoginServiceImpl implements NewAppLoginService {
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult login(String personAccount, String personPassword) {
|
||||
int count = newAppLoginMapper.login(personAccount, personPassword);
|
||||
if (count>0){
|
||||
return AjaxResult.success("登录成功!");
|
||||
LoginStatusVo loginStatusVo = newAppLoginMapper.login(personAccount, personPassword);
|
||||
HashMap<String, String> hashMap = new HashMap<>();
|
||||
if (loginStatusVo.getCount()>0){
|
||||
hashMap.put("status",loginStatusVo.getStatus());
|
||||
hashMap.put("id",loginStatusVo.getId()+"");
|
||||
hashMap.put("str","登录成功!");
|
||||
return AjaxResult.success(hashMap);
|
||||
}else {
|
||||
return AjaxResult.error("账号或密码错误!");
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.xinelu.applet.vo.newapp;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class LoginStatusVo implements Serializable {
|
||||
|
||||
private Integer count;
|
||||
private Integer id;
|
||||
//1:家医医生 2:泉医医生 3:专病医生
|
||||
private String status;
|
||||
|
||||
}
|
||||
@ -4,9 +4,9 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.applet.mapper.newapp.NewAppLoginMapper">
|
||||
|
||||
<select id="login" resultType="int">
|
||||
<select id="login" resultType="com.xinelu.applet.vo.newapp.LoginStatusVo">
|
||||
select
|
||||
count(1)
|
||||
count(1) count, status,id
|
||||
from hospital_person_info
|
||||
<where>
|
||||
<if test="personAccount != null">
|
||||
|
||||
@ -40,6 +40,8 @@
|
||||
<result property="personIntroduce" column="person_introduce"/>
|
||||
<result property="personSort" column="person_sort"/>
|
||||
<result property="personPictureUrl" column="person_picture_url"/>
|
||||
<result property="personAccount" column="person_account"/>
|
||||
<result property="personPassword" column="person_password"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@ -201,6 +203,8 @@
|
||||
hpi.person_introduce,
|
||||
hpi.person_sort,
|
||||
hpi.person_picture_url,
|
||||
hpi.person_account,
|
||||
hpi.person_password,
|
||||
hpi.create_by,
|
||||
hpi.create_time,
|
||||
hpi.update_by,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user