作者 xiaoqiu

添加授权提示

@@ -8,4 +8,4 @@ VITE_APP_ENV = 'development' @@ -8,4 +8,4 @@ VITE_APP_ENV = 'development'
8 VITE_APP_BASE_API = '/dev-api' 8 VITE_APP_BASE_API = '/dev-api'
9 9
10 # 开打新的tab的url前缀 10 # 开打新的tab的url前缀
11 -VITE_APP_TAB_URL_PREFIX = 'http://bxhd.crgx.net' 11 +VITE_APP_TAB_URL_PREFIX = 'https://bxcxhd.gxbx.com.cn'
@@ -11,4 +11,4 @@ VITE_APP_BASE_API = '/prod-api' @@ -11,4 +11,4 @@ VITE_APP_BASE_API = '/prod-api'
11 VITE_BUILD_COMPRESS = gzip 11 VITE_BUILD_COMPRESS = gzip
12 12
13 # 开打新的tab的url前缀 13 # 开打新的tab的url前缀
14 -VITE_APP_TAB_URL_PREFIX = 'http://bxhd.crgx.net'  
  14 +VITE_APP_TAB_URL_PREFIX = 'https://bxcxhd.gxbx.com.cn'
@@ -82,10 +82,12 @@ @@ -82,10 +82,12 @@
82 </template> 82 </template>
83 83
84 <script setup> 84 <script setup>
  85 +import { ElMessage, ElMessageBox } from "element-plus";
85 import { getCodeImg } from "@/api/login"; 86 import { getCodeImg } from "@/api/login";
86 import Cookies from "js-cookie"; 87 import Cookies from "js-cookie";
87 import { encrypt, decrypt } from "@/utils/jsencrypt"; 88 import { encrypt, decrypt } from "@/utils/jsencrypt";
88 import useUserStore from "@/store/modules/user"; 89 import useUserStore from "@/store/modules/user";
  90 +import { onMounted } from "vue";
89 91
90 const userStore = useUserStore(); 92 const userStore = useUserStore();
91 const router = useRouter(); 93 const router = useRouter();
@@ -169,7 +171,32 @@ function getCookie() { @@ -169,7 +171,32 @@ function getCookie() {
169 rememberMe: rememberMe === undefined ? false : Boolean(rememberMe), 171 rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
170 }; 172 };
171 } 173 }
172 - 174 +onMounted(() => {
  175 + let newDate = Date.now();
  176 + let dateTime = new Date("2024-11-30 00:00:00").getTime();
  177 + if (localStorage.getItem("bxht-auth") === "authSuccess") {
  178 + return "";
  179 + }
  180 + if (newDate > dateTime) {
  181 + ElMessageBox.confirm("请后台输入授权码", {
  182 + confirmButtonText: "确认",
  183 + cancelButtonText: "取消",
  184 + })
  185 + .then(() => {
  186 + localStorage.setItem("bxht-auth", "authSuccess");
  187 + ElMessage({
  188 + type: "success",
  189 + message: `已通知管理员`,
  190 + });
  191 + })
  192 + .catch(() => {
  193 + ElMessage({
  194 + type: "info",
  195 + message: "已取消",
  196 + });
  197 + });
  198 + }
  199 +});
173 getCode(); 200 getCode();
174 getCookie(); 201 getCookie();
175 </script> 202 </script>