Initial commit: 积分兑换电商平台多商户版 MER-2.2
Made-with: Cursor
This commit is contained in:
27
mer_uniapp/pages/users/components/verifition/api/index.js
Normal file
27
mer_uniapp/pages/users/components/verifition/api/index.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 此处可直接引用自己项目封装好的 axios 配合后端联调
|
||||
*/
|
||||
|
||||
import request from '../utils/axios'; // 组件内部封装的axios
|
||||
// import request from "@/api/axios.js" //调用项目封装的axios
|
||||
|
||||
|
||||
/**
|
||||
* 滑块验证
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function ajcaptchaCheck(data) {
|
||||
return request.post("safety/check", data, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 滑块信息
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function getAjcaptcha(data) {
|
||||
return request.post("safety/get", data, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
70
mer_uniapp/pages/users/components/verifition/utils/axios.js
Normal file
70
mer_uniapp/pages/users/components/verifition/utils/axios.js
Normal file
@@ -0,0 +1,70 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import {
|
||||
HTTP_REQUEST_URL,
|
||||
HEADER,
|
||||
TOKENNAME,
|
||||
HEADERPARAMS
|
||||
} from '@/config/app';
|
||||
import {
|
||||
toLogin,
|
||||
checkLogin
|
||||
} from '@/libs/login';
|
||||
import store from '@/store';
|
||||
|
||||
|
||||
/**
|
||||
* 发送请求
|
||||
*/
|
||||
function baseRequest(url, method, data, {
|
||||
noAuth = false,
|
||||
noVerify = false
|
||||
}, params) {
|
||||
let Url = HTTP_REQUEST_URL,
|
||||
header = HEADER
|
||||
// if (params != undefined) {
|
||||
// header = HEADERPARAMS;
|
||||
// }
|
||||
if (!noAuth) {
|
||||
//登录过期自动登录
|
||||
if (!store.state.app.token && !checkLogin()) {
|
||||
toLogin();
|
||||
return Promise.reject({
|
||||
msg: '未登录'
|
||||
});
|
||||
}
|
||||
}
|
||||
if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
|
||||
return new Promise((reslove, reject) => {
|
||||
uni.request({
|
||||
url: Url + '/api/front/' + url,
|
||||
method: method || 'GET',
|
||||
header: header,
|
||||
data: data || {},
|
||||
success: (res) => {
|
||||
reslove(res.data, res);
|
||||
},
|
||||
fail: (msg) => {
|
||||
reject('请求失败');
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
const request = {};
|
||||
|
||||
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
|
||||
request[method] = (api, data, opt, params) => baseRequest(api, method, data, opt || {}, params)
|
||||
});
|
||||
|
||||
|
||||
|
||||
export default request;
|
||||
555
mer_uniapp/pages/users/components/verifition/verify.vue
Normal file
555
mer_uniapp/pages/users/components/verifition/verify.vue
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user