This commit is contained in:
lnn19986213 2023-10-16 15:14:54 +08:00
parent 5a8e1a00c6
commit 6265598d09
8 changed files with 213 additions and 6 deletions

View File

@ -17,3 +17,11 @@ yarn build
### Customize configuration ### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/). See [Configuration Reference](https://cli.vuejs.org/config/).
### 山海万象版本
### 新增pages/pageHome/shwxLogin.vue
### request/interface.js里的401判断指向shwxLogin.vue
### 小程序版本要改回login.vue
### 隐藏my里面的退出登录
### pages.json新增路由

View File

@ -14,6 +14,7 @@
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />') document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script> </script>
<script type="text/javascript" src="https://cdn-cp.tmuyun.com/jssdk/v1/zjrb-cp.v1.min.js" charset="UTF-8"></script>
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" /> <link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
</head> </head>
@ -24,5 +25,45 @@
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
<!-- 山海万象 -->
<script>
let zjrbCp = document.createElement('script');
zjrbCp.async = "async";
zjrbCp.src = 'https://cdn-cp.tmuyun.com/jssdk/v1/zjrb-cp.v1.min.js';
zjrbCp.charset = "UTF-8";
document.body.appendChild(zjrbCp);
zjrbCp.onload = function () {
//初始化jssdk
if (CP && typeof CP.ready === 'function') {
CP.ready({
debug: false, //可选,是否是开启调试模式, 默认false
es6Require: false, //可选是否需要加载es6库默认false
wxOption: { //可选,内容需要二次分享时请配置此项
debug: false, //是否是开启微信调试模式
appid: 'xxxx', //授权的微信公众号的appid 微信二次分享使用,具体使用方式请参照 附录:微信及微信二次分享
method: 'getShareSign', //获取微信信息方法,写死
uploadImage: '', //使用微信录音,图片上传等功能时需要的上传后台服务器地址
redirect: location.href.split('#')[0], //回调域名,一般为加载后签名时页面,如跳转可能会签名失败 附录:微信及微信二次分享
jsApiList: [
'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone',
'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'onVoicePlayEnd', 'uploadVoice', 'playVoice', 'getLocation',
'chooseImage', 'uploadImage', 'stopVoice', 'pauseVoice', 'previewImage', 'translateVoice', 'updateAppMessageShareData', 'updateTimelineShareData'
] // 分享到微信必填需要使用的微信JS接口列表所有JS接口列表见 附录微信JS接口列表
},
ready: function (client_info) {
//jssdk加载完成调用此方法
//client_info > { client_code: 'web', version: '1.0', detail: ''} clientInfo 接口返回数据
main();// 业务逻辑初始化的main函数
},
error: function (error) {
console.log(error, 'error');
//jssdk运行时报错但不会阻断程序运行
//error > {code: 4000, msg: res.errMsg, data: res} res为原生报错 微信的报错也在这处理
}
});
}
}
</script>
</html> </html>

View File

@ -96,7 +96,7 @@
// vueproxyTable, // vueproxyTable,
"/pre" : { "/pre" : {
// //
"target" : "http://192.168.1.4:8080/h5/api", // "target" : "http://192.168.1.22:8080/h5/api", //
// "target" : "https://yxx.ydool.net/h5/api", // // "target" : "https://yxx.ydool.net/h5/api", //
"changeOrigin" : true, // "changeOrigin" : true, //

View File

@ -10,6 +10,13 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "pages/pageHome/shwxLogin",
"style": {
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{ {
"path": "pages/pageHome/pdfView", "path": "pages/pageHome/pdfView",
"style": { "style": {

View File

@ -0,0 +1,150 @@
<template>
<div id="dingcomback-box">
<div class="h-100">
<div class="imgBox">
<img src="../../static/jumpImg.png" alt="" class="w-100 h-100" />
<h5>山海万象跳转...</h5>
</div>
</div>
</div>
</template>
<script>
import vconsole from "vconsole";
import Vue from "vue";
import http from "@/request/index.js";
export default {
data() {
return {};
},
onLoad() {
// new vconsole();
this.init();
},
methods: {
init() {
CP.isLogin({
//
completed: function (data) {
CP.tools.writelog("get_is_login", data);
if (data.is_login == 0) {
CP.showLogin({
completed: function (data) {
CP.tools.writelog("show_login", data);
if (data.is_login == 1) {
CP.getCustomerInfo({
completed: function (data) {
CP.tools.writelog("get_customer_info", data);
http
.request(
`/auth/shwxLogin`,
{
accountId: data.account_id,
nickname: data.nick_name,
phone: data.mobile,
},
"POST"
)
.then((res) => {
if (res.code == 200) {
console.log('token', res.data.tokenValue)
uni.setStorageSync('token', res.data.tokenValue)
// Vue.prototype.ghmtoken = res.data.token;
uni.showToast({
title: "登录成功",
duration: 1000,
mask: true,
icon: "success",
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/pageHome/pageHome",
});
}, 500);
}
});
},
});
} else {
CP.closePage({
completed: function (data) {
CP.tools.writelog("close_page", data);
},
});
}
},
});
} else {
CP.getCustomerInfo({
completed: function (data) {
CP.tools.writelog("get_customer_info", data);
http
.request(
`/auth/shwxLogin`,
{
accountId: data.account_id,
nickname: data.nick_name,
phone: data.mobile,
},
"POST"
)
.then((res) => {
if (res.code == 200) {
console.log('token', res.data.tokenValue)
uni.setStorageSync('token', res.data.tokenValue)
// Vue.prototype.ghmtoken = res.data.token;
uni.showToast({
title: "登录成功",
duration: 1000,
mask: true,
icon: "success",
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/pageHome/pageHome",
});
}, 500);
}
});
},
});
}
},
cpIncompatible: function () {
CP.tools.writelog("", "此环境不支持此方法");
uni.navigateTo({
url: '/pagesC/Login/Login'
// url: '/pages/pageHome/shwxLogin'
})
console.log("此环境不支持此方法");
},
});
},
},
};
</script>
<style lang="scss" scoped>
.imgBox {
width: 180px;
height: auto;
position: absolute;
top: 30%;
left: 50%;
transform: translate(-50%, -50%);
}
h5 {
font-size: 18px;
padding: 15px 0;
text-align: center;
}
.w-100 {
width: 100% !important;
}
.h-100 {
height: 100% !important;
}
</style>

View File

@ -119,12 +119,12 @@
<image src="../../static/rightArrow.png" mode=""></image> <image src="../../static/rightArrow.png" mode=""></image>
</view> </view>
</view> </view>
<view class="content_bott_itm" @click="toSz()"> <!-- <view class="content_bott_itm" @click="toSz()">
<view class="content_bott_wods"> 设置 </view> <view class="content_bott_wods"> 设置 </view>
<view class="content_bott_arrow"> <view class="content_bott_arrow">
<image src="../../static/rightArrow.png" mode=""></image> <image src="../../static/rightArrow.png" mode=""></image>
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
<u-gap height="50" bgColor="#F4F5F7"></u-gap> <u-gap height="50" bgColor="#F4F5F7"></u-gap>

View File

@ -5,10 +5,10 @@
export default { export default {
config: { config: {
// baseUrl: "http://192.168.1.4:8080/h5/api", //俞燕红-小程序不能配跨域 // baseUrl: "http://192.168.1.22:8080/h5/api", //俞燕红-小程序不能配跨域
// baseUrl: "/pre", //俞燕红-跨域 // baseUrl: "/pre", //俞燕红-跨域
// baseUrl: "https://yxx.ydool.net/h5/api", //线上 baseUrl: "https://yxx.ydool.net/h5/api", //线上
baseUrl: "/h5/api", //h5 // baseUrl: "/h5/api", //h5
header: { header: {
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
// 'Content-Type':'application/x-www-form-urlencoded' // 'Content-Type':'application/x-www-form-urlencoded'
@ -105,6 +105,7 @@ export default {
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Login/Login' url: '/pagesC/Login/Login'
// url: '/pages/pageHome/shwxLogin'
}) })
}, 1200) }, 1200)

BIN
src/static/jumpImg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB