|
@@ -84,8 +84,14 @@ Page({
|
|
|
onlyFromCamera: true,
|
|
|
scanType: ['qrCode'],
|
|
|
success(res) {
|
|
|
- console.log(res)
|
|
|
- var type = that.getQueryVariable(decodeURIComponent(res.result), 'transferFileType')
|
|
|
+ console.log("res")
|
|
|
+ var parameter = decodeURIComponent(res.result.replace(WX_REG, ""))
|
|
|
+ console.log('parameter::' + parameter)
|
|
|
+ var type = that.getQueryVariable(parameter, 'transferFileType')
|
|
|
+ var host = that.getQueryVariable(parameter, 'apiServer')
|
|
|
+ console.log("host::" + host);
|
|
|
+ API.initBaseUrl(host);
|
|
|
+ parameter = parameter.replace("&apiServer=" + host, "")
|
|
|
if (type == 'PIC' || type == 'AUDIO') {
|
|
|
wx.setNavigationBarTitle({
|
|
|
title: type == 'PIC' ? '图片上传' : '音频上传'
|
|
@@ -94,7 +100,8 @@ Page({
|
|
|
questionType: type
|
|
|
})
|
|
|
// 获取试题信息
|
|
|
- that.secret = res.result.replace(WX_REG, '')
|
|
|
+ that.secret = parameter
|
|
|
+ console.log(that.secret)
|
|
|
that.checkQrcode(that.secret, true)
|
|
|
} else {
|
|
|
wx.showToast({
|
|
@@ -227,11 +234,19 @@ Page({
|
|
|
console.log(options)
|
|
|
if (options && options.q) {
|
|
|
const query = decodeURIComponent(options.q)
|
|
|
- console.log(query)
|
|
|
- if (query.indexOf(WX_REG) == 0) {
|
|
|
- this.secret = query.replace(WX_REG, '')
|
|
|
- }
|
|
|
+ /*if (query.indexOf("http") == 0) {
|
|
|
+ var result = query.replace("//", '/').replace("//", '/').split('/')
|
|
|
+ var baseUrl = result[0] + "//" + result[1];
|
|
|
+
|
|
|
+ API.initBaseUrl(baseUrl);
|
|
|
+ this.secret = query.replace(baseUrl, '').replace('/', '')
|
|
|
+ }*/
|
|
|
var type = this.getQueryVariable(decodeURIComponent(query), 'transferFileType')
|
|
|
+ var host = this.getQueryVariable(decodeURIComponent(query), 'apiServer')
|
|
|
+ console.log("host::" + host);
|
|
|
+ API.initBaseUrl(host);
|
|
|
+ this.secret = query.replace(host, '').replace('/', '')
|
|
|
+
|
|
|
console.log(type)
|
|
|
if (type == 'PIC' || type == 'AUDIO') {
|
|
|
wx.setNavigationBarTitle({
|