我正在使用Laravel Cashier包。
我在下面添加了 AppServiceProvider.php > boot method
Cashier::ignoreMigrations();
Run Code Online (Sandbox Code Playgroud)
我创建了自己的迁移,即:create_subscriptions_table 和 create_subscription_items_table
当我运行php artisan migrate命令时,出现以下错误:
Migrating: 2019_05_03_000002_create_subscriptions_table
Illuminate\Database\QueryException
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'subscriptions' already exists (SQL: create table `subscriptions` (`id` bigint unsigned not null auto_increment primary key, `user_id` bigint unsigned not null, `name` varchar(191) not null, `stripe_id` varchar(191) not null, `stripe_status` varchar(191) not null, `stripe_plan` varchar(191) null, `quantity` int null, `trial_ends_at` timestamp null, `ends_at` timestamp null, `created_at` timestamp null, `updated_at` timestamp null) …Run Code Online (Sandbox Code Playgroud) 我收到以下axios呼叫的响应:
当我尝试从上面的链接响应中生成PDF时,用空白页生成的PDF
var fs = require('fs');
fs.writeFileSync("12345678.pdf", response.data, 'binary');
Run Code Online (Sandbox Code Playgroud)
axios呼叫:
const url = 'url-here'
const headers = {
'headers-here'
};
const axiosConfig = {
headers,
};
axios.get(url, axiosConfig)
.then((response) => {
var fs = require('fs');
fs.writeFileSync("12345678.pdf", response.data, 'binary');
callback(null, response.data);
})
.catch((error) => {
logger.error(error.stack || error.message || error);
callback(error, null);
});
Run Code Online (Sandbox Code Playgroud)
谁能帮助我生成正确的PDF?
我已经从这个链接下载了一个主题.我必须在index.html文件中定义脚本和CSS.
index.html(正文部分)
<body>
<app-root></app-root>
<script type="text/javascript" src="./assets/js/main.85741bff.js"></script>
<script type="text/javascript" src="./assets/js/common.js"></script>
</body>
Run Code Online (Sandbox Code Playgroud)
我在common.js中定义了我的函数,并从main.85741bff.js文件中调用它.
common.js(function)
document.addEventListener("DOMContentLoaded", function (event) {
masonryBuild();
navbarToggleSidebar();
navActivePage();
});
Run Code Online (Sandbox Code Playgroud)
问题是我可以在页面重新加载时调用该函数,但在内容加载时无法调用该函数.
任何人都可以帮我解决这个问题吗?任何帮助,将不胜感激.
javascript ×2
angular ×1
angular5 ×1
axios ×1
laravel-8 ×1
migration ×1
node.js ×1
pdf ×1
php ×1
typescript ×1