Commit 6fcd69df authored by 黄奎's avatar 黄奎

11

parent adea96d1
...@@ -214,6 +214,7 @@ ...@@ -214,6 +214,7 @@
b2bResult.customerInfoChildrenId=b2bData.customerInfoChildrenId; b2bResult.customerInfoChildrenId=b2bData.customerInfoChildrenId;
b2bResult.name = b2bData.name; b2bResult.name = b2bData.name;
b2bResult.customerName = b2bData.customerName; b2bResult.customerName = b2bData.customerName;
b2bResult.token=b2bData.token;
uni.setStorageSync('b2b_user', b2bResult) uni.setStorageSync('b2b_user', b2bResult)
} }
}, (error2) => { }, (error2) => {
......
import Md5 from "js-md5" import Md5 from "js-md5"
// import { get_xs } from '@/static/xhs.js' // import { get_xs } from '@/static/xhs.js'
const resolveRVHandler =(response)=>{ const resolveRVHandler = (response) => {
// if(response.header && response.header['r-v']){ // if(response.header && response.header['r-v']){
// uni.setStorageSync("r-v",response.header['r-v']) // uni.setStorageSync("r-v",response.header['r-v'])
// } // }
} }
const getRVHandler = (payload,token)=>{ const getRVHandler = (payload, token) => {
// if(uni.getStorageSync("r-v")){ // if(uni.getStorageSync("r-v")){
// let a1 =uni.getStorageSync("r-v") // let a1 =uni.getStorageSync("r-v")
// let xs = get_xs(payload, a1,token) // let xs = get_xs(payload, a1,token)
...@@ -23,10 +23,10 @@ export default { ...@@ -23,10 +23,10 @@ export default {
install(Vue, options) { install(Vue, options) {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285" Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
Vue.prototype.host2 = "http://192.168.5.46:5004" Vue.prototype.host2 = "http://192.168.5.46:8200"
Vue.prototype.host3 = "http://192.168.5.46" Vue.prototype.host3 = "http://192.168.5.46:8501"
Vue.prototype.host2 = "https://erpmallapi.oytour.com" // Vue.prototype.host2 = "https://mallapi.oytour.com"
Vue.prototype.host3 = "https://reborn.oytour.com" // Vue.prototype.host3 = "https://reborn.oytour.com"
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
//网络请求 //网络请求
...@@ -62,15 +62,15 @@ export default { ...@@ -62,15 +62,15 @@ export default {
token: this.GetOpenId().token token: this.GetOpenId().token
} }
//['X-s'] //['X-s']
const sign = getRVHandler(data,this.GetOpenId().token) const sign = getRVHandler(data, this.GetOpenId().token)
//网络请求 //网络请求
uni.request({ uni.request({
url: this.host2 + param.url, url: this.host2 + param.url,
method: param.method || "Post", method: param.method || "Post",
header: param.header || { header: param.header || {
'content-type': "application/json", 'content-type': "application/json",
'x-sign':sign["X-s"], 'x-sign': sign["X-s"],
'x-ts':sign["X-t"] 'x-ts': sign["X-t"]
}, },
data, data,
success: res => { success: res => {
...@@ -107,13 +107,12 @@ export default { ...@@ -107,13 +107,12 @@ export default {
Vue.prototype.apipost = function(cmd, msg, success, failed) { Vue.prototype.apipost = function(cmd, msg, success, failed) {
var data = this.GetPostData(cmd, msg, ""); var data = this.GetPostData(cmd, msg, "");
//['X-s'] //['X-s']
const sign = getRVHandler(data,data.token) const sign = getRVHandler(data, data.token)
uni.request({ uni.request({
url: this.host3 + '/api/common/post', url: this.host3 + '/api/common/post',
method: "Post", method: "Post",
header: { header: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'x-sign':sign["X-s"], 'x-ts':sign["X-t"]
}, },
data, data,
success: res => { success: res => {
...@@ -253,7 +252,7 @@ export default { ...@@ -253,7 +252,7 @@ export default {
msg = {} msg = {}
} }
let b2bUser = uni.getStorageSync('b2b_user') let b2bUser = uni.getStorageSync('b2b_user')
let token = '' let token = b2bUser.token;
let key = "" let key = ""
let groupId = '' let groupId = ''
let timestamp = (new Date()).valueOf(); let timestamp = (new Date()).valueOf();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment