|
@@ -374,23 +374,20 @@ function getCookie(c_name)
|
|
|
|
|
|
function getUserId() {
|
|
|
var use = getCookie("doibyUser");
|
|
|
- if (use == null) {
|
|
|
- location.href = "sign-in1.html?from=entrance-1&msg=nologin";
|
|
|
- if (userId == null) {
|
|
|
- userId = use;
|
|
|
- } else {
|
|
|
- // 指定新的userId
|
|
|
- //userId = use;
|
|
|
- }
|
|
|
+ if (use == null || use === undefined || use.length <= 0) {
|
|
|
+ location.href = "sign-in1.html?from=entrance-1&msg=nologin-mustauth";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ try{
|
|
|
+ var mm = parseInt(use);
|
|
|
+ }catch (e) {
|
|
|
+ location.href = "sign-in1.html?from=entrance-1&msg=cookie-wrong-format";
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
if(userId == null || userId === undefined){
|
|
|
- location.href = "sign-in1.html?from=entrance-3&msg=from-cookie-userId-repeated-notdefined";
|
|
|
- }else{
|
|
|
- if(parseInt(userId) <= 0){
|
|
|
- location.href = "sign-in1.html?from=entrance-4&msg=from-cookie-parseOut0";
|
|
|
- }else{
|
|
|
- location.href = "sign-in1.html?from=entrance-4&msg=must-auth";
|
|
|
- }
|
|
|
+ userId = parseInt(use);
|
|
|
}
|
|
|
}
|
|
|
|