提交代码
parent
c55ea4a88e
commit
6fa3c1aed7
|
@ -6,6 +6,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.yanzhu.common.core.constant.Constants;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -75,8 +76,9 @@ public class TokenService
|
|||
public Map<String, Object> createMobileToken(LoginUser loginUser)
|
||||
{
|
||||
String token = IdUtils.fastUUID();
|
||||
Long userId = loginUser.getSysUser().getUserId();
|
||||
String userName = loginUser.getSysUser().getUserName();
|
||||
SysUser user = loginUser.getSysUser();
|
||||
Long userId = user.getUserId();
|
||||
String userName = user.getUserName();
|
||||
loginUser.setToken(token);
|
||||
loginUser.setUserid(userId);
|
||||
loginUser.setUsername(userName);
|
||||
|
@ -91,6 +93,8 @@ public class TokenService
|
|||
|
||||
// 接口返回信息
|
||||
Map<String, Object> rspMap = new HashMap<String, Object>();
|
||||
rspMap.put("access_type", user.getUserType());
|
||||
rspMap.put("access_role", user.getRoles());
|
||||
rspMap.put("access_token", JwtUtils.createToken(claimsMap));
|
||||
rspMap.put("expires_in", expireTime);
|
||||
return rspMap;
|
||||
|
|
|
@ -52,12 +52,12 @@ App({
|
|||
})
|
||||
}
|
||||
this.autoUpdate();
|
||||
|
||||
/**
|
||||
* 初始化页面未登录时跳转到登录页
|
||||
*/
|
||||
if(options && options.proId){
|
||||
if(options && options.query && options.query.proId){
|
||||
//扫码进入时不效验登录...跳转授权登录页
|
||||
console.log("扫码进入时不效验登录...跳转授权登录页");
|
||||
}else{
|
||||
if (!getToken()) {
|
||||
// setTimeout(() => {
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
"pages/project_info/edit/index",
|
||||
"pages/project_check/list/index",
|
||||
"pages/project_check/edit/index",
|
||||
"pages/project_check/info/index"
|
||||
"pages/project_check/info/index",
|
||||
"pages/project_qr/index"
|
||||
],
|
||||
"usingComponents": {
|
||||
"van-row": "@vant/weapp/row",
|
||||
|
|
|
@ -4,5 +4,18 @@
|
|||
"setting": {
|
||||
"compileHotReLoad": true,
|
||||
"urlCheck": false
|
||||
},
|
||||
"condition": {
|
||||
"miniprogram": {
|
||||
"list": [
|
||||
{
|
||||
"name": "",
|
||||
"pathName": "pages/login/login",
|
||||
"query": "proId=111",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue