From 7861c622d2946f2788bcc9dfdc2045638ad17fa3 Mon Sep 17 00:00:00 2001 From: zhangqi <2794379662@qq.com> Date: Tue, 19 Jan 2021 17:34:18 +0800 Subject: [PATCH] =?UTF-8?q?update:=E4=B8=AA=E4=BA=BA=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E8=AF=81=E4=B9=A6=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build_script/copy_dist.js | 0 src/main.js | 3 +- src/router/index.js | 14 +++- src/services/http.js | 21 ++++++ src/views/CA.vue | 14 ++++ src/views/CA/Index.vue | 20 +++--- src/views/CA/UserApply.vue | 143 +++++++++++++++++++++++++++++++++++-- vue.config.js | 2 +- 8 files changed, 200 insertions(+), 17 deletions(-) create mode 100644 build_script/copy_dist.js create mode 100644 src/views/CA.vue diff --git a/build_script/copy_dist.js b/build_script/copy_dist.js new file mode 100644 index 0000000..e69de29 diff --git a/src/main.js b/src/main.js index 2c15420..22ae997 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,8 @@ import { createApp } from "vue"; import App from "./App.vue"; import router from "./router"; - +import { Form } from "ant-design-vue"; createApp(App) .use(router) + .use(Form) .mount("#app"); diff --git a/src/router/index.js b/src/router/index.js index e105e21..c282b28 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,5 +1,6 @@ import { createRouter, createWebHashHistory } from "vue-router"; import Home from "../views/Home.vue"; +import CA from "../views/CA.vue"; import CA_Index from "../views/CA/Index.vue"; import CA_User from "../views/CA/UserApply.vue"; import CA_Unit from "../views/CA/UnitApply.vue"; @@ -12,15 +13,22 @@ const routes = [ }, { path: "/CA", - component: CA_Index, + component: CA, + name: "数字证书申领", children: [ + { + path: "", + component: CA_Index + }, { path: "user", - component: CA_User + component: CA_User, + name: "个人数字证书申领" }, { path: "unit", - component: CA_Unit + component: CA_Unit, + name: "企业数字证书申领" } ] } diff --git a/src/services/http.js b/src/services/http.js index f03b361..c914785 100644 --- a/src/services/http.js +++ b/src/services/http.js @@ -1,7 +1,28 @@ +import { message } from "ant-design-vue"; import axios from "axios"; export async function get(url, params) { var response = await axios.get(url, { params }); if (response.status == 200) { return response.data; + } else if (response.status == 401) { + message.warning( + "未登录或身份认证信息已过期", + (onclose = () => { + top && top.login(); + }) + ); + } +} +export async function post(url, data) { + var response = await axios.post(url, data); + if (response.status == 200) { + return response.data; + } else if (response.status == 401) { + message.warning( + "未登录或身份认证信息已过期", + (onclose = () => { + top && top.login(); + }) + ); } } diff --git a/src/views/CA.vue b/src/views/CA.vue new file mode 100644 index 0000000..7a87d6a --- /dev/null +++ b/src/views/CA.vue @@ -0,0 +1,14 @@ + + diff --git a/src/views/CA/Index.vue b/src/views/CA/Index.vue index 63cdb44..4267b5d 100644 --- a/src/views/CA/Index.vue +++ b/src/views/CA/Index.vue @@ -1,19 +1,23 @@ diff --git a/src/views/CA/UserApply.vue b/src/views/CA/UserApply.vue index fe77f94..bb38c20 100644 --- a/src/views/CA/UserApply.vue +++ b/src/views/CA/UserApply.vue @@ -1,7 +1,142 @@ - - + + diff --git a/vue.config.js b/vue.config.js index 65a4310..2901c27 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,5 +1,5 @@ module.exports = { - publicPath: "/www", + publicPath: "/spa", css: { loaderOptions: { less: {