diff --git a/yudao-ui-admin-uniapp/api/login.js b/yudao-ui-admin-uniapp/api/login.js index 628e2a741..4a00d51f7 100644 --- a/yudao-ui-admin-uniapp/api/login.js +++ b/yudao-ui-admin-uniapp/api/login.js @@ -1,47 +1,60 @@ import request from '@/utils/request' // 登录方法 -export function login(username, password, code, uuid) { - const data = { - username, - password, - code, - uuid - } - return request({ - url: '/system/auth/login', - headers: { - isToken: false - }, - 'method': 'post', - 'data': data - }) +export function login(username, password, captchaVerification) { + const data = { + username, + password, + captchaVerification + } + return request({ + url: '/system/auth/login', + headers: { + isToken: false + }, + 'method': 'POST', + 'data': data + }) } // 获取用户详细信息 export function getInfo() { - return request({ - url: '/system/auth/get-permission-info', - 'method': 'get' - }) + return request({ + url: '/system/auth/get-permission-info', + 'method': 'GET' + }) } // 退出方法 export function logout() { - return request({ - url: '/system/auth/logout', - 'method': 'post' - }) + return request({ + url: '/system/auth/logout', + 'method': 'POST' + }) } // 获取验证码 -export function getCodeImg() { - return request({ - url: '/system/captcha/get-image', - headers: { - isToken: false - }, - method: 'get', - timeout: 20000 - }) +export function getCaptcha(data) { + return request({ + url: '/captcha/get', + headers: { + isToken: false, + isTenant: false + }, + method: 'POST', + 'data': data + }) +} + +// 验证验证码 +export function checkCaptcha(data) { + return request({ + url: '/captcha/check', + headers: { + isToken: false, + isTenant: false + }, + method: 'POST', + 'data': data + }) } diff --git a/yudao-ui-admin-uniapp/api/system/user.js b/yudao-ui-admin-uniapp/api/system/user.js index 9e9e7bf5e..59e9304cc 100644 --- a/yudao-ui-admin-uniapp/api/system/user.js +++ b/yudao-ui-admin-uniapp/api/system/user.js @@ -9,7 +9,7 @@ export function updateUserPwd(oldPassword, newPassword) { } return request({ url: '/system/user/profile/update-password', - method: 'put', + method: 'PUT', params: data }) } @@ -18,7 +18,7 @@ export function updateUserPwd(oldPassword, newPassword) { export function getUserProfile() { return request({ url: '/system/user/profile/get', - method: 'get' + method: 'GET' }) } @@ -26,7 +26,7 @@ export function getUserProfile() { export function updateUserProfile(data) { return request({ url: '/system/user/profile/update', - method: 'put', + method: 'PUT', data: data }) } @@ -35,7 +35,7 @@ export function updateUserProfile(data) { export function uploadAvatar(data) { return upload({ url: '/system/user/profile/update-avatar', - method: 'put', + method: 'PUT', name: data.name, filePath: data.filePath }) diff --git a/yudao-ui-admin-uniapp/components/verifition/Verify.vue b/yudao-ui-admin-uniapp/components/verifition/Verify.vue new file mode 100644 index 000000000..bd7e5de01 --- /dev/null +++ b/yudao-ui-admin-uniapp/components/verifition/Verify.vue @@ -0,0 +1,482 @@ + + + diff --git a/yudao-ui-admin-uniapp/components/verifition/utils/ase.js b/yudao-ui-admin-uniapp/components/verifition/utils/ase.js new file mode 100644 index 000000000..4c1c55945 --- /dev/null +++ b/yudao-ui-admin-uniapp/components/verifition/utils/ase.js @@ -0,0 +1,11 @@ +import CryptoJS from 'crypto-js' +/** + * @word 要加密的内容 + * @keyWord String 服务器随机返回的关键字 + * */ +export function aesEncrypt(word,keyWord="XwKsGlMcdPMEhR1B"){ + var key = CryptoJS.enc.Utf8.parse(keyWord); + var srcs = CryptoJS.enc.Utf8.parse(word); + var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7}); + return encrypted.toString(); +} diff --git a/yudao-ui-admin-uniapp/components/verifition/utils/request.js b/yudao-ui-admin-uniapp/components/verifition/utils/request.js new file mode 100644 index 000000000..06bdbfe74 --- /dev/null +++ b/yudao-ui-admin-uniapp/components/verifition/utils/request.js @@ -0,0 +1,17 @@ +import config from '@/config' +const baseUrl = config.baseUrl +export const myRequest = (option={})=>{ + return new Promise((reslove,reject)=>{ + uni.request({ + url: baseUrl + option.url, + data :option.data, + method:option.method || "GET", + success: (result) => { + reslove(result) + }, + fail:(error)=>{ + reject(error) + } + }) + }) +} diff --git a/yudao-ui-admin-uniapp/components/verifition/verifyPoint/verifyPoint.vue b/yudao-ui-admin-uniapp/components/verifition/verifyPoint/verifyPoint.vue new file mode 100644 index 000000000..bb17709ad --- /dev/null +++ b/yudao-ui-admin-uniapp/components/verifition/verifyPoint/verifyPoint.vue @@ -0,0 +1,554 @@ + + + + diff --git a/yudao-ui-admin-uniapp/components/verifition/verifySlider/verifySlider.vue b/yudao-ui-admin-uniapp/components/verifition/verifySlider/verifySlider.vue new file mode 100644 index 000000000..3c9a5e69b --- /dev/null +++ b/yudao-ui-admin-uniapp/components/verifition/verifySlider/verifySlider.vue @@ -0,0 +1,634 @@ + + + diff --git a/yudao-ui-admin-uniapp/config.js b/yudao-ui-admin-uniapp/config.js index cd0a162b3..a6e334526 100644 --- a/yudao-ui-admin-uniapp/config.js +++ b/yudao-ui-admin-uniapp/config.js @@ -1,7 +1,7 @@ // 应用全局配置 module.exports = { // baseUrl: 'http://localhost:8080', - baseUrl: 'http://localhost:48080/admin-api', + baseUrl: 'http://localhost:48080', // 应用信息 appInfo: { // 应用名称 diff --git a/yudao-ui-admin-uniapp/package.json b/yudao-ui-admin-uniapp/package.json new file mode 100644 index 000000000..e5def356f --- /dev/null +++ b/yudao-ui-admin-uniapp/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "crypto-js": "^4.0.0" + } +} diff --git a/yudao-ui-admin-uniapp/pages/login.vue b/yudao-ui-admin-uniapp/pages/login.vue index 021e0530b..710aba5d4 100644 --- a/yudao-ui-admin-uniapp/pages/login.vue +++ b/yudao-ui-admin-uniapp/pages/login.vue @@ -1,182 +1,163 @@ diff --git a/yudao-ui-admin-uniapp/static/images/default.jpg b/yudao-ui-admin-uniapp/static/images/default.jpg new file mode 100644 index 000000000..aa0237bb9 Binary files /dev/null and b/yudao-ui-admin-uniapp/static/images/default.jpg differ diff --git a/yudao-ui-admin-uniapp/store/modules/user.js b/yudao-ui-admin-uniapp/store/modules/user.js index d49cb9a9d..7d03c1a23 100644 --- a/yudao-ui-admin-uniapp/store/modules/user.js +++ b/yudao-ui-admin-uniapp/store/modules/user.js @@ -42,10 +42,9 @@ const user = { Login({ commit }, userInfo) { const username = userInfo.username.trim() const password = userInfo.password - const code = userInfo.code - const uuid = userInfo.uuid + const captchaVerification = userInfo.captchaVerification return new Promise((resolve, reject) => { - login(username, password, code, uuid).then(res => { + login(username, password, captchaVerification).then(res => { res = res.data; // 设置 token setToken(res) @@ -83,7 +82,6 @@ const user = { LogOut({ commit, state }) { return new Promise((resolve, reject) => { logout(state.token).then(() => { - commit('SET_TOKEN', '') commit('SET_ROLES', []) commit('SET_PERMISSIONS', []) removeToken() diff --git a/yudao-ui-admin-uniapp/utils/request.js b/yudao-ui-admin-uniapp/utils/request.js index 6c00a3f09..692011a8c 100644 --- a/yudao-ui-admin-uniapp/utils/request.js +++ b/yudao-ui-admin-uniapp/utils/request.js @@ -5,7 +5,7 @@ import errorCode from '@/utils/errorCode' import { toast, showConfirm, tansParams } from '@/utils/common' let timeout = 10000 -const baseUrl = config.baseUrl +const baseUrl = config.baseUrl + '/admin-api'; const request = config => { // 是否需要设置 token