解决登录失败也能进首页的问题
This commit is contained in:
+59
-35
@@ -1,32 +1,56 @@
|
|||||||
import request from '@/api/request'
|
import request from '@/api/request'
|
||||||
import common from "@/common/common";
|
import common from "@/common/common";
|
||||||
import {setToken, setUserInfo} from "@/common/common";
|
import {
|
||||||
|
setToken,
|
||||||
|
setUserInfo
|
||||||
|
} from "@/common/common";
|
||||||
|
|
||||||
|
|
||||||
// 账号登录接口
|
// 账号登录接口
|
||||||
export const useAccountLoginApp = (data) => request({
|
export const useAccountLoginApp = (data) => request({
|
||||||
url: '/traapp/access/userLogin',
|
url: '/traapp/access/userLogin',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
}).then(async({ rtnCode, body }) => {
|
}).then(async ({
|
||||||
if (rtnCode === '0000') {
|
rtnCode,
|
||||||
setToken(body)
|
body
|
||||||
// deptId: ""
|
}) => {
|
||||||
// deptName: null
|
if (rtnCode === '0000') {
|
||||||
// loginName: "ADMIN" // todo id
|
setToken(body)
|
||||||
// orgId: "00E200"
|
// deptId: ""
|
||||||
// orgName: "金融科技部"
|
// deptName: null
|
||||||
// userId: "USER001"
|
// loginName: "ADMIN" // todo id
|
||||||
// userName: "ADMIN" / todo name
|
// orgId: "00E200"
|
||||||
// userStatus: "01"
|
// orgName: "金融科技部"
|
||||||
const user_data = await queryCurrentUser()
|
// userId: "USER001"
|
||||||
setUserInfo(user_data.body)
|
// userName: "ADMIN" / todo name
|
||||||
return user_data.body
|
// userStatus: "01"
|
||||||
}
|
const user_data = await queryCurrentUser()
|
||||||
return Promise.reject({ rtnCode, body })
|
setUserInfo(user_data.body)
|
||||||
|
return user_data.body
|
||||||
|
}
|
||||||
|
return Promise.reject({
|
||||||
|
rtnCode,
|
||||||
|
body
|
||||||
|
})
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
console.log('报错s');
|
/**
|
||||||
console.log(res);
|
error: "Service Unavailable"
|
||||||
|
path: "/traapp/access/userLogin"
|
||||||
|
requestId: "74d60800-104"
|
||||||
|
status: 503
|
||||||
|
timestamp: "2025-06-24T00:53:35.293+00:00"
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
body: null
|
||||||
|
channelNo: "FF6944B69A99745C009F4D0B3C3B22B8E81B22F587D68455E354BABBABCCB6246C54ABD28F3C55AAD34224A16CE7E24E"
|
||||||
|
head: null
|
||||||
|
message: "系统异常"
|
||||||
|
rtnCode: "9999"
|
||||||
|
rtnTime: "2025-06-24 08:54:52"
|
||||||
|
*/
|
||||||
|
|
||||||
|
return Promise.reject(res)
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,31 +62,31 @@ export const useAccountLoginApp = (data) => request({
|
|||||||
userName 姓名
|
userName 姓名
|
||||||
*/
|
*/
|
||||||
export const queryCurrentUser = (data) => request({
|
export const queryCurrentUser = (data) => request({
|
||||||
url: '/traapp/access/queryCurrentUser',
|
url: '/traapp/access/queryCurrentUser',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|
||||||
//获取隐私协议
|
//获取隐私协议
|
||||||
export const getYsxy = (data) => request({
|
export const getYsxy = (data) => request({
|
||||||
url: '/traapp/dfAgtInfo/queryValidDfAgt',
|
url: '/traapp/dfAgtInfo/queryValidDfAgt',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|
||||||
// 获取验证码(作废)
|
// 获取验证码(作废)
|
||||||
export const getLoginAppCheckCode = (data) => request({
|
export const getLoginAppCheckCode = (data) => request({
|
||||||
url: '/traapp/access/checkCode',
|
url: '/traapp/access/checkCode',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|
||||||
// 退出登录
|
// 退出登录
|
||||||
export const loginOut = (data) => request({
|
export const loginOut = (data) => request({
|
||||||
url: '/traapp/access/loginOut',
|
url: '/traapp/access/loginOut',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
}).then(() =>{
|
}).then(() => {
|
||||||
setToken(null)
|
setToken(null)
|
||||||
setUserInfo(null)
|
setUserInfo(null)
|
||||||
})
|
})
|
||||||
@@ -19,7 +19,8 @@
|
|||||||
<view class="reply">回复</view>
|
<view class="reply">回复</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="show_close_div">
|
<view class="show_close_div">
|
||||||
<text>展开3条回复</text>
|
<uv-read-more openText="">展开3条回复</uv-read-more>
|
||||||
|
<!-- <text></text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -102,6 +102,7 @@
|
|||||||
// this.$common.reLaunch('/pages/homepage/index');
|
// this.$common.reLaunch('/pages/homepage/index');
|
||||||
// }, this.GLOBAL_TIMER_SUBMIT_DELAY_TIME);
|
// }, this.GLOBAL_TIMER_SUBMIT_DELAY_TIME);
|
||||||
const pages = getCurrentPages()
|
const pages = getCurrentPages()
|
||||||
|
console.log(pages.length, 'length');
|
||||||
if (pages.length >= 2) { // 页面栈只有一页,没有返回页,那就返回首页
|
if (pages.length >= 2) { // 页面栈只有一页,没有返回页,那就返回首页
|
||||||
console.log('返回登录的上一页');
|
console.log('返回登录的上一页');
|
||||||
back_state.value = false
|
back_state.value = false
|
||||||
|
|||||||
Reference in New Issue
Block a user