diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..7d4caab --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,16 @@ +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version": "0.0", + "configurations": [{ + "default" : + { + "launchtype" : "local" + }, + "h5" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } + ] +} diff --git a/apis/index.js b/apis/index.js index 8c2dd13..5547492 100644 --- a/apis/index.js +++ b/apis/index.js @@ -1,14 +1,15 @@ - + /** * 手太欠 * 愿这世界都如故事里一样 美好而动人~ - */ + */ -import store from '@/store' +import store from '@/store' // 基础配置 -const config = { - apiUrl : 'http://debt.douhuofalv.com/api/', // 正式环境 +const config = { + // apiUrl : 'http://debt.douhuofalv.com/api/', // 备份环境 + apiUrl : 'http://api.xchengwh9.cn/api/', // 正式环境 timeout : 60000 } @@ -28,13 +29,13 @@ const request = (parameter, hideLoding) => { config.header = { 'Accept': 'application/json', 'Authorization': store.getters.getToken || '' - } - - // 加载提示 - if(!hideLoding) uni.showLoading({ - title: '加载中', - mask : true - }); + } + + // 加载提示 + if(!hideLoding) uni.showLoading({ + title: '加载中', + mask : true + }); // 请求实例 return new Promise((resolve, reject) => { @@ -69,7 +70,7 @@ const request = (parameter, hideLoding) => { } // 文件上传 -const uploading = (paths, driver) => { +const uploading = (paths, driver) => { uni.showLoading({ title: '上传中', @@ -81,13 +82,13 @@ const uploading = (paths, driver) => { 'Authorization': store.getters.getToken || '' } // 上传图片 - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { uni.uploadFile({ url : config.apiUrl + 'storage/uploads', files : paths, - header : config.header || {}, + header : config.header || {}, formData: driver || {}, - success : res=>{ + success : res=>{ if(res.statusCode === 200){ uni.hideLoading() let updData = JSON.parse(res.data) @@ -143,10 +144,10 @@ const loginHint = () => { content: '您的登录信息已过期,请重新登录', confirmColor: '#8b64fd', showCancel:false, - success: res=> { + success: res=> { loginHintState = false - if (res.confirm) uni.reLaunch({ - url:'/pages/index/index' + if (res.confirm) uni.reLaunch({ + url:'/pages/index/index' }) } }) diff --git a/apis/interfaces/index.js b/apis/interfaces/index.js index b645055..ba5cb10 100644 --- a/apis/interfaces/index.js +++ b/apis/interfaces/index.js @@ -1,67 +1,77 @@ /** * 手太欠 * 愿这世界都如故事里一样 美好而动人~ - */ - -import { request } from '../index' - -// 计算前置接口 -const Init = (data) => { - return request({ - url : 'init', - data: data - }) -} - - -// 开始计算 -const Debt = (data) => { - return request({ - url : 'debt', - method: 'POST', - data: data - }) -} - -// 完善用户信息 -const Info = (data) => { - return request({ - url : 'userinfo', - method: 'POST', - data: data - }) -} - -// 查看结果 -const Lists = (data) => { - return request({ - url : 'lists', - data: data - }) -} - -// 客户管理 -const Clients = (data) => { - return request({ - url : 'clients', - data: data - }) -} - -// 删除结果 -const logDel = (log_id) => { - return request({ - url : 'debt/' + log_id, - method: 'DELETE' - }) -} - - -export { - Init, - Debt, - Info, - Lists, - Clients, - logDel -} + */ + +import { request } from '../index' + +// 计算前置接口 +const Init = (data) => { + return request({ + url : 'init', + data: data + }) +} + + +// 开始计算 +const Debt = (data) => { + return request({ + url : 'debt', + method: 'POST', + data: data + }) +} + +// 完善用户信息 +const Info = (data) => { + return request({ + url : 'userinfo', + method: 'POST', + data: data + }) +} + +// 查看结果 +const Lists = (data) => { + return request({ + url : 'lists', + data: data + }) +} + +// 客户管理 +const Clients = (data) => { + return request({ + url : 'clients', + data: data + }) +} + +// 删除结果 +const logDel = (log_id) => { + return request({ + url : 'debt/' + log_id, + method: 'DELETE' + }) +} + + +// 测试获取第一个用户的token +const userTest = () => { + return request({ + url : 'user/auth/official/test', + method: 'POST' + }) +} + + +export { + Init, + Debt, + Info, + Lists, + Clients, + logDel, + userTest +} diff --git a/pages/index/clients.vue b/pages/index/clients.vue index 2d1599e..9593560 100644 --- a/pages/index/clients.vue +++ b/pages/index/clients.vue @@ -1,565 +1,566 @@ -