正在显示
2 个修改的文件
包含
24 行增加
和
22 行删除
| @@ -48,27 +48,29 @@ App({ | @@ -48,27 +48,29 @@ App({ | ||
| 48 | }, | 48 | }, |
| 49 | success: function (res) { | 49 | success: function (res) { |
| 50 | console.log("getTokenByCode", res.data) | 50 | console.log("getTokenByCode", res.data) |
| 51 | - var user = res.data.user; | ||
| 52 | - var tenant = res.data.tenant; | ||
| 53 | - that.globalData.tenant_id = tenant.id; | ||
| 54 | - that.globalData.userInfo = res.data.user; | ||
| 55 | - that.globalData.wx_open_id = user.wx_open_id; | ||
| 56 | - that.globalData.Authorization = "Bearer " + res.data.access_token; | ||
| 57 | - that.globalData.refresh_token = res.data.refresh_token; | ||
| 58 | - if (user && user.type == "0") {//匿名用户 | ||
| 59 | - wx.redirectTo({ | ||
| 60 | - url: '../../getPhone/getPhone' | ||
| 61 | - }) | ||
| 62 | - } else if (user && user.type == "1") {//注册用户 | ||
| 63 | - if (relaunch) { | ||
| 64 | - // wx.reLaunch({ //重新加载 | ||
| 65 | - // url: '../home/home' | ||
| 66 | - // }) | ||
| 67 | - wx.reLaunch({ | ||
| 68 | - url: '../guide/guide' | 51 | + if(res.statusCode<300){ |
| 52 | + var user = res.data.user; | ||
| 53 | + var tenant = res.data.tenant; | ||
| 54 | + that.globalData.tenant_id = tenant.id; | ||
| 55 | + that.globalData.userInfo = res.data.user; | ||
| 56 | + that.globalData.wx_open_id = user.wx_open_id; | ||
| 57 | + that.globalData.Authorization = "Bearer " + res.data.access_token; | ||
| 58 | + that.globalData.refresh_token = res.data.refresh_token; | ||
| 59 | + if (user && user.type == "0") {//匿名用户 | ||
| 60 | + wx.redirectTo({ | ||
| 61 | + url: '../../getPhone/getPhone' | ||
| 69 | }) | 62 | }) |
| 63 | + } else if (user && user.type == "1") {//注册用户 | ||
| 64 | + if (relaunch) { | ||
| 65 | + // wx.reLaunch({ //重新加载 | ||
| 66 | + // url: '../home/home' | ||
| 67 | + // }) | ||
| 68 | + wx.reLaunch({ | ||
| 69 | + url: '../guide/guide' | ||
| 70 | + }) | ||
| 71 | + } | ||
| 72 | + that.configOssUrl() | ||
| 70 | } | 73 | } |
| 71 | - that.configOssUrl() | ||
| 72 | } | 74 | } |
| 73 | }, | 75 | }, |
| 74 | fail: function (res) { | 76 | fail: function (res) { |
| @@ -103,7 +105,7 @@ App({ | @@ -103,7 +105,7 @@ App({ | ||
| 103 | }, | 105 | }, |
| 104 | method: 'GET', | 106 | method: 'GET', |
| 105 | success: function (result) { | 107 | success: function (result) { |
| 106 | - console.log('获取OSSURL 成功', result.data.app_url) | 108 | + console.log('获取OSSURL 成功', result.data) |
| 107 | that.globalData.OSSUrl = result.data.app_url; | 109 | that.globalData.OSSUrl = result.data.app_url; |
| 108 | }, | 110 | }, |
| 109 | fail: function (res) { | 111 | fail: function (res) { |
| @@ -122,6 +124,7 @@ App({ | @@ -122,6 +124,7 @@ App({ | ||
| 122 | globalData: { | 124 | globalData: { |
| 123 | appId: appId, | 125 | appId: appId, |
| 124 | onshow_count: 0, | 126 | onshow_count: 0, |
| 127 | + // baseUrl: "http://47.99.47.16:20000/", | ||
| 125 | // baseUrl: "http://47.96.75.229:20000/", | 128 | // baseUrl: "http://47.96.75.229:20000/", |
| 126 | baseUrl: "https://api.workai.com.cn/", | 129 | baseUrl: "https://api.workai.com.cn/", |
| 127 | OSSUrl: "",//"https://oss.workai.com.cn/", | 130 | OSSUrl: "",//"https://oss.workai.com.cn/", |
| 1 | var OSSInit; | 1 | var OSSInit; |
| 2 | var baseUrl = getApp().globalData.baseUrl; | 2 | var baseUrl = getApp().globalData.baseUrl; |
| 3 | -var OSSUrl = getApp().globalData.OSSUrl; | ||
| 4 | Page({ | 3 | Page({ |
| 5 | 4 | ||
| 6 | /** | 5 | /** |
| @@ -99,7 +98,7 @@ Page({ | @@ -99,7 +98,7 @@ Page({ | ||
| 99 | }) | 98 | }) |
| 100 | console.log('key', 'imagepath_' + path.substring(path.length - 10, path.length)) | 99 | console.log('key', 'imagepath_' + path.substring(path.length - 10, path.length)) |
| 101 | wx.uploadFile({ | 100 | wx.uploadFile({ |
| 102 | - url: OSSUrl, | 101 | + url: getApp().globalData.OSSUrl, |
| 103 | filePath: path, | 102 | filePath: path, |
| 104 | name: 'file', | 103 | name: 'file', |
| 105 | formData: { | 104 | formData: { |
请
注册
或
登录
后发表评论