mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-24 13:04:57 +08:00
验证码登陆
This commit is contained in:
parent
41089bbd71
commit
b10dc89005
3
.env
3
.env
|
@ -2,4 +2,7 @@ VITE_PWD_ENC_KEY='thanks,rax4cloud'
|
||||||
|
|
||||||
VITE_OAUTH2_PASSWORD_CLIENT='rax:rax'
|
VITE_OAUTH2_PASSWORD_CLIENT='rax:rax'
|
||||||
|
|
||||||
|
# OAUTH2 短信客户端信息
|
||||||
|
VITE_OAUTH2_MOBILE_CLIENT='app:app'
|
||||||
|
|
||||||
VITE_RAX_BASE_URL='/api'
|
VITE_RAX_BASE_URL='/api'
|
|
@ -0,0 +1,31 @@
|
||||||
|
import request from '@/utils/request';
|
||||||
|
import {Session} from "@/utils/storage";
|
||||||
|
|
||||||
|
const FORM_CONTENT_TYPE = 'application/x-www-form-urlencoded';
|
||||||
|
|
||||||
|
export const sendMobileCode = (mobile: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/mobile/' + mobile,
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export const loginByMobile = (mobile: any, code: any) => {
|
||||||
|
|
||||||
|
const grant_type = 'mobile';
|
||||||
|
const scope = 'server';
|
||||||
|
const basicAuth = 'Basic ' + window.btoa(import.meta.env.VITE_OAUTH2_MOBILE_CLIENT);
|
||||||
|
Session.set('basicAuth', basicAuth);
|
||||||
|
|
||||||
|
return request({
|
||||||
|
url: '/admin/oauth2/token',
|
||||||
|
headers: {
|
||||||
|
skipToken: true,
|
||||||
|
Authorization: basicAuth,
|
||||||
|
'Content-Type': FORM_CONTENT_TYPE,
|
||||||
|
},
|
||||||
|
method: 'post',
|
||||||
|
data: {mobile: mobile, code: code, grant_type, scope},
|
||||||
|
});
|
||||||
|
};
|
|
@ -58,10 +58,10 @@ export const constantRoute = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/remote-manage',
|
path: '/remote-manage/remote-manage',
|
||||||
name: '远程管理',
|
name: '远程管理',
|
||||||
component: () => import('@/views/remote-manage/index.vue'),
|
component: () => import('@/views/remote-manage/index.vue'),
|
||||||
redirect: '/remote-manage/remote-manage',
|
// redirect: '/remote-manage/remote-manage',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/remote-manage/remote-manage',
|
path: '/remote-manage/remote-manage',
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -24,16 +24,16 @@ export default defineConfig({
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
// target: 'http://localhost:9999', // 目标服务器地址
|
// target: 'http://localhost:9999', // 目标服务器地址
|
||||||
// target: 'http://localhost:6379', // 目标服务器地址
|
target: 'http://localhost:6379', // 目标服务器地址
|
||||||
target: 'http://110.41.142.124:6379', // 目标服务器地址
|
// target: 'http://110.41.142.124:6379', // 目标服务器地址
|
||||||
ws: true, // 是否启用 WebSocket
|
ws: true, // 是否启用 WebSocket
|
||||||
changeOrigin: true, // 是否修改请求头中的 Origin 字段
|
changeOrigin: true, // 是否修改请求头中的 Origin 字段
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
},
|
},
|
||||||
'/socket.io': {
|
'/socket.io': {
|
||||||
// target: 'ws://localhost:9999',
|
// target: 'ws://localhost:9999',
|
||||||
// target: 'ws://localhost:6379',
|
target: 'ws://localhost:6379',
|
||||||
target: 'ws://110.41.142.124:6379',
|
// target: 'ws://110.41.142.124:6379',
|
||||||
ws: true,
|
ws: true,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/socket.io/, ''),
|
rewrite: (path) => path.replace(/^\/socket.io/, ''),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user