Commit 2395e454 by duxingshan

扫码

parent 5e4a6713
...@@ -23,7 +23,7 @@ export function getCodeApi() { ...@@ -23,7 +23,7 @@ export function getCodeApi() {
//appId测试:wx765a55464b308d13 appId正式:wx977825b5a132b74d //appId测试:wx765a55464b308d13 appId正式:wx977825b5a132b74d
let url = let url =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
"wx977825b5a132b74d" + "wx765a55464b308d13" +
"&redirect_uri=" + "&redirect_uri=" +
urlNow + urlNow +
"&response_type=code&scope=snsapi_base&state=de992d7087bb4ac1bfca11fb7082985d&connect_redirect=1#wechat_redirect"; "&response_type=code&scope=snsapi_base&state=de992d7087bb4ac1bfca11fb7082985d&connect_redirect=1#wechat_redirect";
......
...@@ -2,8 +2,8 @@ import { createStore } from "vuex"; ...@@ -2,8 +2,8 @@ import { createStore } from "vuex";
export default createStore({ export default createStore({
state: { state: {
// appid : "wx765a55464b308d13", // 公众号的AppID 2023-08-14 测试的 appid : "wx765a55464b308d13", // 公众号的AppID 2023-08-14 测试的
appid : "wx977825b5a132b74d", // 公众号的AppID 正式的 // appid : "wx977825b5a132b74d", // 公众号的AppID 正式的
imgUrl: "http://43.143.63.140", imgUrl: "http://43.143.63.140",
studentId: "", //学生Id studentId: "", //学生Id
studentName: "", //学生姓名 studentName: "", //学生姓名
......
...@@ -12,8 +12,8 @@ import router from "../router"; ...@@ -12,8 +12,8 @@ import router from "../router";
import {getToken} from "@/utils/auth"; import {getToken} from "@/utils/auth";
import {tansParams} from "@/utils/common"; import {tansParams} from "@/utils/common";
axios.defaults.baseURL = "/school"; // axios.defaults.baseURL = "/school";
// axios.defaults.baseURL = "/houduan"; axios.defaults.baseURL = "/houduan";
// axios.defaults.baseURL = "/schoolnw"; // axios.defaults.baseURL = "/schoolnw";
// process.env.NODE_ENV == "development" ? "https://y32025c600.goho.co" : "//43.143.63.140:8095"; // process.env.NODE_ENV == "development" ? "https://y32025c600.goho.co" : "//43.143.63.140:8095";
......
...@@ -41,13 +41,17 @@ export function scanCodeFun(appId,type){ ...@@ -41,13 +41,17 @@ export function scanCodeFun(appId,type){
'scanQRCode' 'scanQRCode'
], ],
success: function (res){ success: function (res){
console.log("res.checkResult.scanQRCode",res.checkResult.scanQRCode)
if(res.checkResult.scanQRCode === true){
wx.scanQRCode({ wx.scanQRCode({
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有 scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有
success: function (res) { success: function (res) {
console.log(777) console.log(777)
encode = res.resultStr; // 当needResult 为 1 时,扫码返回的结果 encode = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
console.log(encode,"encode")
if(type == 0){ if(type == 0){
console.log(type,"type")
// 校产管理页面扫码显示设备信息 // 校产管理页面扫码显示设备信息
router.push({ router.push({
path: "/schoolProperty/equipmentInfo", path: "/schoolProperty/equipmentInfo",
...@@ -99,6 +103,7 @@ export function scanCodeFun(appId,type){ ...@@ -99,6 +103,7 @@ export function scanCodeFun(appId,type){
} }
}) })
} }
}
}) })
}); });
......
...@@ -117,13 +117,13 @@ ...@@ -117,13 +117,13 @@
</van-form> </van-form>
</div> </div>
<!-- </div>--> <!-- </div>-->
<van-image <!-- <van-image-->
style="background: #e7f4fb; position: absolute; bottom: 0; height: auto" <!-- style="background: #e7f4fb; position: absolute; bottom: 0; height: auto"-->
:src="require('@/assets/login/loginback.png')" <!-- :src="require('@/assets/login/loginback.png')"-->
fit="contain" <!-- fit="contain"-->
width="100%" <!-- width="100%"-->
height="100%" <!-- height="100%"-->
></van-image> <!-- ></van-image>-->
</div> </div>
</template> </template>
...@@ -366,7 +366,6 @@ export default { ...@@ -366,7 +366,6 @@ export default {
/** 获取OpenId */ /** 获取OpenId */
const checkOpenIdOrWxCookie = async () => { const checkOpenIdOrWxCookie = async () => {
let appid = "wx977825b5a132b74d";
let openId; let openId;
let code = getUrlKey("code"); let code = getUrlKey("code");
console.log('code',code); console.log('code',code);
......
No preview for this file type
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