|
@@ -159,22 +159,64 @@ const loginEvent = () => {
|
|
|
getCurrentUser().then((res) => {
|
|
|
userInfo.dataFill(Object.assign({ userType: userType }, res.data.data));
|
|
|
|
|
|
- // 老师
|
|
|
- if (userType == 0) router.push({ path: '/TaskMng' });
|
|
|
- // 学生
|
|
|
- else if (userType == 1) router.push({ path: '/studentMain' });
|
|
|
- else {
|
|
|
- ElNotification({
|
|
|
- message: '无效用户',
|
|
|
- type: 'info',
|
|
|
- });
|
|
|
- }
|
|
|
+ // // 老师
|
|
|
+ // if (userType == 0) router.push({ path: '/TaskMng' });
|
|
|
+ // // 学生
|
|
|
+ // else if (userType == 1) router.push({ path: '/studentMain' });
|
|
|
+ // else {
|
|
|
+ // ElNotification({
|
|
|
+ // message: '无效用户',
|
|
|
+ // type: 'info',
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+
|
|
|
+ mainToMaxEvent(function() {
|
|
|
+
|
|
|
+ // 老师
|
|
|
+ if (userType == 0) router.push({ path: '/TaskMng' });
|
|
|
+ // 学生
|
|
|
+ else if (userType == 1) router.push({ path: '/studentMain' });
|
|
|
+ else {
|
|
|
+ ElNotification({
|
|
|
+ message: '无效用户',
|
|
|
+ type: 'info',
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+/**
|
|
|
+ * 桌面应用窗口最大化
|
|
|
+ * callback
|
|
|
+ */
|
|
|
+const mainToMaxEvent = (callback : any) => {
|
|
|
+
|
|
|
+ fetch('http://127.0.0.1:' + window["mainToMaxPort"] + '/mainToMax')
|
|
|
+ .then(response => {
|
|
|
+ if (!response.ok) {
|
|
|
+ throw new Error(`请求失败:${response.status} ${response.statusText}`);
|
|
|
+ }
|
|
|
+ return response.json(); // 若返回文本,用 response.text()
|
|
|
+ })
|
|
|
+ .then(data => {
|
|
|
+ // console.log('获取到的数据:', data);
|
|
|
+ // 这里写业务逻辑(如渲染页面)
|
|
|
+ callback('yes');
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ // console.error('请求出错:', error.message);
|
|
|
+ callback('yes');
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
const regularPassword = (val: string) => {
|
|
|
if (/^[a-zA-Z0-9_@]{6,32}$/.test(val)) return true;
|
|
|
return false;
|