mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-06-03 23:52:26 +08:00
忘记密码
This commit is contained in:
@@ -3,6 +3,7 @@ import { merge } from 'lodash-es'
|
||||
import { HttpRequestOptions, RequestHooks } from './type'
|
||||
import { getToken } from '../auth'
|
||||
import { RequestCodeEnum } from '@/enums/requestEnums'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
const requestHooks: RequestHooks = {
|
||||
requestInterceptorsHook(options, config) {
|
||||
@@ -32,7 +33,7 @@ const requestHooks: RequestHooks = {
|
||||
if (!isTransformResponse) {
|
||||
return response.data
|
||||
}
|
||||
console.log(response.data)
|
||||
const { logout } = useUserStore()
|
||||
const { code, data, msg } = response.data as any
|
||||
switch (code) {
|
||||
case RequestCodeEnum.SUCCESS:
|
||||
@@ -52,6 +53,10 @@ const requestHooks: RequestHooks = {
|
||||
|
||||
case RequestCodeEnum.TOKEN_INVALID:
|
||||
case RequestCodeEnum.TOKEN_EMPTY:
|
||||
logout()
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
return Promise.reject()
|
||||
|
||||
default:
|
||||
|
||||
@@ -4,20 +4,22 @@
|
||||
* @param { Boolean } all 是否多选
|
||||
* @param { ctx } context 当前组件实例
|
||||
*/
|
||||
export const getRect = (selector: string, all: boolean = false, context?: any) => {
|
||||
export const getRect = (selector: string, all = false, context?: any) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let qurey = uni.createSelectorQuery()
|
||||
if (context) {
|
||||
qurey = uni.createSelectorQuery().in(context)
|
||||
}
|
||||
qurey[all ? 'selectAll' : 'select'](selector).boundingClientRect(function(rect) {
|
||||
if (all && Array.isArray(rect) && rect.length) {
|
||||
return resolve(rect)
|
||||
}
|
||||
if (!all && rect) {
|
||||
return resolve(rect)
|
||||
}
|
||||
reject('找不到元素')
|
||||
}).exec()
|
||||
qurey[all ? 'selectAll' : 'select'](selector)
|
||||
.boundingClientRect(function (rect) {
|
||||
if (all && Array.isArray(rect) && rect.length) {
|
||||
return resolve(rect)
|
||||
}
|
||||
if (!all && rect) {
|
||||
return resolve(rect)
|
||||
}
|
||||
reject('找不到元素')
|
||||
})
|
||||
.exec()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user