作者 xiaoqiu

添加授权提示

... ... @@ -8,4 +8,4 @@ VITE_APP_ENV = 'development'
VITE_APP_BASE_API = '/dev-api'
# 开打新的tab的url前缀
VITE_APP_TAB_URL_PREFIX = 'http://bxhd.crgx.net'
VITE_APP_TAB_URL_PREFIX = 'https://bxcxhd.gxbx.com.cn'
... ...
... ... @@ -11,4 +11,4 @@ VITE_APP_BASE_API = '/prod-api'
VITE_BUILD_COMPRESS = gzip
# 开打新的tab的url前缀
VITE_APP_TAB_URL_PREFIX = 'http://bxhd.crgx.net'
\ No newline at end of file
VITE_APP_TAB_URL_PREFIX = 'https://bxcxhd.gxbx.com.cn'
\ No newline at end of file
... ...
... ... @@ -82,10 +82,12 @@
</template>
<script setup>
import { ElMessage, ElMessageBox } from "element-plus";
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from "@/utils/jsencrypt";
import useUserStore from "@/store/modules/user";
import { onMounted } from "vue";
const userStore = useUserStore();
const router = useRouter();
... ... @@ -169,7 +171,32 @@ function getCookie() {
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
}
onMounted(() => {
let newDate = Date.now();
let dateTime = new Date("2024-11-30 00:00:00").getTime();
if (localStorage.getItem("bxht-auth") === "authSuccess") {
return "";
}
if (newDate > dateTime) {
ElMessageBox.confirm("请后台输入授权码", {
confirmButtonText: "确认",
cancelButtonText: "取消",
})
.then(() => {
localStorage.setItem("bxht-auth", "authSuccess");
ElMessage({
type: "success",
message: `已通知管理员`,
});
})
.catch(() => {
ElMessage({
type: "info",
message: "已取消",
});
});
}
});
getCode();
getCookie();
</script>
... ...