Browse Source

init

undefined
wangxiaohua 2 years ago
parent
commit
056452d57b
2 changed files with 31 additions and 10 deletions
  1. +3
    -0
      config.js
  2. +28
    -10
      pages/index/personal.vue

+ 3
- 0
config.js View File

@@ -23,6 +23,9 @@ var config = {
verify:`${host}/user/verify`, verify:`${host}/user/verify`,
//登录 //登录
login: `${hosts}auth/oauth/token`, login: `${hosts}auth/oauth/token`,
logout: `${hosts}auth/token/logout`,
//获取用户信息 //获取用户信息
getUser: `${host}/user/getUser`, getUser: `${host}/user/getUser`,
//获取权限 //获取权限


+ 28
- 10
pages/index/personal.vue View File

@@ -73,7 +73,7 @@
var userInfos = uni.getStorageSync('weapp_session_userInfo_data'); var userInfos = uni.getStorageSync('weapp_session_userInfo_data');
this.name = userInfos.name, this.name = userInfos.name,
this.photo = userInfos.avatar, this.photo = userInfos.avatar,
this.mobile = userInfos.loginName
this.mobile = userInfos.username
}, },
methods: { methods: {
//拨打电话 //拨打电话
@@ -97,15 +97,33 @@
showCancel: true, showCancel: true,
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
app.Closewebsocke()
uni.clearStorageSync(); //清除缓存
uni.showToast({
icon: "none",
title: "退出成功"
})
uni.reLaunch({
url: '/pages/login/index'
});
uni.request({
url: config.service.logout,
header: {
'Authorization': 'Basic dGVzdDp0ZXN0',
'content-type': 'application/x-www-form-urlencoded'
},
method: "DELETE",
success: function(result) {
var data = result.data; //console.log("登陆信息", data);
if(data.data==true){
app.Closewebsocke()
uni.clearStorageSync(); //清除缓存
uni.showToast({
icon: "none",
title: "退出成功"
})
uni.reLaunch({
url: '/pages/login/index'
});
}
},
// 响应错误
fail: function(loginResponseError) {
util.showNone("网络异常,请重试");
return false;
}
});
} }
} }
}); });


Loading…
Cancel
Save