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

11

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