diff --git a/apis/modules/client.js b/apis/modules/client.js index b32cfbd..3cdef8d 100644 --- a/apis/modules/client.js +++ b/apis/modules/client.js @@ -5,6 +5,10 @@ export const queryCustomer = (data) => { return post('nakadai/nakadai/customer/queryCustomer', data) } +export const list = (data) => { + return post('nakadai/nakadai/customer/GetCustomerListBasedOnBusinessManagerId', data) +} + export const queryCustomerDetails = (data) => { return get('nakadai/nakadai/customer/queryCustomerDetails', data) } diff --git a/apis/modules/course.js b/apis/modules/product.js similarity index 63% rename from apis/modules/course.js rename to apis/modules/product.js index 273137a..739f421 100644 --- a/apis/modules/course.js +++ b/apis/modules/product.js @@ -1,10 +1,6 @@ import request from '@/apis/request.js' const { get, post } = request -export const curriculumList = (data) => { - return post('nakadai/nakadai/curriculum/curriculumList', data) -} - export const AppletsDataProductList = (data) => { return post('nakadai/nakadai/dataProduct/AppletsDataProductList', data) } \ No newline at end of file diff --git a/apis/modules/user.js b/apis/modules/user.js new file mode 100644 index 0000000..d572a8d --- /dev/null +++ b/apis/modules/user.js @@ -0,0 +1,6 @@ +import request from '@/apis/request.js' +const { get, post } = request + +export const login = (data) => { + return get('users/users/user/weChatAppletCallback', data) +} \ No newline at end of file diff --git a/apis/request.js b/apis/request.js index 368e32d..d513239 100644 --- a/apis/request.js +++ b/apis/request.js @@ -12,12 +12,13 @@ const request = options => { }) } const header = Object.assign({}, config.headers, { - token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjUzNjE3NjI4LCJleHAiOjE2NTM2NjA4MjgsImFjY291bnRJZCI6IjEifQ.AmvmMxWkRD4f8J4oWHoRvm1CCrzBm7TH2QDG4E175_s' + token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjUzODc2NDczLCJleHAiOjE2NTM5MTk2NzMsImFjY291bnRJZCI6IjEifQ.sX2qEUJk_EzltbrLOos_ZFuyj_5OrXFhvq_qahbIfmc' }) return new Promise((resolve, reject)=>{ + const { url } = options uni.request({ header, - url: config.baseURL + options.url, + url: (url.includes('weChatAppletCallback') ? 'http://192.168.31.137:9000/' : config.baseURL) + url, method: options.method || 'GET', // 请求类型,默认为GET data: options.data || {}, // 请求参数,默认空对象 success: ({ data }) => { diff --git a/libs/WXBizDataCrypt.js b/libs/WXBizDataCrypt.js new file mode 100644 index 0000000..36b3de1 --- /dev/null +++ b/libs/WXBizDataCrypt.js @@ -0,0 +1,35 @@ +var crypto = require('crypto') + +function WXBizDataCrypt(appId, sessionKey) { + this.appId = appId + this.sessionKey = sessionKey +} + +WXBizDataCrypt.prototype.decryptData = function (encryptedData, iv) { + // base64 decode + var sessionKey = new Buffer(this.sessionKey, 'base64') + encryptedData = new Buffer(encryptedData, 'base64') + iv = new Buffer(iv, 'base64') + + try { + // 解密 + var decipher = crypto.createDecipheriv('aes-128-cbc', sessionKey, iv) + // 设置自动 padding 为 true,删除填充补位 + decipher.setAutoPadding(true) + var decoded = decipher.update(encryptedData, 'binary', 'utf8') + decoded += decipher.final('utf8') + + decoded = JSON.parse(decoded) + + } catch (err) { + throw new Error('Illegal Buffer') + } + + if (decoded.watermark.appid !== this.appId) { + throw new Error('Illegal Buffer') + } + + return decoded +} + +module.exports = WXBizDataCrypt \ No newline at end of file diff --git a/pages.json b/pages.json index d16266b..daa5377 100644 --- a/pages.json +++ b/pages.json @@ -1,11 +1,19 @@ { "pages": [ + { + "path" : "pages/login/login", + "style" : + { + "navigationBarTitleText": "登录", + "enablePullDownRefresh": false + } + }, { "path" : "pages/orders/orders", "style" : { "navigationBarTitleText": "订单列表", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { @@ -24,20 +32,12 @@ "enablePullDownRefresh": true } }, - { - "path" : "pages/clientDetail/clientDetail", - "style" : - { - "navigationBarTitleText": "客户详情", - "enablePullDownRefresh": false - } - }, { - "path" : "pages/orderDetail/orderDetail", + "path" : "pages/addCourse/addCourse", "style" : { - "navigationBarTitleText": "订单详情", - "enablePullDownRefresh": false + "navigationBarTitleText": "选择产品", + "enablePullDownRefresh": true } }, { @@ -46,11 +46,19 @@ "navigationBarTitleText": "首页" } }, + { + "path" : "pages/clientDetail/clientDetail", + "style" : + { + "navigationBarTitleText": "客户详情", + "enablePullDownRefresh": false + } + }, { - "path" : "pages/login/login", + "path" : "pages/orderDetail/orderDetail", "style" : { - "navigationBarTitleText": "登录", + "navigationBarTitleText": "订单详情", "enablePullDownRefresh": false } }, @@ -62,14 +70,6 @@ "enablePullDownRefresh": false } }, - { - "path" : "pages/addMember/addMember", - "style" : - { - "navigationBarTitleText": "添加成员", - "enablePullDownRefresh": false - } - }, { "path" : "pages/addStaff/addStaff", "style" : @@ -149,22 +149,23 @@ "navigationBarTitleText": "详情", "enablePullDownRefresh": false } - } - ,{ - "path" : "pages/addCourse/addCourse", + }, + { + "path" : "pages/editCourse/editCourse", "style" : { - "navigationBarTitleText": "选择产品", + "navigationBarTitleText": "编辑产品", "enablePullDownRefresh": false } } ,{ - "path" : "pages/editCourse/editCourse", + "path" : "pages/agreement/agreement", "style" : { - "navigationBarTitleText": "编辑产品", + "navigationBarTitleText": "", "enablePullDownRefresh": false } + } ], "condition": { //模式配置,仅开发期间生效 diff --git a/pages/addCourse/addCourse.vue b/pages/addCourse/addCourse.vue index 953df50..3d4f4d2 100644 --- a/pages/addCourse/addCourse.vue +++ b/pages/addCourse/addCourse.vue @@ -12,9 +12,10 @@