Spaces:
Running
Running
muxi feng
commited on
Commit
·
f6d38eb
1
Parent(s):
a874265
修改判断跳转
Browse files- app/requests.ts +10 -14
app/requests.ts
CHANGED
@@ -198,19 +198,7 @@ async function isVip() {
|
|
198 |
}
|
199 |
})
|
200 |
let response=await res.json() as eladminRes
|
201 |
-
|
202 |
-
if(response.msg=="会员"){
|
203 |
-
return true
|
204 |
-
}
|
205 |
-
}else{
|
206 |
-
if(response.msg=="未登录!"){
|
207 |
-
showToast("未登录!")
|
208 |
-
setTimeout(() => {
|
209 |
-
window.location.href = "/#/login";
|
210 |
-
}, 1000);
|
211 |
-
}
|
212 |
-
return false
|
213 |
-
}
|
214 |
}
|
215 |
|
216 |
|
@@ -230,7 +218,15 @@ export async function requestChatStream(
|
|
230 |
}
|
231 |
let vip=await isVip()
|
232 |
const Bot = useAppConfig.getState().bot;
|
233 |
-
if(!vip){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
if(!updateWallet()){
|
235 |
options?.onMessage("积分不足请购买积分或会员卡密!", true);
|
236 |
return
|
|
|
198 |
}
|
199 |
})
|
200 |
let response=await res.json() as eladminRes
|
201 |
+
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
203 |
|
204 |
|
|
|
218 |
}
|
219 |
let vip=await isVip()
|
220 |
const Bot = useAppConfig.getState().bot;
|
221 |
+
if(!vip.flag){
|
222 |
+
if(vip.msg=="未登录!"){
|
223 |
+
showToast("未登录!")
|
224 |
+
options?.onError(new Error("Unauthorized"), 401);
|
225 |
+
setTimeout(() => {
|
226 |
+
window.location.href = "/#/login";
|
227 |
+
}, 3000);
|
228 |
+
return
|
229 |
+
}
|
230 |
if(!updateWallet()){
|
231 |
options?.onMessage("积分不足请购买积分或会员卡密!", true);
|
232 |
return
|