|
本帖最后由 falost 于 2018-7-31 10:14 编辑
楼上正解,你可以试试这样写- import router from '@system.router';
- import webview from '@system.webview';
- import device from '@system.device';
- import prompt from '@system.prompt';
-
- export default {
- public:{
- isRefresh:false,
- web_url:'https://xxx.com/index.php'
- },
- onReady(){
- let temp_url = this.web_url;
- let that = this;
- device.getId({
- type: ['user'],
- success: function (data) {
- console.log(`handling success: ${data.user}`);
- if (data.user) {
- temp_url += '?token=kuai_app_' + data.user;
- }
- that.web_url = temp_url;
- console.log(that.web_url);
- },
- fail: function (data, code) {
- console.log(`handling fail, code = ${code}`)
- }
- });
- },
复制代码
|
|