|
@@ -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>
|