Commit 40d690ea by 张卓

智能表单通过分享进入带token

parent 1ec343aa
...@@ -5586,6 +5586,11 @@ ...@@ -5586,6 +5586,11 @@
} }
} }
}, },
"mayi-front-tools": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/mayi-front-tools/-/mayi-front-tools-1.0.0.tgz",
"integrity": "sha512-Rva5tM2lSmbX6pb+fmu7FA60kJ/tKtDdTp5Tpj9B/+4Rtk9psuZ7zZk20Nk19mF6u/lZYJHrvdHr2yhKQWWFqQ=="
},
"md5.js": { "md5.js": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
}, },
"dependencies": { "dependencies": {
"mayi-analytics": "^1.1.14", "mayi-analytics": "^1.1.14",
"mayi-front-tools": "^1.0.0",
"mpvue": "^2.0.0", "mpvue": "^2.0.0",
"mpvue-wxparse": "^0.6.5", "mpvue-wxparse": "^0.6.5",
"vuex": "^3.0.1" "vuex": "^3.0.1"
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
</template> </template>
<script> <script>
let forUrlAddKey;
if(process.browser) {
forUrlAddKey = require("mayi-front-tools/forUrlAddKey").default
}
import { serialize, getQueryVariable, DFSImg } from "@/utils/index"; import { serialize, getQueryVariable, DFSImg } from "@/utils/index";
export default { export default {
data(){ data(){
...@@ -24,8 +28,26 @@ export default { ...@@ -24,8 +28,26 @@ export default {
} }
}, },
onLoad(options){ onLoad(options){
console.log(decodeURIComponent(options.link),'地址') console.log(decodeURIComponent(options.link),'地址',forUrlAddKey(decodeURIComponent(options.link),{token: wx.getStorageSync("sessionid"),jwt: 1}))
this.link = decodeURIComponent(options.link)
if(options.login != '1') {
this.link = decodeURIComponent(options.link)
}else {
if(wx.getStorageSync("sessionid")) {
this.link = forUrlAddKey(
decodeURIComponent(options.link),
{
token: wx.getStorageSync("sessionid"),
jwt: 1
}
)
}else {
let query = {
sence: 'sso'
}
this.$router.push({ name: "login-accountLogin", query });
}
}
}, },
async onShareAppMessage(res) { async onShareAppMessage(res) {
let url = '' let url = ''
...@@ -77,7 +99,9 @@ export default { ...@@ -77,7 +99,9 @@ export default {
let len = res.target.data.length - 1; let len = res.target.data.length - 1;
console.log(res, "h5消息", res.target.data[len]); console.log(res, "h5消息", res.target.data[len]);
this.shareShopName = res.target.data[len].shareShopName || ""; this.shareShopName = res.target.data[len].shareShopName || "";
this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400); if(res.target.data[len].shareLogoUrl) {
this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400);
}
this.newWindowHref = res.target.data[len].shareImgUrl;// + '&fromVisitorOpenId=' + wx.getStorageSync("openid") this.newWindowHref = res.target.data[len].shareImgUrl;// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
console.log("分享信息:", this.shareLogoUrl, this.shareShopName,1111111,res); console.log("分享信息:", this.shareLogoUrl, this.shareShopName,1111111,res);
}, },
......
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