From 1630f510da8cd0a4451bac4e10787b6454ff05e3 Mon Sep 17 00:00:00 2001 From: Zhunianya <2698076424@qq.com> Date: Tue, 10 Mar 2026 16:13:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=B8=89=E6=96=B9=E7=99=BB=E5=BD=95)?= =?UTF-8?q?=EF=BC=9A=E6=96=B0=E5=A2=9E=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=92=8C=E4=B8=89=E6=96=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue/src/api/login.js | 106 +++- vue/src/views/iot/platform/index.vue | 386 ++++++++++++ vue/src/views/login.vue | 873 +++++++++++++++------------ 3 files changed, 988 insertions(+), 377 deletions(-) create mode 100644 vue/src/views/iot/platform/index.vue diff --git a/vue/src/api/login.js b/vue/src/api/login.js index 5019a515..61bdbbaf 100644 --- a/vue/src/api/login.js +++ b/vue/src/api/login.js @@ -93,12 +93,6 @@ export function bindLogin(data) { }); } -export function getErrorMsg(errorId) { - return request({ - url: '/auth/getErrorMsg/' + errorId, - method: 'get', - }); -} // 三方登录注册绑定 @@ -113,3 +107,103 @@ export function bindRegister(data) { data: data, }); } + +//短信登录获取验证码 +export function getSmsLoginCaptcha(phoneNumber) { + return request({ + url: '/notify/smsLoginCaptcha?phoneNumber=' + phoneNumber, + method: 'get', + }); +} + +// 短信登录 +export function smsLogin(data) { + return request({ + url: '/auth/sms/login', + method: 'post', + data: data, + }); +} + +export function getErrorMsg(errorId) { + return request({ + url: '/auth/getErrorMsg/' + errorId, + method: 'get', + }); +} + +// 忘记密码发送短信 +export function getSmsForgetPassword(phoneNumber) { + return request({ + url: '/notify/smsForgetPassword?phoneNumber=' + phoneNumber, + method: 'get', + }); +} + +// 忘记密码重置用户密码 +export function forgetPwdReset(data) { + return request({ + url: '/system/user/forgetPwdReset', + method: 'put', + data: data, + }); +} + +// ========== OAUTH 2.0 相关 ========== + +export function getAuthorize(clientId) { + return request({ + url: '/oauth2/authorize?clientId=' + clientId, + method: 'get', + }); +} + +export function authorize(responseType, clientId, redirectUri, state, autoApprove, checkedScopes, uncheckedScopes) { + // 构建 scopes + const scopes = {}; + for (const scope of checkedScopes) { + scopes[scope] = true; + } + for (const scope of uncheckedScopes) { + scopes[scope] = false; + } + // 发起请求 + return request({ + url: '/oauth2/authorize', + headers: { + 'Content-type': 'application/x-www-form-urlencoded', + }, + params: { + response_type: responseType, + client_id: clientId, + redirect_uri: redirectUri, + state: state, + auto_approve: autoApprove, + scope: JSON.stringify(scopes), + }, + method: 'post', + }); +} + +//登录 +export function oauthLogin(data) { + return request({ + url: '/auth/ssoLogin', + method: 'post', + data: data, + }); +} + +//修改语言 +export function changeLanguage(lang) { + return request({ + url: '/changeLanguage', + method: 'get', + headers: { + isToken: false, + }, + params: { + lang: lang, + }, + }); +} diff --git a/vue/src/views/iot/platform/index.vue b/vue/src/views/iot/platform/index.vue new file mode 100644 index 00000000..de891511 --- /dev/null +++ b/vue/src/views/iot/platform/index.vue @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + 新增 + + + 修改 + + + 删除 + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + {{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }} + + + + + 修改 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vue/src/views/login.vue b/vue/src/views/login.vue index 61cebdf2..032ef7ff 100644 --- a/vue/src/views/login.vue +++ b/vue/src/views/login.vue @@ -1,92 +1,108 @@ - - - - - - - - FastBee - - 开源物联网平台 - - - + + + + + + + + FastBee + 开源物联网平台 + + + - - - - - - 如果你已经有账号,请直接输入账号进行绑定, - - - - - 如果还没有账号,请先去 - - - - 注册 - - - - - - - - - - - - - - - - - - - + + + + + + 如果你已经有账号,请直接输入账号进行绑定, + + + + 如果还没有账号,请先去 + + + + 注册 + + + + + + + + + + + + + + + + + + + - - - - - 记住密码 + + + + + 记住密码 - - - + + - + + + + + + -