diff --git a/src/renderer/src/api/apiService.js b/src/renderer/src/api/apiService.js index d5d1668..b030354 100644 --- a/src/renderer/src/api/apiService.js +++ b/src/renderer/src/api/apiService.js @@ -36,3 +36,18 @@ export class toLink { // 删除链接-缓存 static delLink = key => ApiService.publicHttp(`/smarttalk/toLink/${key}`, null, 'delete') } + +// v2.5加入 认证学校 +export class school { + // 学校加入 认证 + static schoolJoin = data => ApiService.publicHttp(`/smarttalk/register/schoolJoin`,data, 'post') + // 获取学校列表 + static deptTree = data => ApiService.publicHttp(`/smarttalk/register/deptTree`) + // 获取当前用户审核详情 + static registerinfo = data => ApiService.publicHttp(`/smarttalk/register/info`) + // 获取学校管理列表 + static auditlist = data => ApiService.publicHttp(`/smarttalk/audit/list`,data) + // 获取学校管理审核 + static checkSchool = data => ApiService.publicHttp(`/smarttalk/audit/checkSchool`,data,'post') + +} \ No newline at end of file diff --git a/src/renderer/src/api/login.js b/src/renderer/src/api/login.js index 16c03cf..b861345 100644 --- a/src/renderer/src/api/login.js +++ b/src/renderer/src/api/login.js @@ -105,6 +105,14 @@ export function deptTree(data) { params:data }) } +//获取学校 +export function getdeptTree(data) { + return request({ + url: '/system/user/deptTree', + method: 'get', + params:data + }) +} // 查询部门详细 export function getDept(query) { return request({ @@ -129,4 +137,21 @@ export function listEvaluation(query) { method: 'get', params: query }) -} \ No newline at end of file +} +// 发送验证码 +export function sendcode(data) { + return request({ + url: '/code/send', + method: 'post', + data + }) +} + +// 教师注册 +export function instructorregister(data) { + return request({ + url: '/instructor/register', + method: 'post', + data + }) +} diff --git a/src/renderer/src/assets/images/shenhe.png b/src/renderer/src/assets/images/shenhe.png new file mode 100644 index 0000000..38e227f Binary files /dev/null and b/src/renderer/src/assets/images/shenhe.png differ diff --git a/src/renderer/src/layout/components/Aside.vue b/src/renderer/src/layout/components/Aside.vue index 75880b5..8d69928 100644 --- a/src/renderer/src/layout/components/Aside.vue +++ b/src/renderer/src/layout/components/Aside.vue @@ -10,14 +10,16 @@
-
-
+
+
+ +
+ + +
@@ -52,6 +73,7 @@ import WindowTools from '@/components/window-tools/index.vue' import SelectSubject from '@/components/select-subject/index.vue' import Register from './components/Register.vue' import { sessionStore } from '@/utils/store' +import {sendcode,instructorregister} from '@/api/login' const { session } = require('@electron/remote') const downloadProp = ref(0) @@ -62,17 +84,25 @@ const userStore = useUserStore() const btnLoading = ref(false) const isSubject = ref(false) const RegModel = ref(false) +const isRegister = ref(true) +const ruleFormRef = ref(null) +const codeName=ref('发送验证码') +const timer=ref(null) //表单 const loginForm = reactive({ username: '', password: '', rememberMe: false }) - +// 注册表单 +const ruleForm = reactive({ + +}) //表单规则 const rules = reactive({ username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }], - password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }] + password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }], + smsCode: [{ required: true, trigger: 'blur', message: '请输入您的验证码' }], }) let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH @@ -81,6 +111,43 @@ ipcRenderer.on('update-app-progress', (e, prop) => { downloadProp.value = prop showDownLoading.value = prop !== 100 }) +const gotoreRegister=()=>{ + codeName.value='发送验证码' + if(timer.value){ + clearInterval(timer.value); + } + isRegister.value=false +} +// 发送验证码 +const sendyzm=()=>{ + if(ruleForm.username){ + const pattern = /^1[3-9]\d{9}$/; + if( pattern.test(ruleForm.username) ){ + sendcode({username:ruleForm.username, source: '4'}).then(res=>{ + if(res.code==200){ + ElMessage.success('消息发送成功') + codeName.value=60 + timer.value=setInterval(()=>{ + codeName.value-- + if(codeName.value==0){ + codeName.value='发送验证码' + clearInterval(timer.value); + } + },1000) + }else{ + ElMessage.error(res.msg) + } + }) + }else{ + ElMessage.error('请输入正确的手机号码') + } + // captchaImg({mobile:ruleForm.phoneNumber}).then(res=>{ + // console.log('res->', res) + // }) + }else{ + ElMessage.error('请输入手机号码') + } +} // 打开弹窗 const RegisterModel = type => { RegModel.value.OpenModel(type) @@ -148,7 +215,31 @@ const setCookie = (name, value) => { } return session.defaultSession.cookies.set(cookie) } - +const gotoLogin = () => { + codeName.value='发送验证码' + if (ruleFormRef.value) ruleFormRef.value.resetFields() + isRegister.value = true +} +// 注册 +const RegisterForm = async (formEl) => { + if (!formEl) return + await formEl.validate((valid, fields) => { + if (valid) { + instructorregister(ruleForm).then(res=>{ + if(res.code==200){ + ElMessage.success('您已注册成功') + if (ruleFormRef.value) ruleFormRef.value.resetFields() + gotoLogin() + }else{ + ElMessage.error(res.msg) + } + }) + console.log('submit!') + } else { + console.log('error submit!', fields) + } + }) +} onMounted(() => { localStorage.clear() sessionStore.set('subject', { diff --git a/src/renderer/src/views/schoolCertification/index.vue b/src/renderer/src/views/schoolCertification/index.vue new file mode 100644 index 0000000..530c1e8 --- /dev/null +++ b/src/renderer/src/views/schoolCertification/index.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/src/renderer/src/views/schoolManagement/index.vue b/src/renderer/src/views/schoolManagement/index.vue new file mode 100644 index 0000000..9dbcdc1 --- /dev/null +++ b/src/renderer/src/views/schoolManagement/index.vue @@ -0,0 +1,197 @@ + + + + + \ No newline at end of file