update:个人CA申请入口打开 新增查询接口

update:法人CA使用vue3.0组合式api
This commit is contained in:
2021-01-31 23:21:58 +08:00
parent a3af7a6ba0
commit 59320849a2
11 changed files with 743 additions and 479 deletions

View File

@@ -5,15 +5,15 @@ export async function get(url, params) {
return response.data;
} catch (error) {
if (error.response && error.response.status == "401") {
return new {
return {
errorCode: -1,
errorMsg: "身份认证失败"
}();
};
} else {
return new {
return {
errorCode: -1,
errorMsg: "请求出错"
}();
};
}
}
}
@@ -23,15 +23,15 @@ export async function post(url, data) {
return response.data;
} catch (error) {
if (error.response && error.response.status == "401") {
return new {
return {
errorCode: -1,
errorMsg: "身份认证失败"
}();
};
} else {
return new {
return {
errorCode: -1,
errorMsg: "请求出错"
}();
};
}
}
}

View File

@@ -3,3 +3,10 @@ export function delay(ms) {
setTimeout(reslove, ms);
});
}
export function toBit(str) {
if (!/^[01]+$/.test(str)) throw new Error("not a valid bit value");
return str
.split("")
.reverse()
.reduce((pre, cur, idx) => pre + (1 * cur ? Math.pow(2, cur * idx) : 0), 0);
}