fix: open student demo through hash route
parent
c569a98c3b
commit
a87707e85f
@ -0,0 +1,12 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import { readFileSync } from "node:fs";
|
||||||
|
import { resolve } from "node:path";
|
||||||
|
|
||||||
|
const root = resolve(import.meta.dirname, "..");
|
||||||
|
const teacherTaskPage = readFileSync(resolve(root, "src/views/teacherEnd/trainingTask/index.vue"), "utf8");
|
||||||
|
const studentDemoPage = readFileSync(resolve(root, "src/views/studentDemo/index.vue"), "utf8");
|
||||||
|
|
||||||
|
assert.match(teacherTaskPage, /window\.open\("\/#\/student-demo", "_blank"\)/, "学生端讲解必须通过 Hash 路由打开演示入口");
|
||||||
|
assert.match(studentDemoPage, /window\.location\.replace\("\/#\/index"\)/, "兑换演示学生会话后必须通过 Hash 路由进入学生首页");
|
||||||
|
|
||||||
|
console.log("student demo uses hash routes instead of falling back to the teacher homepage");
|
||||||
Loading…
Reference in New Issue